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: CHANGELOG.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,37 @@
4
4
5
5
<sectionclass="release"id="unreleased">
6
6
7
-
## Unreleased (2025-06-10)
7
+
## Unreleased (2025-07-05)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`4f78b17`](https://github.com/stdlib-js/stdlib/commit/4f78b17cee147cfd13285ec9445d17239d4b94df) - refactor and add protocol support to `stats/base/nanrange-by`[(#6440)](https://github.com/stdlib-js/stdlib/pull/6440)
var floor =require( '@stdlib/math-base-special-floor' );
146
142
147
143
functionaccessor( v ) {
148
144
return v *2.0;
@@ -153,16 +149,15 @@ var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
153
149
154
150
// Create an offset view...
155
151
var x1 =newFloat64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
156
-
varN=floor( x0.length/2 );
157
152
158
153
// Access every other element...
159
-
var v =nanrangeBy( N, x1, 2, accessor );
154
+
var v =nanrangeBy( 3, x1, 2, accessor );
160
155
// returns 8.0
161
156
```
162
157
163
-
#### nanrangeBy.ndarray( N, x, stride, offset, clbk\[, thisArg] )
158
+
#### nanrangeBy.ndarray( N, x, strideX, offsetX, clbk\[, thisArg] )
164
159
165
-
Calculates the [range][range] of strided array`x` via a callback function, ignoring `NaN` values and using alternative indexing semantics.
160
+
Computes the [range][range] of a strided array via a callback function, ignoring `NaN` values and using alternative indexing semantics.
166
161
167
162
```javascript
168
163
functionaccessor( v ) {
@@ -177,9 +172,9 @@ var v = nanrangeBy.ndarray( x.length, x, 1, 0, accessor );
177
172
178
173
The function has the following additional parameters:
179
174
180
-
-**offset**: starting index.
175
+
-**offsetX**: starting index.
181
176
182
-
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 access only the last three elements of `x`
177
+
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 access only the last three elements of `x`
183
178
184
179
```javascript
185
180
functionaccessor( v ) {
@@ -204,6 +199,7 @@ var v = nanrangeBy.ndarray( 3, x, 1, x.length-3, accessor );
204
199
- A provided callback function should return a numeric value.
205
200
- If a provided callback function returns `NaN`, the value is ignored.
206
201
- If a provided callback function does not return any value (or equivalently, explicitly returns `undefined`), the value is ignored.
202
+
- 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]).
207
203
- When possible, prefer using [`dnanrange`][@stdlib/stats/strided/dnanrange], [`snanrange`][@stdlib/stats/strided/snanrange], and/or [`nanrange`][@stdlib/stats/base/nanrange], as, depending on the environment, these interfaces are likely to be significantly more performant.
208
204
209
205
</section>
@@ -217,23 +213,23 @@ var v = nanrangeBy.ndarray( 3, x, 1, x.length-3, accessor );
217
213
<!-- eslint no-undef: "error" -->
218
214
219
215
```javascript
220
-
var discreteUniform =require( '@stdlib/random-base-discrete-uniform' );
221
-
var randu =require( '@stdlib/random-base-randu' );
216
+
var uniform =require( '@stdlib/random-base-uniform' );
222
217
var filledarrayBy =require( '@stdlib/array-filled-by' );
218
+
var bernoulli =require( '@stdlib/random-base-bernoulli' );
223
219
var nanrangeBy =require( '@stdlib/stats-base-nanrange-by' );
0 commit comments