Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 80 additions & 1 deletion lib/node_modules/@stdlib/random/array/tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,93 @@ The namespace contains the following:
<!-- TODO: better examples -->

<!-- eslint no-undef: "error" -->

#### Listing Functions in the Namespace
```javascript
var objectKeys = require( '@stdlib/utils/keys' );
var ns = require( '@stdlib/random/array/tools' );

console.log( objectKeys( ns ) );
```

#### Creating an Array Using `binaryFactory`
```javascript
var ns = require('@stdlib/random/array/tools');

// Create a binary PRNG factory function
var binaryFactory = ns.binaryFactory(Math.random, ['float64'], 'float64');

// Use the factory function to create an array filled with pseudorandom binary values
var binaryArray = binaryFactory();

console.log('Binary Array:', binaryArray);
```

#### Creating an Array Using `binary`
```javascript
var ns = require('@stdlib/random/array/tools');

// Create an array filled with pseudorandom binary values
var binaryArray = ns.binary(Math.random, ['float64'], 'float64');

console.log('Binary Array:', binaryArray);
```

#### Creating an Array using `nullary`
```javascript
var ns = require('@stdlib/random/array/tools');

// Create an array filled with pseudorandom values drawn from a nullary PRNG
var nullaryArray = ns.nullary(Math.random, ['float64'], 'float64');

console.log('Nullary Array:', nullaryArray);
```

#### Creating an Array Using `ternaryFactory`
```javascript
var ns = require('@stdlib/random/array/tools');

// Create a ternary PRNG factory function
var ternaryFactory = ns.ternaryFactory(Math.random, ['float64'], 'float64');

// Use the factory function to create an array filled with pseudorandom ternary values
var ternaryArray = ternaryFactory();

console.log('Ternary Array:', ternaryArray);
```

#### Creating an Array Using `ternary`
```javascript
var ns = require('@stdlib/random/array/tools');

// Create an array filled with pseudorandom values drawn from a ternary PRNG
var ternaryArray = ns.ternary(Math.random, ['float64'], 'float64');

console.log('Ternary Array:', ternaryArray);
```

#### Creating an Array Using `unaryFactory`
```javascript
var ns = require('@stdlib/random/array/tools');

// Create a unary PRNG factory function
var unaryFactory = ns.unaryFactory(Math.random, ['float64'], 'float64');

// Use the factory function to create an array filled with pseudorandom unary values
var unaryArray = unaryFactory();

console.log('Unary Array:', unaryArray);
```

#### Creating an Array Using `unary`
```javascript
var ns = require('@stdlib/random/array/tools');

// Create an array filled with pseudorandom values drawn from a unary PRNG
var unaryArray = ns.unary(Math.random, ['float64'], 'float64');

console.log('Unary Array:', unaryArray);
```

</section>

<!-- /.examples -->
Expand Down