Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.
stream options
Stream instance
var inspectStream = require( `@stdlib/streams/node/inspect-sink` );
function log( chunk ) {
console.log( chunk.toString() );
}
var opts = {
'iter': 10
};
var stream = randomStream( opts );
stream.pipe( inspectStream( log ) );
Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.
stream options
Stream instance
var inspectStream = require( `@stdlib/streams/node/inspect-sink` );
function log( chunk ) {
console.log( chunk.toString() );
}
var opts = {
'iter': 10
};
var RandomStream = randomStream;
var stream = new RandomStream( opts );
stream.pipe( inspectStream( log ) );
Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.
stream options
stream factory
var opts = {
'sep': ',',
'objectMode': false,
'encoding': 'utf8',
'highWaterMark': 64
};
var createStream = randomStream.factory( opts );
// Create 10 identically configured streams...
var streams = [];
var i;
for ( i = 0; i < 10; i++ ) {
streams.push( createStream() );
}
Returns an "objectMode" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.
stream options
Stream instance
var inspectStream = require( `@stdlib/streams/node/inspect-sink` );
function log( v ) {
console.log( v );
}
var opts = {
'iter': 10
};
var stream = randomStream.objectMode( opts );
stream.pipe( inspectStream.objectMode( log ) );
Interface defining a stream constructor which is both "newable" and "callable".