Skip to content

Commit e5f5847

Browse files
authored
Update benchmark.js
Signed-off-by: Kaushikgtm <[email protected]>
1 parent 9405254 commit e5f5847

File tree

1 file changed

+7
-14
lines changed
  • lib/node_modules/@stdlib/stats/base/nanminabs/benchmark

1 file changed

+7
-14
lines changed

lib/node_modules/@stdlib/stats/base/nanminabs/benchmark/benchmark.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2020 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -21,13 +21,16 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var pow = require( '@stdlib/math/base/special/pow' );
2727
var pkg = require( './../package.json' ).name;
2828
var nanminabs = require( './../lib/nanminabs.js' );
2929

30-
30+
// VARIABLES //
31+
var options = {
32+
'dtype': 'generic'
33+
};
3134
// FUNCTIONS //
3235

3336
/**
@@ -38,17 +41,7 @@ var nanminabs = require( './../lib/nanminabs.js' );
3841
* @returns {Function} benchmark function
3942
*/
4043
function createBenchmark( len ) {
41-
var x;
42-
var i;
43-
44-
x = [];
45-
for ( i = 0; i < len; i++ ) {
46-
if ( randu() < 0.2 ) {
47-
x.push( NaN );
48-
} else {
49-
x.push( ( randu()*20.0 ) - 10.0 );
50-
}
51-
}
44+
var x = uniform( len, -10, 10, options );
5245
return benchmark;
5346

5447
function benchmark( b ) {

0 commit comments

Comments
 (0)