Skip to content

Commit bc29fc3

Browse files
committed
chore: clean-up
Ref: bd51ebe --- 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: passed - 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: 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 1d1fa58 commit bc29fc3

File tree

6 files changed

+15
-30
lines changed

6 files changed

+15
-30
lines changed

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

Lines changed: 7 additions & 9 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,20 +39,19 @@ var opts = {
4039
// MAIN //
4140

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

48-
len = 100;
49-
c = new Float64Array( len );
50-
for ( i = 0; i < len; i++ ) {
51-
c[ i ] = uniform( 0.1, 10.0 );
52-
}
47+
opts = {
48+
'dtype': 'float64'
49+
};
50+
c = uniform( 100, 0.1, 10.0, opts );
5351

5452
b.tic();
5553
for ( i = 0; i < b.iterations; i++ ) {
56-
y = mean( c[ i % len ] );
54+
y = mean( c[ i % c.length ] );
5755
if ( isnan( y ) ) {
5856
b.fail( 'should not return NaN' );
5957
}

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

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

102-
// Generate test data:
103102
for ( i = 0; i < 100; i++ ) {
104103
c[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
105104
}
106-
107-
// Run the benchmark:
108105
t = tic();
109106
for ( i = 0; i < ITERATIONS; i++ ) {
110107
y = stdlib_base_dists_bradford_mean( c[ i % 100 ] );
@@ -125,21 +122,17 @@ static double benchmark( void ) {
125122
*/
126123
int main( void ) {
127124
double elapsed;
128-
int count;
129125
int i;
130126

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

134130
print_version();
135-
count = 0;
136131
for ( i = 0; i < REPEATS; i++ ) {
137-
count += 1;
138132
printf( "# c::%s\n", NAME );
139133
elapsed = benchmark();
140-
printf( "ok %d benchmark finished\n", count );
141134
print_results( elapsed );
142-
printf( "\n" );
135+
printf( "ok %d benchmark finished\n", i+1 );
143136
}
144-
print_summary( count, count );
137+
print_summary( REPEATS, REPEATS );
145138
}

lib/node_modules/@stdlib/stats/base/dists/bradford/mean/docs/repl.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
{{alias}}( c )
3-
Returns the expected value of a Bradford distribution with shape
4-
parameter `c`.
3+
Returns the expected value of a Bradford distribution with shape parameter
4+
`c`.
55

66
If `c <= 0`, the function returns `NaN`.
77

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ var ln = require( '@stdlib/math/base/special/ln' );
5858
*/
5959
function mean( c ) {
6060
var k;
61-
if (
62-
isnan( c ) ||
63-
c <= 0.0
64-
) {
61+
if ( isnan( c ) || c <= 0.0 ) {
6562
return NaN;
6663
}
6764
k = ln( 1.0 + c );

lib/node_modules/@stdlib/stats/base/dists/bradford/mean/src/main.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@
3232
*/
3333
double stdlib_base_dists_bradford_mean( const double c ) {
3434
double k;
35-
if (
36-
stdlib_base_is_nan( c ) ||
37-
c <= 0.0
38-
) {
35+
if ( stdlib_base_is_nan( c ) || c <= 0.0 ) {
3936
return 0.0/0.0; // NaN
4037
}
4138
k = stdlib_base_ln( 1.0 + c );

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ tape( 'main export is a function', function test( t ) {
4141
t.end();
4242
});
4343

44-
tape( 'if provided `NaN` for `c`, the function returns `NaN`', function test( t ) {
44+
tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) {
4545
var v = mean( NaN );
4646
t.equal( isnan( v ), true, 'returns expected value' );
4747
t.end();
@@ -62,7 +62,7 @@ tape( 'if provided `c <= 0`, the function returns `NaN`', function test( t ) {
6262
t.end();
6363
});
6464

65-
tape( 'the function returns the mean of a Bradford distribution', function test( t ) {
65+
tape( 'the function returns the expected value of a Bradford distribution', function test( t ) {
6666
var expected;
6767
var delta;
6868
var tol;

0 commit comments

Comments
 (0)