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
Display the source diff
Display the rich diff
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 (2024-12-23)
7
+
## Unreleased (2025-01-17)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`70f187e`](https://github.com/stdlib-js/stdlib/commit/70f187e31fed72289590585dbc5da0254df82c9b) - add C ndarray interface and refactor implementation for `stats/base/dmeanpw`[(#4743)](https://github.com/stdlib-js/stdlib/pull/4743)
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
+
-[`70f187e`](https://github.com/stdlib-js/stdlib/commit/70f187e31fed72289590585dbc5da0254df82c9b) - **feat:** add C ndarray interface and refactor implementation for `stats/base/dmeanpw`[(#4743)](https://github.com/stdlib-js/stdlib/pull/4743)_(by Aayush Khanna)_
15
26
-[`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
16
27
-[`430e40e`](https://github.com/stdlib-js/stdlib/commit/430e40eda1d5a379561b434df31fc3bc5dcc2ce3) - **refactor:** update `stats/base/dmeanpw` native addon from C++ to C [(#4101)](https://github.com/stdlib-js/stdlib/pull/4101)_(by Aayush Khanna)_
17
28
-[`9e689ff`](https://github.com/stdlib-js/stdlib/commit/9e689ffcb7c6223afc521f1e574b42f10921cf5e) - **chore:** fix indentation in manifest.json files _(by Philipp Burckhardt)_
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 =dmeanpw( N, x1, 2 );
127
+
var v =dmeanpw( 4, x1, 2 );
134
128
// returns 1.25
135
129
```
136
130
137
-
#### dmeanpw.ndarray( N, x, stride, offset )
131
+
#### dmeanpw.ndarray( N, x, strideX, offsetX )
138
132
139
133
Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using pairwise summation 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
#### stdlib_strided_dmeanpw_ndarray( N, \*X, strideX, offsetX )
229
+
230
+
Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using pairwise summation and alternative indexing semantics.
231
+
232
+
```c
233
+
constdouble x[] = { 1.0, -2.0, 2.0 };
234
+
235
+
double v = stdlib_strided_dmeanpw_ndarray( 3, x, 1, 0 );
236
+
// returns ~0.3333
237
+
```
238
+
239
+
The function accepts the following arguments:
240
+
241
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
242
+
- **X**: `[in] double*` input array.
243
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
244
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
0 commit comments