Skip to content

Commit e976bd1

Browse files
committed
chore: clean-up
--- 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: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - 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 ---
1 parent 192e98f commit e976bd1

File tree

5 files changed

+14
-29
lines changed

5 files changed

+14
-29
lines changed

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

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

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25+
var Float64Array = require( '@stdlib/array/float64' );
2526
var uniform = require( '@stdlib/random/base/uniform' );
2627
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2728
var tryRequire = require( '@stdlib/utils/try-require' );
@@ -41,14 +42,21 @@ var opts = {
4142
bench( pkg+'::native', opts, function benchmark( b ) {
4243
var min;
4344
var max;
45+
var len;
4446
var y;
4547
var i;
4648

49+
len = 100;
50+
min = new Float64Array( len );
51+
max = new Float64Array( len );
52+
for ( i = 0; i < len; i++ ) {
53+
min[ i ] = uniform( 0.0, 10.0 );
54+
max[ i ] = uniform( min[ i ], min[ i ] + 10.0 );
55+
}
56+
4757
b.tic();
4858
for ( i = 0; i < b.iterations; i++ ) {
49-
min = uniform( 0.0, 10.0 );
50-
max = uniform( min, min+10.0 );
51-
y = median( min, max );
59+
y = median( min[ i % len ], max[ i % len ] );
5260
if ( isnan( y ) ) {
5361
b.fail( 'should not return NaN' );
5462
}

lib/node_modules/@stdlib/stats/base/dists/arcsine/median/lib/main.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@
5252
* // returns NaN
5353
*/
5454
function median( a, b ) {
55-
if (
56-
a >= b
57-
) {
55+
if ( a >= b ) {
5856
return NaN;
5957
}
6058
return 0.5 * ( a + b );

lib/node_modules/@stdlib/stats/base/dists/arcsine/median/src/addon.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@
1818

1919
#include "stdlib/stats/base/dists/arcsine/median.h"
2020

21-
// cppcheck-suppress shadowFunction
2221
STDLIB_MATH_BASE_NAPI_MODULE_DDD_D( stdlib_base_dists_arcsine_median );

lib/node_modules/@stdlib/stats/base/dists/arcsine/median/test/test.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var abs = require( '@stdlib/math/base/special/abs' );
2524
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2625
var PINF = require( '@stdlib/constants/float64/pinf' );
2726
var NINF = require( '@stdlib/constants/float64/ninf' );
28-
var EPS = require( '@stdlib/constants/float64/eps' );
2927
var median = require( './../lib' );
3028

3129

@@ -72,8 +70,6 @@ tape( 'if provided `a >= b`, the function returns `NaN`', function test( t ) {
7270

7371
tape( 'the function returns the median of an arcsine distribution', function test( t ) {
7472
var expected;
75-
var delta;
76-
var tol;
7773
var a;
7874
var b;
7975
var i;
@@ -84,13 +80,7 @@ tape( 'the function returns the median of an arcsine distribution', function tes
8480
b = data.b;
8581
for ( i = 0; i < expected.length; i++ ) {
8682
y = median( a[i], b[i] );
87-
if ( y === expected[i] ) {
88-
t.equal( y, expected[i], 'a: '+a[i]+', b: '+b[i]+', y: '+y+', expected: '+expected[i] );
89-
} else {
90-
delta = abs( y - expected[ i ] );
91-
tol = 1.0 * EPS * abs( expected[ i ] );
92-
t.ok( delta <= tol, 'within tolerance. a: '+a[i]+'. b: '+b[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
93-
}
83+
t.equal( y, expected[i], 'a: '+a[i]+', b: '+b[i]+', y: '+y+', expected: '+expected[i] );
9484
}
9585
t.end();
9686
});

lib/node_modules/@stdlib/stats/base/dists/arcsine/median/test/test.native.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@
2323
var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
2525
var tryRequire = require( '@stdlib/utils/try-require' );
26-
var abs = require( '@stdlib/math/base/special/abs' );
2726
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2827
var PINF = require( '@stdlib/constants/float64/pinf' );
2928
var NINF = require( '@stdlib/constants/float64/ninf' );
30-
var EPS = require( '@stdlib/constants/float64/eps' );
3129

3230

3331
// FIXTURES //
@@ -81,8 +79,6 @@ tape( 'if provided `a >= b`, the function returns `NaN`', opts, function test( t
8179

8280
tape( 'the function returns the median of an arcsine distribution', opts, function test( t ) {
8381
var expected;
84-
var delta;
85-
var tol;
8682
var a;
8783
var b;
8884
var i;
@@ -93,13 +89,7 @@ tape( 'the function returns the median of an arcsine distribution', opts, functi
9389
b = data.b;
9490
for ( i = 0; i < expected.length; i++ ) {
9591
y = median( a[i], b[i] );
96-
if ( y === expected[i] ) {
97-
t.equal( y, expected[i], 'a: '+a[i]+', b: '+b[i]+', y: '+y+', expected: '+expected[i] );
98-
} else {
99-
delta = abs( y - expected[ i ] );
100-
tol = 1.0 * EPS * abs( expected[ i ] );
101-
t.ok( delta <= tol, 'within tolerance. a: '+a[i]+'. b: '+b[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
102-
}
92+
t.equal( y, expected[i], 'a: '+a[i]+', b: '+b[i]+', y: '+y+', expected: '+expected[i] );
10393
}
10494
t.end();
10595
});

0 commit comments

Comments
 (0)