time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (9186B)


      1 
      2 {{alias}}( a, b, c[, options] )
      3     Returns a readable stream for generating pseudorandom numbers drawn from a
      4     triangular distribution.
      5 
      6     In addition to standard readable stream events, the returned stream emits a
      7     'state' event after internally generating `siter` pseudorandom numbers,
      8     which is useful when wanting to deterministically capture a stream's
      9     underlying PRNG state.
     10 
     11     Parameters
     12     ----------
     13     a: number
     14         Minimum support.
     15 
     16     b: number
     17         Maximum support.
     18 
     19     c: number
     20         Mode.
     21 
     22     options: Object (optional)
     23         Options.
     24 
     25     options.objectMode: boolean (optional)
     26         Specifies whether a stream should operate in "objectMode". Default:
     27         false.
     28 
     29     options.encoding: string|null (optional)
     30         Specifies how Buffer objects should be decoded to strings. Default:
     31         null.
     32 
     33     options.highWaterMark: integer (optional)
     34         Specifies the maximum number of bytes to store in an internal buffer
     35         before ceasing to generate additional pseudorandom numbers.
     36 
     37     options.sep: string (optional)
     38         Separator used to join streamed data. This option is only applicable
     39         when a stream is not in "objectMode". Default: '\n'.
     40 
     41     options.iter: integer (optional)
     42         Number of iterations.
     43 
     44     options.prng: Function (optional)
     45         Pseudorandom number generator (PRNG) for generating uniformly
     46         distributed pseudorandom numbers on the interval `[0,1)`. If provided,
     47         the `state` and `seed` options are ignored. In order to seed the
     48         returned iterator, one must seed the provided `prng` (assuming the
     49         provided `prng` is seedable).
     50 
     51     options.seed: integer|ArrayLikeObject<integer> (optional)
     52         Pseudorandom number generator seed. The seed may be either a positive
     53         unsigned 32-bit integer or, for arbitrary length seeds, an array-like
     54         object containing unsigned 32-bit integers.
     55 
     56     options.state: Uint32Array (optional)
     57         Pseudorandom number generator state. If provided, the `seed` option is
     58         ignored.
     59 
     60     options.copy: boolean (optional)
     61         Boolean indicating whether to copy a provided pseudorandom number
     62         generator state. Setting this option to `false` allows sharing state
     63         between two or more pseudorandom number generators. Setting this option
     64         to `true` ensures that a returned iterator has exclusive control over
     65         its internal state. Default: true.
     66 
     67     options.siter: integer (optional)
     68         Number of iterations after which to emit the PRNG state. Default: 1e308.
     69 
     70     Returns
     71     -------
     72     stream: ReadableStream
     73         Readable stream.
     74 
     75     stream.PRNG: Function
     76         Underlying pseudorandom number generator.
     77 
     78     stream.seed: Uint32Array|null
     79         Pseudorandom number generator seed.
     80 
     81     stream.seedLength: integer|null
     82         Length of generator seed.
     83 
     84     stream.state: Uint32Array|null
     85         Generator state.
     86 
     87     stream.stateLength: integer|null
     88         Length of generator state.
     89 
     90     stream.byteLength: integer|null
     91         Size (in bytes) of generator state.
     92 
     93     Examples
     94     --------
     95     > function fcn( chunk ) { console.log( chunk.toString() ); };
     96     > var opts = { 'iter': 10 };
     97     > var s = {{alias}}( 2.0, 5.0, 4.0, opts );
     98     > var o = {{alias:@stdlib/streams/node/inspect-sink}}( fcn );
     99     > s.pipe( o );
    100 
    101 
    102 {{alias}}.factory( [a, b, c, ][options] )
    103     Returns a function for creating readable streams which generate pseudorandom
    104     numbers drawn from a triangular distribution.
    105 
    106     If provided distribution parameters, the returned function returns readable
    107     streams which generate pseudorandom numbers drawn from the specified
    108     distribution.
    109 
    110     If not provided distribution parameters, the returned function requires that
    111     distribution parameters be provided at each invocation.
    112 
    113     Parameters
    114     ----------
    115     a: number (optional)
    116         Minimum support.
    117 
    118     b: number (optional)
    119         Maximum support.
    120 
    121     c: number (optional)
    122         Mode.
    123 
    124     options: Object (optional)
    125         Options.
    126 
    127     options.objectMode: boolean (optional)
    128         Specifies whether a stream should operate in "objectMode". Default:
    129         false.
    130 
    131     options.encoding: string|null (optional)
    132         Specifies how Buffer objects should be decoded to strings. Default:
    133         null.
    134 
    135     options.highWaterMark: integer (optional)
    136         Specifies the maximum number of bytes to store in an internal buffer
    137         before ceasing to generate additional pseudorandom numbers.
    138 
    139     options.sep: string (optional)
    140         Separator used to join streamed data. This option is only applicable
    141         when a stream is not in "objectMode". Default: '\n'.
    142 
    143     options.iter: integer (optional)
    144         Number of iterations.
    145 
    146     options.prng: Function (optional)
    147         Pseudorandom number generator (PRNG) for generating uniformly
    148         distributed pseudorandom numbers on the interval `[0,1)`. If provided,
    149         the `state` and `seed` options are ignored. In order to seed the
    150         returned iterator, one must seed the provided `prng` (assuming the
    151         provided `prng` is seedable).
    152 
    153     options.seed: integer|ArrayLikeObject<integer> (optional)
    154         Pseudorandom number generator seed. The seed may be either a positive
    155         unsigned 32-bit integer or, for arbitrary length seeds, an array-like
    156         object containing unsigned 32-bit integers.
    157 
    158     options.state: Uint32Array (optional)
    159         Pseudorandom number generator state. If provided, the `seed` option is
    160         ignored.
    161 
    162     options.copy: boolean (optional)
    163         Boolean indicating whether to copy a provided pseudorandom number
    164         generator state. Setting this option to `false` allows sharing state
    165         between two or more pseudorandom number generators. Setting this option
    166         to `true` ensures that a returned iterator has exclusive control over
    167         its internal state. Default: true.
    168 
    169     options.siter: integer (optional)
    170         Number of iterations after which to emit the PRNG state. Default: 1e308.
    171 
    172     Returns
    173     -------
    174     fcn: Function
    175         Function for creating readable streams.
    176 
    177     Examples
    178     --------
    179     > var opts = { 'objectMode': true, 'highWaterMark': 64 };
    180     > var createStream = {{alias}}.factory( opts );
    181 
    182 
    183 {{alias}}.objectMode( a, b, c[, options] )
    184     Returns an "objectMode" readable stream for generating pseudorandom numbers
    185     drawn from a triangular distribution.
    186 
    187     Parameters
    188     ----------
    189     a: number
    190         Minimum support.
    191 
    192     b: number
    193         Maximum support.
    194 
    195     c: number
    196         Mode.
    197 
    198     options: Object (optional)
    199         Options.
    200 
    201     options.encoding: string|null (optional)
    202         Specifies how Buffer objects should be decoded to strings. Default:
    203         null.
    204 
    205     options.highWaterMark: integer (optional)
    206         Specifies the maximum number of objects to store in an internal buffer
    207         before ceasing to generate additional pseudorandom numbers.
    208 
    209     options.iter: integer (optional)
    210         Number of iterations.
    211 
    212     options.prng: Function (optional)
    213         Pseudorandom number generator (PRNG) for generating uniformly
    214         distributed pseudorandom numbers on the interval `[0,1)`. If provided,
    215         the `state` and `seed` options are ignored. In order to seed the
    216         returned iterator, one must seed the provided `prng` (assuming the
    217         provided `prng` is seedable).
    218 
    219     options.seed: integer|ArrayLikeObject<integer> (optional)
    220         Pseudorandom number generator seed. The seed may be either a positive
    221         unsigned 32-bit integer or, for arbitrary length seeds, an array-like
    222         object containing unsigned 32-bit integers.
    223 
    224     options.state: Uint32Array (optional)
    225         Pseudorandom number generator state. If provided, the `seed` option is
    226         ignored.
    227 
    228     options.copy: boolean (optional)
    229         Boolean indicating whether to copy a provided pseudorandom number
    230         generator state. Setting this option to `false` allows sharing state
    231         between two or more pseudorandom number generators. Setting this option
    232         to `true` ensures that a returned iterator has exclusive control over
    233         its internal state. Default: true.
    234 
    235     options.siter: integer (optional)
    236         Number of iterations after which to emit the PRNG state. Default: 1e308.
    237 
    238     Returns
    239     -------
    240     stream: ReadableStream
    241         Readable stream operating in "objectMode".
    242 
    243     stream.PRNG: Function
    244         Underlying pseudorandom number generator.
    245 
    246     stream.seed: Uint32Array|null
    247         Pseudorandom number generator seed.
    248 
    249     stream.seedLength: integer|null
    250         Length of generator seed.
    251 
    252     stream.state: Uint32Array|null
    253         Generator state.
    254 
    255     stream.stateLength: integer|null
    256         Length of generator state.
    257 
    258     stream.byteLength: integer|null
    259         Size (in bytes) of generator state.
    260 
    261     Examples
    262     --------
    263     > function fcn( v ) { console.log( v ); };
    264     > var opts = { 'iter': 10 };
    265     > var s = {{alias}}.objectMode( 2.0, 5.0, 4.0, opts );
    266     > var o = {{alias:@stdlib/streams/node/inspect-sink}}.objectMode( fcn );
    267     > s.pipe( o );
    268 
    269     See Also
    270     --------
    271