Skip to content

Commit 1d1fa58

Browse files
committed
chore: clean-up
Ref: 6a3edd8 --- 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: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: passed - 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 a416e9d commit 1d1fa58

File tree

5 files changed

+14
-37
lines changed

5 files changed

+14
-37
lines changed

lib/node_modules/@stdlib/stats/base/dists/bradford/quantile/benchmark/benchmark.native.js

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

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var Float64Array = require( '@stdlib/array/float64' );
26-
var uniform = require( '@stdlib/random/base/uniform' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
2726
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2827
var tryRequire = require( '@stdlib/utils/try-require' );
2928
var pkg = require( './../package.json' ).name;
@@ -40,23 +39,21 @@ var opts = {
4039
// MAIN //
4140

4241
bench( pkg+'::native', opts, function benchmark( b ) {
43-
var len;
42+
var opts;
4443
var p;
4544
var c;
4645
var y;
4746
var i;
4847

49-
len = 100;
50-
p = new Float64Array( len );
51-
c = new Float64Array( len );
52-
for ( i = 0; i < len; i++ ) {
53-
p[ i ] = uniform( 0.0, 1.0 );
54-
c[ i ] = uniform( 0.1, 10.0 );
55-
}
48+
opts = {
49+
'dtype': 'float64'
50+
};
51+
p = uniform( 100, 0.0, 1.0, opts );
52+
c = uniform( 100, 0.1, 10.0, opts );
5653

5754
b.tic();
5855
for ( i = 0; i < b.iterations; i++ ) {
59-
y = quantile( p[ i % len ], c[ i % len ] );
56+
y = quantile( p[ i % p.length ], c[ i % c.length ] );
6057
if ( isnan( y ) ) {
6158
b.fail( 'should not return NaN' );
6259
}

lib/node_modules/@stdlib/stats/base/dists/bradford/quantile/benchmark/c/benchmark.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,10 @@ static double benchmark( void ) {
100100
double y;
101101
int i;
102102

103-
// Generate test data:
104103
for ( i = 0; i < 100; i++ ) {
105104
p[ i ] = random_uniform( 0.0, 1.0 );
106105
c[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
107106
}
108-
109-
// Run the benchmark:
110107
t = tic();
111108
for ( i = 0; i < ITERATIONS; i++ ) {
112109
y = stdlib_base_dists_bradford_quantile( p[ i % 100 ], c[ i % 100 ] );
@@ -127,21 +124,17 @@ static double benchmark( void ) {
127124
*/
128125
int main( void ) {
129126
double elapsed;
130-
int count;
131127
int i;
132128

133129
// Use the current time to seed the pseudorandom number generator:
134130
srand( time( NULL ) );
135131

136132
print_version();
137-
count = 0;
138133
for ( i = 0; i < REPEATS; i++ ) {
139-
count += 1;
140134
printf( "# c::%s\n", NAME );
141135
elapsed = benchmark();
142-
printf( "ok %d benchmark finished\n", count );
143136
print_results( elapsed );
144-
printf( "\n" );
137+
printf( "ok %d benchmark finished\n", i+1 );
145138
}
146-
print_summary( count, count );
139+
print_summary( REPEATS, REPEATS );
147140
}

lib/node_modules/@stdlib/stats/base/dists/bradford/quantile/lib/factory.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ var log1p = require( '@stdlib/math/base/special/log1p' );
4646
* // returns 1.0
4747
*/
4848
function factory( c ) {
49-
if (
50-
isnan( c ) ||
51-
c <= 0.0
52-
) {
49+
if ( isnan( c ) || c <= 0.0 ) {
5350
return constantFunction( NaN );
5451
}
5552
return quantile;
@@ -66,11 +63,7 @@ function factory( c ) {
6663
* // returns <number>
6764
*/
6865
function quantile( p ) {
69-
if (
70-
isnan( p ) ||
71-
p < 0.0 ||
72-
p > 1.0
73-
) {
66+
if ( isnan( p ) || p < 0.0 || p > 1.0 ) {
7467
return NaN;
7568
}
7669
return expm1( p * log1p( c ) ) / c;

lib/node_modules/@stdlib/stats/base/dists/bradford/quantile/lib/main.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,7 @@ var log1p = require( '@stdlib/math/base/special/log1p' );
6767
* // returns NaN
6868
*/
6969
function quantile( p, c ) {
70-
if (
71-
isnan( c ) ||
72-
isnan( p ) ||
73-
c <= 0.0 ||
74-
p < 0.0 ||
75-
p > 1.0
76-
) {
70+
if ( isnan( c ) || isnan( p ) || c <= 0.0 || p < 0.0 || p > 1.0 ) {
7771
return NaN;
7872
}
7973
return expm1( p * log1p( c ) ) / c;

lib/node_modules/@stdlib/stats/base/dists/bradford/quantile/test/test.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ tape( 'if provided `c <= 0`, the function returns `NaN`', opts, function test( t
8080
t.end();
8181
});
8282

83-
tape( 'if provided a probability outside [0,1], the function returns `NaN`', opts, function test( t ) {
83+
tape( 'if provided a number outside `[0,1]` for `p` and a valid `c`, the function returns `NaN`', opts, function test( t ) {
8484
var y;
8585

8686
y = quantile( 2.0, 1.0 );

0 commit comments

Comments
 (0)