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
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,25 @@
4
4
5
5
<sectionclass="release"id="unreleased">
6
6
7
-
## Unreleased (2025-06-07)
7
+
## Unreleased (2025-06-22)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`0cdbf3c`](https://github.com/stdlib-js/stdlib/commit/0cdbf3cf7d5f3c16907ea70a586a732304b6b41b) - add C ndarray interface and refactor implementation for `stats/base/dmeanstdev`[(#7409)](https://github.com/stdlib-js/stdlib/pull/7409)
14
+
15
+
</section>
16
+
17
+
<!-- /.features -->
8
18
9
19
<sectionclass="commits">
10
20
11
21
### Commits
12
22
13
23
<details>
14
24
25
+
-[`0cdbf3c`](https://github.com/stdlib-js/stdlib/commit/0cdbf3cf7d5f3c16907ea70a586a732304b6b41b) - **feat:** add C ndarray interface and refactor implementation for `stats/base/dmeanstdev`[(#7409)](https://github.com/stdlib-js/stdlib/pull/7409)_(by Gururaj Gurram, Athan Reines, stdlib-bot)_
-[`95bdc42`](https://github.com/stdlib-js/stdlib/commit/95bdc42196643ed99f417ec1be130ca7acc6b121) - **refactor:** update `stats/base/dmeanstdev` native addon from C++ to C [(#4612)](https://github.com/stdlib-js/stdlib/pull/4612)_(by Dhruv Arvind Singh)_
@@ -155,21 +155,19 @@ The function has the following parameters:
155
155
-**N**: number of indexed elements.
156
156
-**correction**: degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
-**out**: output [`Float64Array`][@stdlib/array/float64] for storing results.
160
-
-**strideOut**: index increment for `out`.
160
+
-**strideOut**: stride length for `out`.
161
161
162
-
The `N` and `stride` parameters determine which elements are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`,
162
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`,
var x1 =newFloat64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
186
183
187
184
var out0 =newFloat64Array( 4 );
188
185
var out1 =newFloat64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at 3rd element
189
186
190
-
varN=floor( x0.length/2 );
191
-
192
-
var v =dmeanstdev( N, 1, x1, 2, out1, 1 );
187
+
var v =dmeanstdev( 4, 1, x1, 2, out1, 1 );
193
188
// returns <Float64Array>[ 1.25, 2.5 ]
194
189
```
195
190
@@ -212,17 +207,15 @@ The function has the following additional parameters:
212
207
-**offsetX**: starting index for `x`.
213
208
-**offsetOut**: starting index for `out`.
214
209
215
-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameters support indexing semantics based on a starting index. For example, to calculate the [mean][arithmetic-mean] and [standard deviation][standard-deviation] for every other value in `x` starting from the second value
210
+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the [mean][arithmetic-mean] and [standard deviation][standard-deviation] for every other element in `x` starting from the second element
var dmeanstdev =require( '@stdlib/stats-base-dmeanstdev' );
255
247
256
-
var out;
257
-
var x;
258
-
var i;
259
-
260
-
x =newFloat64Array( 10 );
261
-
for ( i =0; i <x.length; i++ ) {
262
-
x[ i ] =round( (randu()*100.0) -50.0 );
263
-
}
248
+
var x =discreteUniform( 10, -50, 50, {
249
+
'dtype':'float64'
250
+
});
264
251
console.log( x );
265
252
266
-
out =newFloat64Array( 2 );
253
+
varout =newFloat64Array( 2 );
267
254
dmeanstdev( x.length, 1, x, 1, out, 1 );
268
255
console.log( out );
269
256
```
@@ -272,6 +259,135 @@ console.log( out );
272
259
273
260
<!-- /.examples -->
274
261
262
+
<!-- C interface documentation. -->
263
+
264
+
* * *
265
+
266
+
<sectionclass="c">
267
+
268
+
## C APIs
269
+
270
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
271
+
272
+
<sectionclass="intro">
273
+
274
+
</section>
275
+
276
+
<!-- /.intro -->
277
+
278
+
<!-- C usage documentation. -->
279
+
280
+
<sectionclass="usage">
281
+
282
+
### Usage
283
+
284
+
```c
285
+
#include"stdlib/stats/base/dmeanstdev.h"
286
+
```
287
+
288
+
#### stdlib_strided_dmeanstdev( N, correction, \*X, strideX, \*Out, strideOut )
289
+
290
+
Computes the [mean][arithmetic-mean] and [standard deviation][standard-deviation] of a double-precision floating-point strided array.
- **N**: `[in] CBLAS_INT` number of indexed elements.
302
+
- **correction**: `[in] double` degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
303
+
- **X**: `[in] double*` input array.
304
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
305
+
- **Out**: `[out] double*` output array.
306
+
- **strideOut**: `[in] CBLAS_INT` stride length for `Out`.
Computes the [mean][arithmetic-mean] and [standard deviation][standard-deviation] of a double-precision floating-point strided array using alternative indexing semantics.
- **N**: `[in] CBLAS_INT` number of indexed elements.
326
+
- **correction**: `[in] double` degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
327
+
- **X**: `[in] double*` input array.
328
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
329
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
330
+
- **Out**: `[out] double*` output array.
331
+
- **strideOut**: `[in] CBLAS_INT` stride length for `Out`.
332
+
- **offsetOut**: `[in] CBLAS_INT` starting index for `Out`.
0 commit comments