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
+14-2Lines changed: 14 additions & 2 deletions
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-03-26)
7
+
## Unreleased (2025-04-11)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`ce86a5d`](https://github.com/stdlib-js/stdlib/commit/ce86a5d7a15f0bc79349d46ecbc661f270c7025b) - add C ndarray interface and refactor implementation for `stats/base/dmeanpn`[(#6510)](https://github.com/stdlib-js/stdlib/pull/6510)
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
+
-[`ce86a5d`](https://github.com/stdlib-js/stdlib/commit/ce86a5d7a15f0bc79349d46ecbc661f270c7025b) - **feat:** add C ndarray interface and refactor implementation for `stats/base/dmeanpn`[(#6510)](https://github.com/stdlib-js/stdlib/pull/6510)_(by Gururaj Gurram, Athan Reines)_
-[`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
17
28
-[`dbb5935`](https://github.com/stdlib-js/stdlib/commit/dbb59359010b9ac0a404604914d5db63f8fadcbc) - **refactor:** update `stats/base/dmeanpn` native addon from C++ to C [(#4100)](https://github.com/stdlib-js/stdlib/pull/4100)_(by Aayush Khanna)_
@@ -29,10 +40,11 @@
29
40
30
41
### Contributors
31
42
32
-
A total of 3 people contributed to this release. Thank you to the following contributors:
43
+
A total of 4 people contributed to this release. Thank you to the following contributors:
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`,
106
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`,
var x1 =newFloat64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
130
126
131
-
varN=floor( x0.length/2 );
132
-
133
-
var v =dmeanpn( N, x1, 2 );
127
+
var v =dmeanpn( 4, x1, 2 );
134
128
// returns 1.25
135
129
```
136
130
137
-
#### dmeanpn.ndarray( N, x, stride, offset )
131
+
#### dmeanpn.ndarray( N, x, strideX, offsetX )
138
132
139
133
Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using a two-pass error correction algorithm and alternative indexing semantics.
The function has the following additional parameters:
152
145
153
-
-**offset**: starting index for `x`.
146
+
-**offsetX**: starting index for `x`.
154
147
155
-
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 [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value
148
+
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 [arithmetic mean][arithmetic-mean] for every other element in `x` starting from the second element
var floor =require( '@stdlib/math-base-special-floor' );
160
152
161
153
var x =newFloat64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
162
-
varN=floor( x.length/2 );
163
154
164
-
var v =dmeanpn.ndarray( N, x, 2, 1 );
155
+
var v =dmeanpn.ndarray( 4, x, 2, 1 );
165
156
// returns 1.25
166
157
```
167
158
@@ -208,6 +199,123 @@ console.log( v );
208
199
209
200
<!-- /.examples -->
210
201
202
+
<!-- C interface documentation. -->
203
+
204
+
* * *
205
+
206
+
<sectionclass="c">
207
+
208
+
## C APIs
209
+
210
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
211
+
212
+
<sectionclass="intro">
213
+
214
+
</section>
215
+
216
+
<!-- /.intro -->
217
+
218
+
<!-- C usage documentation. -->
219
+
220
+
<sectionclass="usage">
221
+
222
+
### Usage
223
+
224
+
```c
225
+
#include"stdlib/stats/base/dmeanpn.h"
226
+
```
227
+
228
+
#### stdlib_strided_dmeanpn( N, \*X, strideX )
229
+
230
+
Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using a two-pass error correction algorithm.
#### stdlib_strided_dmeanpn_ndarray( N, \*X, strideX, offsetX )
250
+
251
+
Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using a two-pass error correction algorithm and alternative indexing semantics.
0 commit comments