Skip to content

Commit 0f7f758

Browse files
committed
refactor: added include in main.c and fixed the JS benchmark number generation
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- 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 01d4081 commit 0f7f758

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

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

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

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
24+
var uniform = require( '@stdlib/random/base/uniform' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var pkg = require( './../package.json' ).name;
2727
var median = require( './../lib' );
@@ -36,7 +36,7 @@ bench( pkg, function benchmark( b ) {
3636

3737
b.tic();
3838
for ( i = 0; i < b.iterations; i++ ) {
39-
mu = ( randu()*100.0 ) - 50.0;
39+
mu = uniform( -50.0, 50.0 );
4040
y = median( mu );
4141
if ( isnan( y ) ) {
4242
b.fail( 'should not return NaN' );

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
26-
var randu = require( '@stdlib/random/base/randu' );
26+
var uniform = require( '@stdlib/random/base/uniform' );
2727
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2828
var tryRequire = require( '@stdlib/utils/try-require' );
2929
var pkg = require( './../package.json' ).name;
@@ -48,7 +48,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4848
len = 100;
4949
mu = new Float64Array( len );
5050
for ( i = 0; i < len; i++ ) {
51-
mu[ i ] = ( randu() * 40.0 ) - 20.0;
51+
mu[ i ] = uniform( -50.0, 50.0 );
5252
}
5353

5454
b.tic();

lib/node_modules/@stdlib/stats/base/dists/degenerate/median/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include "stdlib/math/base/assert/is_nan.h"
20+
#include "stdlib/stats/base/dists/degenerate/median.h"
2021

2122
/**
2223
* Returns the median of a degenerate distribution.

0 commit comments

Comments
 (0)