You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/random/exponential/README.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,12 +48,13 @@ The function has the following parameters:
48
48
When provided a scalar distribution parameter, every element in the output [ndarray][@stdlib/ndarray/ctor] is drawn from the same distribution. To generate pseudorandom numbers drawn from different distributions, provide a distribution parameter argument as an [ndarray][@stdlib/ndarray/ctor]. The following example demonstrates broadcasting an [ndarray][@stdlib/ndarray/ctor] containing distribution parameters to generate sub-matrices drawn from different distributions.
If provided an empty shape, the function returns a zero-dimensional [ndarray][@stdlib/ndarray/ctor].
64
65
65
66
```javascript
67
+
var getShape =require( '@stdlib/ndarray/shape' );
68
+
66
69
var arr =exponential( [], 2.0 );
67
70
// returns <ndarray>
68
71
69
-
var shape =arr.shape;
72
+
var shape =getShape( arr );
70
73
// returns []
71
74
72
75
var v =arr.get();
@@ -84,14 +87,16 @@ The function accepts the following options:
84
87
By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [data type][@stdlib/ndarray/dtypes] determined by the function's output data type [policy][@stdlib/ndarray/output-dtype-policies]. To override the default behavior, set the `dtype` option.
85
88
86
89
```javascript
90
+
var getDType =require( '@stdlib/ndarray/dtype' );
91
+
87
92
var opts = {
88
93
'dtype':'generic'
89
94
};
90
95
91
96
var arr =exponential( [ 3, 3 ], 2.0, opts );
92
97
// returns <ndarray>
93
98
94
-
var dt =arr.dtype;
99
+
var dt =getDType( arr );
95
100
// returns 'generic'
96
101
```
97
102
@@ -122,12 +127,14 @@ The method has the following parameters:
122
127
Returns a function for generating pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution.
0 commit comments