File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed
lib/node_modules/@stdlib/stats/base/nanminabs/benchmark Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change 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.
2121// MODULES //
2222
2323var bench = require ( '@stdlib/bench' ) ;
24- var randu = require ( '@stdlib/random/base/randu ' ) ;
24+ var uniform = require ( '@stdlib/random/array/uniform ' ) ;
2525var isnan = require ( '@stdlib/math/base/assert/is-nan' ) ;
2626var pow = require ( '@stdlib/math/base/special/pow' ) ;
2727var pkg = require ( './../package.json' ) . name ;
2828var 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*/
4043function 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 ) {
You can’t perform that action at this time.
0 commit comments