Skip to content

Commit b37c9c4

Browse files
committed
Refactor random number generation in JS benchmarks
--- 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: na - 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 c5d40da commit b37c9c4

File tree

6 files changed

+84
-83
lines changed

6 files changed

+84
-83
lines changed

lib/node_modules/@stdlib/stats/base/dists/planck/skewness/benchmark/benchmark.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
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' );
25+
var Float64Array = require( '@stdlib/array/float64' );
2526
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2627
var pkg = require( './../package.json' ).name;
2728
var skewness = require( './../lib' );
@@ -39,7 +40,7 @@ bench( pkg, function benchmark( b ) {
3940
lambda = new Float64Array( len );
4041

4142
for ( i = 0; i < len; i++ ) {
42-
lambda[ i ] = ( randu() * 10.0 ) + 1.0;
43+
lambda[ i ] = uniform( 1.0, 10.0 );
4344
}
4445

4546
b.tic();

lib/node_modules/@stdlib/stats/base/dists/planck/skewness/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;
@@ -49,7 +49,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4949
lambda = new Float64Array( len );
5050

5151
for ( i = 0; i < len; i++ ) {
52-
lambda[ i ] = ( randu() * 10.0 ) + 1.0;
52+
lambda[ i ] = uniform( 1.0, 10.0 );
5353
}
5454

5555
b.tic();

lib/node_modules/@stdlib/stats/base/dists/planck/skewness/include/stdlib/stats/base/dists/planck/skewness.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
#endif
2828

2929
/**
30-
* Evaluates the skewness of a Planck distribution with shape parameter `λ` (lambda).
30+
*Returns the skewness for an planck distribution with shape parameter 'lambda'.
3131
*/
3232
double stdlib_base_dists_planck_skewness( const double lambda);
3333

lib/node_modules/@stdlib/stats/base/dists/planck/skewness/lib/native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var addon = require( './../src/addon.node' );
2626
// MAIN //
2727

2828
/**
29-
* Computes the skewness of a Planck distribution with shape parameter `lambda`.
29+
*Returns the skewness for an planck distribution with shape parameter 'lambda'.
3030
*
3131
* @private
3232
* @param {number} lambda - shape parameter
Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
11
{
2-
"options": {
2+
"options": {
3+
"task": "build",
4+
"wasm": false
5+
},
6+
"fields": [
7+
{
8+
"field": "src",
9+
"resolve": true,
10+
"relative": true
11+
},
12+
{
13+
"field": "include",
14+
"resolve": true,
15+
"relative": true
16+
},
17+
{
18+
"field": "libraries",
19+
"resolve": false,
20+
"relative": false
21+
},
22+
{
23+
"field": "libpath",
24+
"resolve": true,
25+
"relative": false
26+
}
27+
],
28+
"confs": [
29+
{
330
"task": "build",
4-
"wasm": false
31+
"wasm": false,
32+
"src": [
33+
"./src/main.c"
34+
],
35+
"include": [
36+
"./include"
37+
],
38+
"libraries": [],
39+
"libpath": [],
40+
"dependencies": [
41+
"@stdlib/math/base/napi/unary",
42+
"@stdlib/math/base/assert/is-nan",
43+
"@stdlib/math/base/special/cosh"
44+
]
45+
},
46+
{
47+
"task": "benchmark",
48+
"wasm": false,
49+
"src": [
50+
"./src/main.c"
51+
],
52+
"include": [
53+
"./include"
54+
],
55+
"libraries": [],
56+
"libpath": [],
57+
"dependencies": [
58+
"@stdlib/math/base/assert/is-nan",
59+
"@stdlib/math/base/special/cosh"
60+
]
561
},
6-
"fields": [
7-
{
8-
"field": "src",
9-
"resolve": true,
10-
"relative": true
11-
},
12-
{
13-
"field": "include",
14-
"resolve": true,
15-
"relative": true
16-
},
17-
{
18-
"field": "libraries",
19-
"resolve": false,
20-
"relative": false
21-
},
22-
{
23-
"field": "libpath",
24-
"resolve": true,
25-
"relative": false
26-
}
27-
],
28-
"confs": [
29-
{
30-
"task": "build",
31-
"wasm": false,
32-
"src": [
33-
"./src/main.c"
34-
],
35-
"include": [
36-
"./include"
37-
],
38-
"libraries": [],
39-
"libpath": [],
40-
"dependencies": [
41-
"@stdlib/math/base/napi/unary",
42-
"@stdlib/math/base/assert/is-nan",
43-
"@stdlib/math/base/special/cosh"
44-
]
45-
},
46-
{
47-
"task": "benchmark",
48-
"wasm": false,
49-
"src": [
50-
"./src/main.c"
51-
],
52-
"include": [
53-
"./include"
54-
],
55-
"libraries": [],
56-
"libpath": [],
57-
"dependencies": [
58-
"@stdlib/math/base/assert/is-nan",
59-
"@stdlib/math/base/special/cosh"
60-
]
61-
},
62-
{
63-
"task": "examples",
64-
"wasm": false,
65-
"src": [
66-
"./src/main.c"
67-
],
68-
"include": [
69-
"./include"
70-
],
71-
"libraries": [],
72-
"libpath": [],
73-
"dependencies": [
74-
"@stdlib/math/base/assert/is-nan",
75-
"@stdlib/math/base/special/cosh"
76-
]
77-
}
78-
]
79-
}
62+
{
63+
"task": "examples",
64+
"wasm": false,
65+
"src": [
66+
"./src/main.c"
67+
],
68+
"include": [
69+
"./include"
70+
],
71+
"libraries": [],
72+
"libpath": [],
73+
"dependencies": [
74+
"@stdlib/math/base/assert/is-nan",
75+
"@stdlib/math/base/special/cosh"
76+
]
77+
}
78+
]
79+
}

lib/node_modules/@stdlib/stats/base/dists/planck/skewness/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "stdlib/math/base/special/cosh.h"
2222

2323
/**
24-
* Computes the skewness of a Planck distribution with shape parameter `lambda`.
24+
*Returns the skewness for an planck distribution with shape parameter 'lambda'.
2525
*
2626
* @param lambda shape parameter
2727
* @return skewness

0 commit comments

Comments
 (0)