Skip to content
Merged
Changes from all commits
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
126 changes: 122 additions & 4 deletions lib/node_modules/@stdlib/random/tools/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import binary = require( '@stdlib/random/tools/binary' );
import binaryFactory = require( '@stdlib/random/tools/binary-factory' );
import ternary = require( '@stdlib/random/tools/ternary' );
import ternaryFactory = require( '@stdlib/random/tools/ternary-factory' );
import unary = require( '@stdlib/random/tools/unary' );
import unaryFactory = require( '@stdlib/random/tools/unary-factory' );

Expand Down Expand Up @@ -53,7 +55,7 @@ interface Namespace {
* 'order': 'row-major'
* };
*
* var rand = new Random( uniform, [ idt, idt ], odt, policies, options );
* var rand = new ns.binary( uniform, [ idt, idt ], odt, policies, options );
*
* var v = rand.generate( [ 2, 2 ], 0.0, 1.0 );
* // returns <ndarray>
Expand All @@ -73,7 +75,7 @@ interface Namespace {
* 'order': 'row-major'
* };
*
* var rand = new Random( uniform, [ idt, idt ], odt, policies, options );
* var rand = new ns.binary( uniform, [ idt, idt ], odt, policies, options );
*
* var out = ndzeros( [ 2, 2 ] );
* var v = rand.assign( 0.0, 1.0, out );
Expand Down Expand Up @@ -145,6 +147,122 @@ interface Namespace {
*/
binaryFactory: typeof binaryFactory;

/**
* Constructor for creating ndarrays filled with pseudorandom values drawn from a ternary PRNG.
*
* @param prng - ternary pseudorandom value generator
* @param idtypes - list containing a list of supported input data types for each PRNG parameter
* @param odtypes - list of supported output data types
* @param policies - dispatch policies
* @param options - function options
* @returns instance
*
* @example
* var dtypes = require( '@stdlib/ndarray/dtypes' );
* var frechet = require( '@stdlib/random/base/frechet' );
*
* var idt = dtypes( 'real_and_generic' );
* var odt = dtypes( 'real_floating_point_and_generic' );
*
* var policies = {
* 'output': 'real_floating_point_and_generic'
* };
* var options = {
* 'order': 'row-major'
* };
*
* var rand = new ns.ternary( frechet, [ idt, idt, idt ], odt, policies, options );
*
* var v = rand.generate( [ 2, 2 ], 2.0, 3.0, 0.0 );
* // returns <ndarray>
*
* @example
* var dtypes = require( '@stdlib/ndarray/dtypes' );
* var ndzeros = require( '@stdlib/ndarray/zeros' );
* var frechet = require( '@stdlib/random/base/frechet' );
*
* var idt = dtypes( 'real_and_generic' );
* var odt = dtypes( 'real_floating_point_and_generic' );
*
* var policies = {
* 'output': 'real_floating_point_and_generic'
* };
* var options = {
* 'order': 'row-major'
* };
*
* var rand = new ns.ternary( frechet, [ idt, idt, idt ], odt, policies, options );
*
* var out = ndzeros( [ 2, 2 ] );
* var v = rand.assign( 2.0, 3.0, 0.0, out );
* // returns <ndarray>
*
* var bool = ( v === out );
* // returns true
*/
ternary: typeof ternary;

/**
* Returns a function for generating pseudorandom values drawn from a ternary PRNG.
*
* @param prng - ternary pseudorandom value generator
* @param idtypes - list containing a list of supported input data types for each PRNG parameter
* @param odtypes - list of supported output data types
* @param policies - dispatch policies
* @param options - function options
* @returns instance
*
* @example
* var dtypes = require( '@stdlib/ndarray/dtypes' );
* var frechet = require( '@stdlib/random/base/frechet' );
*
* var idt = dtypes( 'real_and_generic' );
* var odt = dtypes( 'real_floating_point_and_generic' );
*
* var policies = {
* 'output': 'real_floating_point_and_generic'
* };
* var options = {
* 'order': 'row-major'
* };
*
* var factory = ns.ternaryFactory( frechet, [ idt, idt, idt ], odt, policies, options );
*
* var rand = factory();
* // returns <Function>
*
* var v = rand( [ 2, 2 ], 2.0, 3.0, 0.0 );
* // returns <ndarray>
*
* @example
* var dtypes = require( '@stdlib/ndarray/dtypes' );
* var ndzeros = require( '@stdlib/ndarray/zeros' );
* var frechet = require( '@stdlib/random/base/frechet' );
*
* var idt = dtypes( 'real_and_generic' );
* var odt = dtypes( 'real_floating_point_and_generic' );
*
* var policies = {
* 'output': 'real_floating_point_and_generic'
* };
* var options = {
* 'order': 'row-major'
* };
*
* var factory = ns.ternaryFactory( frechet, [ idt, idt, idt ], odt, policies, options );
*
* var rand = factory();
* // returns <Function>
*
* var out = ndzeros( [ 2, 2 ] );
* var v = rand.assign( 2.0, 3.0, 0.0, out );
* // returns <ndarray>
*
* var bool = ( v === out );
* // returns true
*/
ternaryFactory: typeof ternaryFactory;

/**
* Constructor for creating ndarrays filled with pseudorandom values drawn from a unary PRNG.
*
Expand All @@ -169,7 +287,7 @@ interface Namespace {
* 'order': 'row-major'
* };
*
* var rand = new Random( exponential, idt, odt, policies, options );
* var rand = new ns.unary( exponential, idt, odt, policies, options );
*
* var v = rand.generate( [ 2, 2 ], 2.0 );
* // returns <ndarray>
Expand All @@ -189,7 +307,7 @@ interface Namespace {
* 'order': 'row-major'
* };
*
* var rand = new Random( exponential, idt, odt, policies, options );
* var rand = new ns.unary( exponential, idt, odt, policies, options );
*
* var out = ndzeros( [ 2, 2 ] );
* var v = rand.assign( 2.0, out );
Expand Down