Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Dec 3, 2023
1 parent 3d44926 commit a5f759e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 31 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,16 @@ scopy.ndarray( 3, x, 2, 1, y, -1, y.length-1 );
<!-- eslint no-undef: "error" -->

```javascript
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
var filledarrayBy = require( '@stdlib/array-filled-by' );
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
var scopy = require( '@stdlib/blas-base-scopy' );

var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 500 ) );
var opts = {
'dtype': 'float32'
};
var x = discreteUniform( 10, 0, 500, opts );
console.log( x );

var y = filledarrayBy( x.length, 'float32', discreteUniform( 0, 255 ) );
var y = discreteUniform( x.length, 0, 255, opts );
console.log( y );

// Copy elements from `x` into `y` starting from the end of `y`:
Expand Down
11 changes: 6 additions & 5 deletions benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
// MODULES //

var bench = require( '@stdlib/bench' );
var uniform = require( '@stdlib/random-base-uniform' ).factory;
var filledarrayBy = require( '@stdlib/array-filled-by' );
var uniform = require( '@stdlib/random-array-uniform' );
var isnan = require( '@stdlib/math-base-assert-is-nan' );
var pow = require( '@stdlib/math-base-special-pow' );
var pkg = require( './../package.json' ).name;
Expand All @@ -31,7 +30,9 @@ var scopy = require( './../lib/scopy.js' );

// VARIABLES //

var rand = uniform( -10000.0, 10000.0 );
var options = {
'dtype': 'float32'
};


// FUNCTIONS //
Expand All @@ -44,8 +45,8 @@ var rand = uniform( -10000.0, 10000.0 );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x = filledarrayBy( len, 'float32', rand );
var y = filledarrayBy( len, 'float32', rand );
var x = uniform( len, -100.0, 100.0, options );
var y = uniform( len, -100.0, 100.0, options );
return benchmark;

/**
Expand Down
11 changes: 6 additions & 5 deletions benchmark/benchmark.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var uniform = require( '@stdlib/random-base-uniform' ).factory;
var filledarrayBy = require( '@stdlib/array-filled-by' );
var uniform = require( '@stdlib/random-array-uniform' );
var isnan = require( '@stdlib/math-base-assert-is-nan' );
var pow = require( '@stdlib/math-base-special-pow' );
var tryRequire = require( '@stdlib/utils-try-require' );
Expand All @@ -36,7 +35,9 @@ var scopy = tryRequire( resolve( __dirname, './../lib/scopy.native.js' ) );
var opts = {
'skip': ( scopy instanceof Error )
};
var rand = uniform( -10000.0, 10000.0 );
var options = {
'dtype': 'float32'
};


// FUNCTIONS //
Expand All @@ -49,8 +50,8 @@ var rand = uniform( -10000.0, 10000.0 );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x = filledarrayBy( len, 'float32', rand );
var y = filledarrayBy( len, 'float32', rand );
var x = uniform( len, -100.0, 100.0, options );
var y = uniform( len, -100.0, 100.0, options );
return benchmark;

/**
Expand Down
11 changes: 6 additions & 5 deletions benchmark/benchmark.ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
// MODULES //

var bench = require( '@stdlib/bench' );
var uniform = require( '@stdlib/random-base-uniform' ).factory;
var filledarrayBy = require( '@stdlib/array-filled-by' );
var uniform = require( '@stdlib/random-array-uniform' );
var isnan = require( '@stdlib/math-base-assert-is-nan' );
var pow = require( '@stdlib/math-base-special-pow' );
var pkg = require( './../package.json' ).name;
Expand All @@ -31,7 +30,9 @@ var scopy = require( './../lib/ndarray.js' );

// VARIABLES //

var rand = uniform( -10000.0, 10000.0 );
var options = {
'dtype': 'float32'
};


// FUNCTIONS //
Expand All @@ -44,8 +45,8 @@ var rand = uniform( -10000.0, 10000.0 );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x = filledarrayBy( len, 'float32', rand );
var y = filledarrayBy( len, 'float32', rand );
var x = uniform( len, -100.0, 100.0, options );
var y = uniform( len, -100.0, 100.0, options );
return benchmark;

/**
Expand Down
11 changes: 6 additions & 5 deletions benchmark/benchmark.ndarray.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var uniform = require( '@stdlib/random-base-uniform' ).factory;
var filledarrayBy = require( '@stdlib/array-filled-by' );
var uniform = require( '@stdlib/random-array-uniform' );
var isnan = require( '@stdlib/math-base-assert-is-nan' );
var pow = require( '@stdlib/math-base-special-pow' );
var tryRequire = require( '@stdlib/utils-try-require' );
Expand All @@ -36,7 +35,9 @@ var scopy = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) );
var opts = {
'skip': ( scopy instanceof Error )
};
var randu = uniform( -10000.0, 10000.0 );
var options = {
'dtype': 'float32'
};


// FUNCTIONS //
Expand All @@ -49,8 +50,8 @@ var randu = uniform( -10000.0, 10000.0 );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x = filledarrayBy( len, 'float32', randu );
var y = filledarrayBy( len, 'float32', randu );
var x = uniform( len, -100.0, 100.0, options );
var y = uniform( len, -100.0, 100.0, options );
return benchmark;

/**
Expand Down
10 changes: 6 additions & 4 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@

'use strict';

var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
var filledarrayBy = require( '@stdlib/array-filled-by' );
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
var scopy = require( './../lib' );

var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 500 ) );
var opts = {
'dtype': 'float32'
};
var x = discreteUniform( 10, 0, 500, opts );
console.log( x );

var y = filledarrayBy( x.length, 'float32', discreteUniform( 0, 255 ) );
var y = discreteUniform( x.length, 0, 255, opts );
console.log( y );

// Copy elements from `x` into `y` starting from the end of `y`:
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@
"@stdlib/utils-try-require": "^0.1.1"
},
"devDependencies": {
"@stdlib/array-filled-by": "^0.1.0",
"@stdlib/array-float32": "^0.1.1",
"@stdlib/assert-is-browser": "^0.1.1",
"@stdlib/bench": "^0.2.1",
"@stdlib/math-base-assert-is-nan": "^0.1.1",
"@stdlib/math-base-special-pow": "^0.1.0",
"@stdlib/random-base-discrete-uniform": "^0.1.0",
"@stdlib/random-base-uniform": "^0.1.0",
"@stdlib/random-array-discrete-uniform": "^0.1.0",
"@stdlib/random-array-uniform": "^0.1.0",
"@stdlib/strided-base-min-view-buffer-index": "^0.1.1",
"@stdlib/strided-base-offset-view": "^0.1.1",
"proxyquire": "^2.0.0",
Expand Down

0 comments on commit a5f759e

Please sign in to comment.