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
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,26 @@
4
4
5
5
<sectionclass="release"id="unreleased">
6
6
7
-
## Unreleased (2024-12-30)
7
+
## Unreleased (2025-02-14)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`f70e622`](https://github.com/stdlib-js/stdlib/commit/f70e6223dfc766d41092bc0039379c94f3b34681) - add C `ndarray` interface and refactor implementation for `stats/base/dsnanmeanors`[(#4397)](https://github.com/stdlib-js/stdlib/pull/4397)
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
+
-[`f70e622`](https://github.com/stdlib-js/stdlib/commit/f70e6223dfc766d41092bc0039379c94f3b34681) - **feat:** add C `ndarray` interface and refactor implementation for `stats/base/dsnanmeanors`[(#4397)](https://github.com/stdlib-js/stdlib/pull/4397)_(by Neeraj Pathak, Aayush Khanna)_
26
+
-[`ab0e174`](https://github.com/stdlib-js/stdlib/commit/ab0e1746d6647e725fb2126e6fe78d1892970b6d) - **refactor:** update `stats/base/dsnanmeanors` native addon from C++ to C [(#4865)](https://github.com/stdlib-js/stdlib/pull/4865)_(by Prashant Kumar Yadav)_
15
27
-[`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
16
28
-[`9e689ff`](https://github.com/stdlib-js/stdlib/commit/9e689ffcb7c6223afc521f1e574b42f10921cf5e) - **chore:** fix indentation in manifest.json files _(by Philipp Burckhardt)_
@@ -84,84 +84,79 @@ To view installation and usage instructions specific to each branch build, be su
84
84
var dsnanmeanors =require( '@stdlib/stats-base-dsnanmeanors' );
85
85
```
86
86
87
-
#### dsnanmeanors( N, x, stride )
87
+
#### dsnanmeanors( N, x, strideX )
88
88
89
89
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.
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`,
106
107
107
-
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`,
var floor =require( '@stdlib/math-base-special-floor' );
127
125
128
-
var x0 =newFloat32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
126
+
var x0 =newFloat32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );
129
127
var x1 =newFloat32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
130
128
131
-
varN=floor( x0.length/2 );
132
-
133
-
var v =dsnanmeanors( N, x1, 2 );
129
+
var v =dsnanmeanors( 5, x1, 2 );
134
130
// returns 1.25
135
131
```
136
132
137
-
#### dsnanmeanors.ndarray( N, x, stride, offset )
133
+
#### dsnanmeanors.ndarray( N, x, strideX, offsetX )
138
134
139
135
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using ordinary recursive summation with extended accumulation and alternative indexing semantics.
var x =newFloat32Array( [ 1.0, -2.0, NaN, 2.0 ] );
145
-
varN=x.length;
146
141
147
-
var v =dsnanmeanors.ndarray( N, x, 1, 0 );
142
+
var v =dsnanmeanors.ndarray( x.length, x, 1, 0 );
148
143
// returns ~0.33333
149
144
```
150
145
151
146
The function has the following additional parameters:
152
147
153
-
-**offset**: starting index for `x`.
148
+
-**offsetX**: starting index for `x`.
154
149
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
150
+
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 elemnent in `x` starting from the second elemnent
var floor =require( '@stdlib/math-base-special-floor' );
160
156
161
-
var x =newFloat32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
162
-
varN=floor( x.length/2 );
157
+
var x =newFloat32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );
163
158
164
-
var v =dsnanmeanors.ndarray( N, x, 2, 1 );
159
+
var v =dsnanmeanors.ndarray( 5, x, 2, 1 );
165
160
// returns 1.25
166
161
```
167
162
@@ -215,6 +210,123 @@ console.log( v );
215
210
216
211
<!-- /.examples -->
217
212
213
+
<!-- C interface documentation. -->
214
+
215
+
* * *
216
+
217
+
<sectionclass="c">
218
+
219
+
## C APIs
220
+
221
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
222
+
223
+
<sectionclass="intro">
224
+
225
+
</section>
226
+
227
+
<!-- /.intro -->
228
+
229
+
<!-- C usage documentation. -->
230
+
231
+
<sectionclass="usage">
232
+
233
+
### Usage
234
+
235
+
```c
236
+
#include"stdlib/stats/base/dsnanmeanors.h"
237
+
```
238
+
239
+
#### stdlib_strided_dsnanmeanors( N, \*X, strideX )
240
+
241
+
Computes the arithmetic mean of a single-precision floating-point strided array, ignoring `NaN` values and using ordinary recursive summation with extended accumulation and alternative indexing semantics.
#### stdlib_strided_dsnanmeanors_ndarray( N, \*X, strideX, offsetX )
261
+
262
+
Computes the arithmetic mean of a single-precision floating-point strided array, ignoring `NaN` values and using ordinary recursive summation with extended accumulation and alternative indexing semantics.
0 commit comments