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 2e8381c commit 221f22e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 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 @@ gswap.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 gswap = require( '@stdlib/blas-base-gswap' );

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

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

// Swap elements in `x` and `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 gswap = require( './../lib' );

// VARIABLES //

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


// 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, 'generic', rand );
var y = filledarrayBy( len, 'generic', 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 gswap = require( './../lib' ).ndarray;

// VARIABLES //

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


// 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, 'generic', rand );
var y = filledarrayBy( len, 'generic', rand );
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 gswap = require( './../lib' );

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

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

// Swap elements in `x` and `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 @@ -43,14 +43,13 @@
},
"devDependencies": {
"@stdlib/array-complex128": "^0.1.0",
"@stdlib/array-filled-by": "^0.1.0",
"@stdlib/array-float64": "^0.1.1",
"@stdlib/bench": "^0.2.1",
"@stdlib/blas-base-gcopy": "^0.1.0",
"@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-reinterpret-complex128": "^0.1.1",
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
"istanbul": "^0.4.1",
Expand Down

0 comments on commit 221f22e

Please sign in to comment.