Skip to content

Commit 29b1211

Browse files
chore: update factory code block
1 parent 6ed3bcd commit 29b1211

File tree

1 file changed

+8
-2
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/benchmark

1 file changed

+8
-2
lines changed

lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/benchmark/benchmark.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
2524
var uniform = require( '@stdlib/random/base/uniform' );
2625
var Float64Array = require( '@stdlib/array/float64' );
2726
var isnan = require( '@stdlib/math/base/assert/is-nan' );
@@ -65,6 +64,7 @@ bench( pkg, function benchmark( b ) {
6564

6665
bench( pkg+':factory', function benchmark( b ) {
6766
var mymgf;
67+
var len;
6868
var p;
6969
var t;
7070
var y;
@@ -73,10 +73,16 @@ bench( pkg+':factory', function benchmark( b ) {
7373
p = 0.3;
7474
mymgf = mgf.factory( p );
7575

76+
len = 100;
77+
t = new Float64Array( len );
78+
for ( i = 0; i < len; i++ ) {
79+
t[ i ] = uniform( 0.0, 3.0 );
80+
}
81+
7682
b.tic();
7783
for ( i = 0; i < b.iterations; i++ ) {
7884
t = randu() * 3.0;
79-
y = mymgf( t );
85+
y = mymgf( t[ i%100 ] );
8086
if ( isnan( y ) ) {
8187
b.fail( 'should not return NaN' );
8288
}

0 commit comments

Comments
 (0)