diff --git a/lib/node_modules/@stdlib/math/base/special/README.md b/lib/node_modules/@stdlib/math/base/special/README.md index 59fbd65ea53e..301c207472c0 100644 --- a/lib/node_modules/@stdlib/math/base/special/README.md +++ b/lib/node_modules/@stdlib/math/base/special/README.md @@ -90,7 +90,7 @@ var fcns = special; - [`acoversin( x )`][@stdlib/math/base/special/acoversin]: compute the inverse coversed sine. - [`acoversinf( x )`][@stdlib/math/base/special/acoversinf]: compute the inverse coversed sine of a single-precision floating-point number (in radians). - [`ahavercos( x )`][@stdlib/math/base/special/ahavercos]: compute the inverse half-value versed cosine. -- [`ahavercosf( x )`][@stdlib/math/base/special/ahavercosf]: compute the inverse half-value versed cosine of a single-precision floating point number. +- [`ahavercosf( x )`][@stdlib/math/base/special/ahavercosf]: compute the inverse half-value versed cosine of a single-precision floating-point number. - [`ahaversin( x )`][@stdlib/math/base/special/ahaversin]: compute the inverse half-value versed sine. - [`ahaversinf( x )`][@stdlib/math/base/special/ahaversinf]: compute the inverse half-value versed sine of a single-precision floating-point number. - [`asin( x )`][@stdlib/math/base/special/asin]: compute the arcsine of a double-precision floating-point number. diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2/test/test.js b/lib/node_modules/@stdlib/math/base/special/rempio2/test/test.js index e4d595e30878..7c8af1ced86d 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/rempio2/test/test.js @@ -68,7 +68,7 @@ tape( 'the function returns `0` and sets the elements of `y` to `NaN` if provide t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (positive)', function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (positive)', function test( t ) { var x; var y; var z; @@ -90,7 +90,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (tiny positive)', function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (tiny positive)', function test( t ) { var x; var y; var z; @@ -112,7 +112,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (negative)', function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (negative)', function test( t ) { var x; var y; var z; @@ -134,7 +134,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (tiny negative)', function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (tiny negative)', function test( t ) { var x; var y; var z; @@ -156,7 +156,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (multiples of π/4)', function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (multiples of π/4)', function test( t ) { var x; var y; var z; @@ -178,7 +178,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'for large positive input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating point numbers in `y`', function test( t ) { +tape( 'for large positive input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating-point numbers in `y`', function test( t ) { var x; var y; var n; @@ -196,7 +196,7 @@ tape( 'for large positive input values, the function returns the last three bina t.end(); }); -tape( 'for large negative input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating point numbers in `y`', function test( t ) { +tape( 'for large negative input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating-point numbers in `y`', function test( t ) { var x; var y; var n; @@ -214,7 +214,7 @@ tape( 'for large negative input values, the function returns the last three bina t.end(); }); -tape( 'for huge positive input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating point numbers in `y`', function test( t ) { +tape( 'for huge positive input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating-point numbers in `y`', function test( t ) { var x; var y; var n; @@ -232,7 +232,7 @@ tape( 'for huge positive input values, the function returns the last three binar t.end(); }); -tape( 'for huge negative input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating point numbers in `y`', function test( t ) { +tape( 'for huge negative input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating-point numbers in `y`', function test( t ) { var x; var y; var n; diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/rempio2/test/test.native.js index 0cd39b8ad88e..25628dfa5110 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/rempio2/test/test.native.js @@ -78,7 +78,7 @@ tape( 'the function returns `0` and sets the elements of `y` to `NaN` if provide t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (positive)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (positive)', opts, function test( t ) { var x; var y; var z; @@ -100,7 +100,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (tiny positive)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (tiny positive)', opts, function test( t ) { var x; var y; var z; @@ -122,7 +122,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (negative)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (negative)', opts, function test( t ) { var x; var y; var z; @@ -144,7 +144,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (tiny negative)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (tiny negative)', opts, function test( t ) { var x; var y; var z; @@ -166,7 +166,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (multiples of π/4)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as two double-precision floating-point numbers in `y` such that `x - nπ/2 = r` (multiples of π/4)', opts, function test( t ) { var x; var y; var z; @@ -188,7 +188,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating t.end(); }); -tape( 'for large positive input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating point numbers in `y`', opts, function test( t ) { +tape( 'for large positive input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating-point numbers in `y`', opts, function test( t ) { var x; var y; var n; @@ -206,7 +206,7 @@ tape( 'for large positive input values, the function returns the last three bina t.end(); }); -tape( 'for large negative input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating point numbers in `y`', opts, function test( t ) { +tape( 'for large negative input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating-point numbers in `y`', opts, function test( t ) { var x; var y; var n; @@ -224,7 +224,7 @@ tape( 'for large negative input values, the function returns the last three bina t.end(); }); -tape( 'for huge positive input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating point numbers in `y`', opts, function test( t ) { +tape( 'for huge positive input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating-point numbers in `y`', opts, function test( t ) { var x; var y; var n; @@ -242,7 +242,7 @@ tape( 'for huge positive input values, the function returns the last three binar t.end(); }); -tape( 'for huge negative input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating point numbers in `y`', opts, function test( t ) { +tape( 'for huge negative input values, the function returns the last three binary digits of `n` and stores `r` as two double-precision floating-point numbers in `y`', opts, function test( t ) { var x; var y; var n; diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2f/test/test.js b/lib/node_modules/@stdlib/math/base/special/rempio2f/test/test.js index d24be5505a86..a08daab47e7d 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2f/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/rempio2f/test/test.js @@ -66,7 +66,7 @@ tape( 'the function returns `0` and sets `y[0]` to `NaN` if provided positive or t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (positive)', function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (positive)', function test( t ) { var x; var y; var z; @@ -87,7 +87,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (tiny positive)', function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (tiny positive)', function test( t ) { var x; var y; var z; @@ -108,7 +108,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (negative)', function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (negative)', function test( t ) { var x; var y; var z; @@ -129,7 +129,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (tiny negative)', function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (tiny negative)', function test( t ) { var x; var y; var z; @@ -150,7 +150,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (multiples of π/4)', function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (multiples of π/4)', function test( t ) { var x; var y; var z; @@ -172,7 +172,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'for large positive input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating point number in `y`', function test( t ) { +tape( 'for large positive input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating-point number in `y`', function test( t ) { var x; var y; var n; @@ -190,7 +190,7 @@ tape( 'for large positive input values, the function returns the last three bina t.end(); }); -tape( 'for large negative input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating point number in `y`', function test( t ) { +tape( 'for large negative input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating-point number in `y`', function test( t ) { var x; var y; var n; @@ -208,7 +208,7 @@ tape( 'for large negative input values, the function returns the last three bina t.end(); }); -tape( 'for huge positive input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating point number in `y`', function test( t ) { +tape( 'for huge positive input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating-point number in `y`', function test( t ) { var x; var y; var n; @@ -226,7 +226,7 @@ tape( 'for huge positive input values, the function returns the last three binar t.end(); }); -tape( 'for huge negative input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating point number in `y`', function test( t ) { +tape( 'for huge negative input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating-point number in `y`', function test( t ) { var x; var y; var n; diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2f/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/rempio2f/test/test.native.js index c1d807e14314..bb5ee840428e 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2f/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/rempio2f/test/test.native.js @@ -76,7 +76,7 @@ tape( 'the function returns `0` and sets `y[0]` to `NaN` if provided positive or t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (positive)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (positive)', opts, function test( t ) { var x; var y; var z; @@ -97,7 +97,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (tiny positive)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (tiny positive)', opts, function test( t ) { var x; var y; var z; @@ -118,7 +118,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (negative)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (negative)', opts, function test( t ) { var x; var y; var z; @@ -139,7 +139,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (tiny negative)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (tiny negative)', opts, function test( t ) { var x; var y; var z; @@ -160,7 +160,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'the function returns `n` and stores `r` as a double-precision floating point number in `y` such that `x - nπ/2 = r` (multiples of π/4)', opts, function test( t ) { +tape( 'the function returns `n` and stores `r` as a double-precision floating-point number in `y` such that `x - nπ/2 = r` (multiples of π/4)', opts, function test( t ) { var x; var y; var z; @@ -182,7 +182,7 @@ tape( 'the function returns `n` and stores `r` as a double-precision floating po t.end(); }); -tape( 'for large positive input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating point number in `y`', opts, function test( t ) { +tape( 'for large positive input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating-point number in `y`', opts, function test( t ) { var x; var y; var n; @@ -200,7 +200,7 @@ tape( 'for large positive input values, the function returns the last three bina t.end(); }); -tape( 'for large negative input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating point number in `y`', opts, function test( t ) { +tape( 'for large negative input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating-point number in `y`', opts, function test( t ) { var x; var y; var n; @@ -218,7 +218,7 @@ tape( 'for large negative input values, the function returns the last three bina t.end(); }); -tape( 'for huge positive input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating point number in `y`', opts, function test( t ) { +tape( 'for huge positive input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating-point number in `y`', opts, function test( t ) { var x; var y; var n; @@ -236,7 +236,7 @@ tape( 'for huge positive input values, the function returns the last three binar t.end(); }); -tape( 'for huge negative input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating point number in `y`', opts, function test( t ) { +tape( 'for huge negative input values, the function returns the last three binary digits of `n` and stores `r` as a double-precision floating-point number in `y`', opts, function test( t ) { var x; var y; var n; diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/cdf/examples/c/example.c b/lib/node_modules/@stdlib/stats/base/dists/normal/cdf/examples/c/example.c index fccbf64b4e6a..9799d0e30e71 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/cdf/examples/c/example.c +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/cdf/examples/c/example.c @@ -19,7 +19,6 @@ #include "stdlib/stats/base/dists/normal/cdf.h" #include #include -#include static double random_uniform( const double min, const double max ) { double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/logpdf/examples/c/example.c b/lib/node_modules/@stdlib/stats/base/dists/normal/logpdf/examples/c/example.c index e778668d83e3..f2be3e020bfe 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/logpdf/examples/c/example.c +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/logpdf/examples/c/example.c @@ -19,7 +19,6 @@ #include "stdlib/stats/base/dists/normal/logpdf.h" #include #include -#include static double random_uniform( const double min, const double max ) { double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmax/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmax/benchmark/benchmark.js index a0cb7673979e..1668dd29452c 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmax/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -35,13 +37,36 @@ var nanmskmax = require( './../lib' ); var options = { 'dtype': 'generic' }; -var mopts = { +var moptions = { 'dtype': 'uint8' }; // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - x = uniform( [ len ], -100.0, 100.0, options ); - mask = bernoulli( [ len ], 0.2, mopts ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark; diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmidrange/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmidrange/benchmark/benchmark.js index 3bd7d7eb9b99..d16950215387 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmidrange/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmidrange/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -35,13 +37,36 @@ var nanmskmidrange = require( './../lib' ); var options = { 'dtype': 'generic' }; -var mopts = { +var moptions = { 'dtype': 'uint8' }; // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - x = uniform( [ len ], -100.0, 100.0, options ); - mask = bernoulli( [ len ], 0.2, mopts ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark; diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmin/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmin/benchmark/benchmark.js index f4e60d382bcc..194250d84b97 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmin/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/nanmskmin/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -35,13 +37,36 @@ var nanmskmin = require( './../lib' ); var options = { 'dtype': 'generic' }; -var mopts = { +var moptions = { 'dtype': 'uint8' }; // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - x = uniform( [ len ], -100.0, 100.0, options ); - mask = bernoulli( [ len ], 0.2, mopts ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark; diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/nanmskrange/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/nanmskrange/benchmark/benchmark.js index d0927e2b6a4d..f4c08d60b20f 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/nanmskrange/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/nanmskrange/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -35,13 +37,36 @@ var nanmskrange = require( './../lib' ); var options = { 'dtype': 'generic' }; -var mopts = { +var moptions = { 'dtype': 'uint8' }; // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - x = uniform( [ len ], -100.0, 100.0, options ); - mask = bernoulli( [ len ], 0.2, mopts ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark; diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmax/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmax/benchmark/benchmark.js index 16279b6e5fdf..96160a31443b 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmax/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -42,6 +44,29 @@ var moptions = { // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - mask = bernoulli( [ len ], 0.2, moptions ); - x = uniform( [ len ], -100.0, 100.0, options ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark; diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmaxabs/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmaxabs/benchmark/benchmark.js index 6cfb332f1c72..f9066d0644fd 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmaxabs/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmaxabs/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -42,6 +44,29 @@ var moptions = { // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - mask = bernoulli( [ len ], 0.2, moptions ); - x = uniform( [ len ], -100.0, 100.0, options ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark; diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmidrange/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmidrange/benchmark/benchmark.js index 5c9f1ba14695..dec2504746cc 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmidrange/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmidrange/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -42,6 +44,29 @@ var moptions = { // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - mask = bernoulli( [ len ], 0.2, moptions ); - x = uniform( [ len ], -100.0, 100.0, options ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark; diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmin/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmin/benchmark/benchmark.js index 24b583e946a0..bcefddedbca4 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmin/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskmin/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -42,6 +44,29 @@ var moptions = { // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - mask = bernoulli( [ len ], 0.2, moptions ); - x = uniform( [ len ], -100.0, 100.0, options ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark; diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskminabs/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskminabs/benchmark/benchmark.js index 5fc2a866177d..83e1d1389827 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskminabs/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskminabs/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -42,6 +44,29 @@ var moptions = { // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - mask = bernoulli( [ len ], 0.2, moptions ); - x = uniform( [ len ], -100.0, 100.0, options ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark; diff --git a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskrange/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskrange/benchmark/benchmark.js index f53055ad0dda..d43541f5fb1c 100644 --- a/lib/node_modules/@stdlib/stats/base/ndarray/snanmskrange/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/ndarray/snanmskrange/benchmark/benchmark.js @@ -21,8 +21,10 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/uniform' ); -var bernoulli = require( '@stdlib/random/bernoulli' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var bernoulli = require( '@stdlib/random/base/bernoulli' ); +var fillBy = require( '@stdlib/ndarray/fill-by' ); +var zeros = require( '@stdlib/ndarray/zeros' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var format = require( '@stdlib/string/format' ); @@ -42,6 +44,29 @@ var moptions = { // FUNCTIONS // +/** +* Returns a random number. +* +* @private +* @returns {number} random number +*/ +function rand() { + if ( bernoulli( 0.8 ) < 1 ) { + return NaN; + } + return uniform( -10.0, 10.0 ); +} + +/** +* Returns a random mask value. +* +* @private +* @returns {integer} random mask value +*/ +function mrand() { + return bernoulli( 0.2 ); +} + /** * Creates a benchmark function. * @@ -53,8 +78,8 @@ function createBenchmark( len ) { var mask; var x; - mask = bernoulli( [ len ], 0.2, moptions ); - x = uniform( [ len ], -100.0, 100.0, options ); + x = fillBy( zeros( [ len ], options ), rand ); + mask = fillBy( zeros( [ len ], moptions ), mrand ); return benchmark;