Skip to content

Commit

Permalink
refactor random number generation
Browse files Browse the repository at this point in the history
---
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
---
  • Loading branch information
yuvi-mittal committed Feb 2, 2025
1 parent 16f0017 commit 9b12766
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

var bench = require( '@stdlib/bench' );
var Float64Array = require( '@stdlib/array/float64' );
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/base/uniform' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pkg = require( './../package.json' ).name;
var entropy = require( './../lib' );
Expand All @@ -39,8 +39,7 @@ bench( pkg, function benchmark( b ) {
len = 100;
lambda = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
lambda[ i ] = ( randu() * 10.0 ) + 1.0;

lambda[ i ] = uniform( 1.0, 10.0 );
}

b.tic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var Float64Array = require( '@stdlib/array/float64' );
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/base/uniform' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pkg = require( './../package.json' ).name;
var tryRequire = require( '@stdlib/utils/try-require' );
var pkg = require( './../package.json' ).name;


// VARIABLES //
Expand All @@ -39,7 +39,7 @@ var opts = {

// MAIN //

bench( pkg+'::native', function benchmark( b ) {
bench( pkg+'::native', opts, function benchmark( b ) {
var lambda;
var len;
var y;
Expand All @@ -48,8 +48,7 @@ bench( pkg+'::native', function benchmark( b ) {
len = 100;
lambda = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
lambda[ i ] = ( randu() * 10.0 ) + 1.0;

lambda[ i ] = uniform( 1.0, 10.0 );
}

b.tic();
Expand Down
168 changes: 83 additions & 85 deletions lib/node_modules/@stdlib/stats/base/dists/planck/entropy/manifest.json
Original file line number Diff line number Diff line change
@@ -1,88 +1,86 @@
{
"options": {
"options": {
"task": "build",
"wasm": false
},
"fields": [
{
"field": "src",
"resolve": true,
"relative": true
},
{
"field": "include",
"resolve": true,
"relative": true
},
{
"field": "libraries",
"resolve": false,
"relative": false
},
{
"field": "libpath",
"resolve": true,
"relative": false
}
],
"confs": [
{
"task": "build",
"wasm": false
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/napi/unary",
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/exp",
"@stdlib/math/base/special/expm1",
"@stdlib/math/base/special/ln",
"@stdlib/constants/float64/pi"
]
},
{
"task": "benchmark",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/exp",
"@stdlib/math/base/special/expm1",
"@stdlib/math/base/special/ln"
]
},
"fields": [
{
"field": "src",
"resolve": true,
"relative": true
},
{
"field": "include",
"resolve": true,
"relative": true
},
{
"field": "libraries",
"resolve": false,
"relative": false
},
{
"field": "libpath",
"resolve": true,
"relative": false
}
],
"confs": [
{
"task": "build",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/napi/unary",
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/exp",
"@stdlib/math/base/special/expm1",
"@stdlib/math/base/special/ln",
"@stdlib/constants/float64/pi"

]
},
{
"task": "benchmark",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/exp",
"@stdlib/math/base/special/expm1",
"@stdlib/math/base/special/ln"

]
},
{
"task": "examples",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/exp",
"@stdlib/math/base/special/expm1",
"@stdlib/math/base/special/ln"
]
}
]
}
{
"task": "examples",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/exp",
"@stdlib/math/base/special/expm1",
"@stdlib/math/base/special/ln"
]
}
]
}

0 comments on commit 9b12766

Please sign in to comment.