Skip to content

Commit fb10a47

Browse files
committed
Replace manual ndarray construction with direct generation of random ndarrays
1 parent 1d0326c commit fb10a47

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

lib/node_modules/@stdlib/stats/meanors/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,13 @@ The function accepts the following options:
231231
<!-- eslint no-undef: "error" -->
232232

233233
```javascript
234-
var uniform = require( '@stdlib/random/array/uniform' );
234+
var uniform = require( '@stdlib/random/uniform' );
235235
var getDType = require( '@stdlib/ndarray/dtype' );
236236
var ndarray2array = require( '@stdlib/ndarray/to-array' );
237-
var ndarray = require( '@stdlib/ndarray/ctor' );
238237
var meanors = require( '@stdlib/stats/meanors' );
239238

240239
// Generate an array of random numbers:
241-
var xbuf = uniform( 25, 0.0, 20.0 );
242-
243-
// Wrap in an ndarray:
244-
var x = new ndarray( 'float64', xbuf, [ 5, 5 ], [ 5, 1 ], 0, 'row-major' );
240+
var x = uniform( [ 5, 5 ], 0.0, 20.0 );
245241
console.log( ndarray2array( x ) );
246242

247243
// Perform a reduction:

lib/node_modules/@stdlib/stats/meanors/examples/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@
1818

1919
'use strict';
2020

21-
var uniform = require( '@stdlib/random/array/uniform' );
21+
var uniform = require( '@stdlib/random/uniform' );
2222
var getDType = require( '@stdlib/ndarray/dtype' );
2323
var ndarray2array = require( '@stdlib/ndarray/to-array' );
24-
var ndarray = require( '@stdlib/ndarray/ctor' );
2524
var meanors = require( './../lib' );
2625

2726
// Generate an array of random numbers:
28-
var xbuf = uniform( 25, 0.0, 20.0 );
29-
30-
// Wrap in an ndarray:
31-
var x = new ndarray( 'float64', xbuf, [ 5, 5 ], [ 5, 1 ], 0, 'row-major' );
27+
var x = uniform( [ 5, 5 ], 0.0, 20.0 );
3228
console.log( ndarray2array( x ) );
3329

3430
// Perform a reduction:

0 commit comments

Comments
 (0)