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/stats/base/min/README.md
+18-32
Original file line number
Diff line number
Diff line change
@@ -36,33 +36,29 @@ limitations under the License.
36
36
var min =require( '@stdlib/stats/base/min' );
37
37
```
38
38
39
-
#### min( N, x, stride )
39
+
#### min( N, x, strideX )
40
40
41
41
Computes the minimum value of a strided array `x`.
42
42
43
43
```javascript
44
44
var x = [ 1.0, -2.0, 2.0 ];
45
-
varN=x.length;
46
45
47
-
var v =min( N, x, 1 );
46
+
var v =min( x.length, x, 1 );
48
47
// returns -2.0
49
48
```
50
49
51
50
The function has the following parameters:
52
51
53
52
-**N**: number of indexed elements.
54
53
-**x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
55
-
-**stride**: index increment for `x`.
54
+
-**strideX**: stride length for `x`.
56
55
57
-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum value of every other element in `x`,
56
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the minimum value of every other element in `x`,
58
57
59
58
```javascript
60
-
var floor =require( '@stdlib/math/base/special/floor' );
61
-
62
59
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ];
63
-
varN=floor( x.length/2 );
64
60
65
-
var v =min( N, x, 2 );
61
+
var v =min( 4, x, 2 );
66
62
// returns -2.0
67
63
```
68
64
@@ -72,42 +68,35 @@ Note that indexing is relative to the first index. To introduce an offset, use [
var x1 =newFloat64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
79
74
80
-
varN=floor( x0.length/2 );
81
-
82
-
var v =min( N, x1, 2 );
75
+
var v =min( 4, x1, 2 );
83
76
// returns -2.0
84
77
```
85
78
86
-
#### min.ndarray( N, x, stride, offset )
79
+
#### min.ndarray( N, x, strideX, offsetX )
87
80
88
81
Computes the minimum value of a strided array using alternative indexing semantics.
89
82
90
83
```javascript
91
84
var x = [ 1.0, -2.0, 2.0 ];
92
-
varN=x.length;
93
85
94
-
var v =min.ndarray( N, x, 1, 0 );
86
+
var v =min.ndarray( x.length, x, 1, 0 );
95
87
// returns -2.0
96
88
```
97
89
98
90
The function has the following additional parameters:
99
91
100
-
-**offset**: starting index for `x`.
92
+
-**offsetX**: starting index for `x`.
101
93
102
-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other value in `x`starting from the second value
94
+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the minimum value for every other element in the strided array starting from the second element
103
95
104
96
```javascript
105
-
var floor =require( '@stdlib/math/base/special/floor' );
106
-
107
97
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
108
-
varN=floor( x.length/2 );
109
98
110
-
var v =min.ndarray( N, x, 2, 1 );
99
+
var v =min.ndarray( 4, x, 2, 1 );
111
100
// returns -2.0
112
101
```
113
102
@@ -120,6 +109,7 @@ var v = min.ndarray( N, x, 2, 1 );
120
109
## Notes
121
110
122
111
- If `N <= 0`, both functions return `NaN`.
112
+
- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]).
123
113
- Depending on the environment, the typed versions ([`dmin`][@stdlib/stats/base/dmin], [`smin`][@stdlib/stats/base/smin], etc.) are likely to be significantly more performant.
124
114
125
115
</section>
@@ -133,18 +123,12 @@ var v = min.ndarray( N, x, 2, 1 );
133
123
<!-- eslint no-undef: "error" -->
134
124
135
125
```javascript
136
-
var randu =require( '@stdlib/random/base/randu' );
137
-
var round =require( '@stdlib/math/base/special/round' );
0 commit comments