Skip to content

Commit b907636

Browse files
committed
bench: add opts for halfnormal-mode
--- 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: na - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent fabac99 commit b907636

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

lib/node_modules/@stdlib/stats/base/dists/halfnormal/mode/benchmark/benchmark.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ var mode = require( './../lib' );
3232

3333
bench( pkg, function benchmark( b ) {
3434
var sigma;
35-
var len;
35+
var opts;
3636
var y;
3737
var i;
3838

39-
len = 100;
40-
sigma = uniform( len, EPS, 20.0 );
39+
opts = {
40+
'dtype': 'float64'
41+
};
42+
sigma = uniform( 100, EPS, 20.0, opts );
4143

4244
b.tic();
4345
for ( i = 0; i < b.iterations; i++ ) {
44-
y = mode( sigma[ i % len ] );
46+
y = mode( sigma[ i%sigma.length ] );
4547
if ( isnan( y ) ) {
4648
b.fail( 'should not return NaN' );
4749
}

lib/node_modules/@stdlib/stats/base/dists/halfnormal/mode/benchmark/benchmark.native.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ var opts = {
4141

4242
bench( pkg+'::native', opts, function benchmark( b ) {
4343
var sigma;
44-
var len;
44+
var opts;
4545
var y;
4646
var i;
4747

48-
len = 100;
49-
sigma = uniform( len, EPS, 20.0 );
48+
opts = {
49+
'dtype': 'float64'
50+
};
51+
sigma = uniform( 100, EPS, 20.0, opts );
5052

5153
b.tic();
5254
for ( i = 0; i < b.iterations; i++ ) {
53-
y = mode( sigma[ i % len ] );
55+
y = mode( sigma[ i%sigma.length ] );
5456
if ( isnan( y ) ) {
5557
b.fail( 'should not return NaN' );
5658
}

0 commit comments

Comments
 (0)