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/nanmskmin/README.md
+27-38Lines changed: 27 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
@license Apache-2.0
4
4
5
-
Copyright (c) 2020 The Stdlib Authors.
5
+
Copyright (c) 2025 The Stdlib Authors.
6
6
7
7
Licensed under the Apache License, Version 2.0 (the "License");
8
8
you may not use this file except in compliance with the License.
@@ -52,20 +52,18 @@ The function has the following parameters:
52
52
53
53
-**N**: number of indexed elements.
54
54
-**x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
55
-
-**strideX**: index increment for `x`.
55
+
-**strideX**: stride length for `x`.
56
56
-**mask**: mask [`Array`][mdn-array] or [`typed array`][mdn-typed-array]. If a `mask` array element is `0`, the corresponding element in `x` is considered valid and **included** in computation. If a `mask` array element is `1`, the corresponding element in `x` is considered invalid/missing and **excluded** from computation.
57
-
-**strideMask**: index increment for `mask`.
57
+
-**strideMask**: stride length for `mask`.
58
58
59
-
The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the minimum value of every other element in `x`,
59
+
The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the minimum value of every other element in `x`,
60
60
61
61
```javascript
62
-
var floor =require( '@stdlib/math/base/special/floor' );
63
-
64
62
var x = [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, -5.0, -6.0 ];
65
63
var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ];
66
-
varN=floor( x.length/2 );
67
64
68
-
var v =nanmskmin( N, x, 2, mask, 2 );
65
+
66
+
var v =nanmskmin( 4, x, 2, mask, 2 );
69
67
// returns -7.0
70
68
```
71
69
@@ -76,17 +74,16 @@ Note that indexing is relative to the first index. To introduce offsets, use [`t
var mask1 =newUint8Array( mask0.buffer, mask0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
86
84
87
-
varN=floor( x0.length/2 );
88
85
89
-
var v =nanmskmin( N, x1, 2, mask1, 2 );
86
+
var v =nanmskmin( 4, x1, 2, mask1, 2 );
90
87
// returns -2.0
91
88
```
92
89
@@ -107,16 +104,15 @@ The function has the following additional parameters:
107
104
-**offsetX**: starting index for `x`.
108
105
-**offsetMask**: starting index for `mask`.
109
106
110
-
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
107
+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset
108
+
indexing semantics based on
109
+
starting indices. For example, to calculate the minimum value for every other value in `x` starting from the second value
111
110
112
111
```javascript
113
-
var floor =require( '@stdlib/math/base/special/floor' );
114
-
115
112
var x = [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, -5.0, -6.0 ];
116
113
var mask = [ 0, 0, 0, 0, 0, 0, 1, 1 ];
117
-
varN=floor( x.length/2 );
118
114
119
-
var v =nanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 );
115
+
var v =nanmskmin.ndarray( 4, x, 2, 1, mask, 2, 1 );
120
116
// returns -2.0
121
117
```
122
118
@@ -130,6 +126,8 @@ var v = nanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 );
130
126
131
127
- If `N <= 0`, both functions return `NaN`.
132
128
- Depending on the environment, the typed versions ([`dnanmskmin`][@stdlib/stats/base/dnanmskmin], [`snanmskmin`][@stdlib/stats/base/snanmskmin], etc.) are likely to be significantly more performant.
129
+
- 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]).
130
+
133
131
134
132
</section>
135
133
@@ -142,31 +140,18 @@ var v = nanmskmin.ndarray( N, x, 2, 1, mask, 2, 1 );
142
140
<!-- eslint no-undef: "error" -->
143
141
144
142
```javascript
145
-
var randu =require( '@stdlib/random/base/randu' );
146
-
var round =require( '@stdlib/math/base/special/round' );
0 commit comments