Skip to content

Commit 51f1262

Browse files
committed
made suggested changes and removed for loop
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent d40face commit 51f1262

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

lib/node_modules/@stdlib/stats/base/dists/planck/median/benchmark/benchmark.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
var bench = require( '@stdlib/bench' );
2424
var uniform = require( '@stdlib/random/array/uniform' );
25-
var uniform = require( '@stdlib/random/base/uniform' );
2625
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2726
var pkg = require( './../package.json' ).name;
2827
var median = require( './../lib' );
@@ -38,13 +37,12 @@ bench( pkg, function benchmark( b ) {
3837

3938
len =100;
4039
lambda = new Float64Array( len );
41-
for ( i = 0; i < len; i++ ) {
42-
lambda[ i ] = uniform( 1.0, 10.0);
43-
}
40+
41+
lambda = uniform(100, 1.0, 10.0);
4442

4543
b.tic();
4644
for ( i = 0; i < b.iterations; i++ ) {
47-
y = median( lambda[ i % len ] );
45+
y = median( lambda[ i % lambda.length ] );
4846
if ( isnan( y ) ) {
4947
b.fail( 'should not return NaN' );
5048
}

lib/node_modules/@stdlib/stats/base/dists/planck/median/benchmark/benchmark.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4747

4848
len = 100;
4949

50-
lambda = uniform(len, 0.1, 10.0);
50+
lambda = uniform(100, 0.1, 10.0);
5151

5252

5353
b.tic();
5454
for ( i = 0; i < b.iterations; i++ ) {
55-
y = median( lambda[ i % len ] );
55+
y = median( lambda[ i % lambda.length ] );
5656
if ( isnan( y ) ) {
5757
b.fail( 'should not return NaN' );
5858
}

0 commit comments

Comments
 (0)