|
| 1 | + |
| 2 | +{{alias}}( prng, idtypes, odtypes, policies[, options] ) |
| 3 | + Returns a function for generating pseudorandom numbers drawn from single- |
| 4 | + parameter probability distribution. |
| 5 | + |
| 6 | + Parameters |
| 7 | + ---------- |
| 8 | + prng: Function |
| 9 | + Unary pseudorandom number generator. Must have the following methods: |
| 10 | + |
| 11 | + - factory: returns a new unary pseudorandom number generator. |
| 12 | + |
| 13 | + idtypes: Array<string> |
| 14 | + List of supported input data types. |
| 15 | + |
| 16 | + odtypes: Array<string> |
| 17 | + List of supported output data types. |
| 18 | + |
| 19 | + policies: Object |
| 20 | + Interface policies. Must have the following properties: |
| 21 | + |
| 22 | + - output: output data type policy. |
| 23 | + |
| 24 | + options: Object (optional) |
| 25 | + Function options. |
| 26 | + |
| 27 | + options.order: string (optional) |
| 28 | + Default memory layout order. |
| 29 | + |
| 30 | + Returns |
| 31 | + ------- |
| 32 | + fcn: Function |
| 33 | + Factory function for generating pseudorandom numbers drawn from single- |
| 34 | + parameter probability distribution. The function accepts a single |
| 35 | + optional argument: |
| 36 | + |
| 37 | + - options: function options. |
| 38 | + |
| 39 | + The function supports the following options: |
| 40 | + |
| 41 | + - prng: pseudorandom number generator which generates uniformly |
| 42 | + distributed pseudorandom numbers. |
| 43 | + - seed: pseudorandom value generator seed. |
| 44 | + - state: pseudorandom value generator state. |
| 45 | + - copy: boolean indicating whether to copy a provided pseudorandom value |
| 46 | + generator state. |
| 47 | + |
| 48 | + Examples |
| 49 | + -------- |
| 50 | + > var dts = [ 'float64', 'float32', 'generic' ]; |
| 51 | + > var p = { 'output': 'real_floating_point_and_generic' }; |
| 52 | + > var r = {{alias:@stdlib/random/base/exponential}}; |
| 53 | + > var f = {{alias}}( r, dts, dts, p ); |
| 54 | + > var fcn = f(); |
| 55 | + > fcn( [ 2, 2 ], 2.0 ) |
| 56 | + <ndarray> |
| 57 | + > fcn( [ 2, 2 ], 2.0, { 'dtype': 'float32' } ) |
| 58 | + <ndarray> |
| 59 | + |
| 60 | + See Also |
| 61 | + -------- |
| 62 | + |
0 commit comments