Skip to content

Commit b928b26

Browse files
committed
docs: add REPL help
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 58747ab commit b928b26

File tree

1 file changed

+124
-0
lines changed
  • lib/node_modules/@stdlib/random/tools/unary/docs

1 file changed

+124
-0
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
2+
{{alias}}( prng, idtypes, odtypes, policies[, options] )
3+
Returns an interface for creating ndarrays filled with pseudorandom numbers
4+
drawn from a single-parameter probability distribution.
5+
6+
Parameters
7+
----------
8+
prng: Function
9+
Unary pseudorandom number generator.
10+
11+
idtypes: Array<string>
12+
List of supported input data types.
13+
14+
odtypes: Array<string>
15+
List of supported output data types.
16+
17+
policies: Object
18+
Interface policies. Must have the following properties:
19+
20+
- output: output data type policy.
21+
22+
options: Object (optional)
23+
Function options.
24+
25+
options.order: string (optional)
26+
Default memory layout order.
27+
28+
Returns
29+
-------
30+
out: Object
31+
Instance having methods for generating pseudorandom numbers.
32+
33+
Examples
34+
--------
35+
> var dts = [ 'float64', 'float32', 'generic' ];
36+
> var p = { 'output': 'real_floating_point_and_generic' };
37+
> var r = {{alias:@stdlib/random/base/exponential}};
38+
> var out = new {{alias}}( r, dts, dts, p );
39+
40+
41+
{{alias}}.prototype.generate( shape, param1[, options] )
42+
Returns an ndarray filled with pseudorandom numbers drawn from a probability
43+
distribution.
44+
45+
Parameters
46+
----------
47+
shape: Array<integer>
48+
Output shape.
49+
50+
param1: number|ComplexLike|ndarray
51+
Distribution parameter. If an ndarray, must be broadcast compatible with
52+
the specified output shape.
53+
54+
options: Object (optional)
55+
Function options.
56+
57+
options.dtype: string (optional)
58+
Output data type. Setting this option overrides the output data type
59+
policy.
60+
61+
options.order: string (optional)
62+
Output memory layout. Setting this option overrides the default memory
63+
layout order.
64+
65+
options.mode: string (optional)
66+
Specifies how to handle indices which exceed ndarray dimensions.
67+
68+
options.submode: string (optional)
69+
Specifies how to handle subscripts which exceed ndarray dimensions on a
70+
per dimension basis.
71+
72+
options.readonly: string (optional)
73+
Boolean indicating whether an ndarray should be read-only.
74+
75+
Returns
76+
-------
77+
out: ndarray
78+
Output ndarray.
79+
80+
Examples
81+
--------
82+
> var dts = [ 'float64', 'float32', 'generic' ];
83+
> var p = { 'output': 'real_floating_point_and_generic' };
84+
> var r = {{alias:@stdlib/random/base/exponential}};
85+
> var f = new {{alias}}( r, dts, dts, p );
86+
> var y = f.generate( [ 2, 2 ], 2.0 );
87+
> {{alias:@stdlib/ndarray/to-array}}( y )
88+
[...]
89+
90+
91+
{{alias}}.prototype.assign( param1, out[, options] )
92+
Fills an ndarray with pseudorandom numbers drawn from a probability
93+
distribution.
94+
95+
Parameters
96+
----------
97+
param1: number|ComplexLike|ndarray
98+
Distribution parameter. If an ndarray, must be broadcast compatible with
99+
the output ndarray.
100+
101+
out: ndarray
102+
Output ndarray.
103+
104+
Returns
105+
-------
106+
out: ndarray
107+
Output array.
108+
109+
Examples
110+
--------
111+
> var dts = [ 'float64', 'float32', 'generic' ];
112+
> var p = { 'output': 'real_floating_point_and_generic' };
113+
> var r = {{alias:@stdlib/random/base/exponential}};
114+
> var f = new {{alias}}( r, dts, dts, p );
115+
> var out = {{alias:@stdlib/ndarray/zeros}}( [ 2, 2 ] );
116+
> var y = f.assign( 2.0, out );
117+
> {{alias:@stdlib/ndarray/to-array}}( y )
118+
[...]
119+
> var bool = ( out === y )
120+
true
121+
122+
See Also
123+
--------
124+

0 commit comments

Comments
 (0)