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 (2024-12-23)
7
+
## Unreleased (2024-12-25)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`3d7cff6`](https://github.com/stdlib-js/stdlib/commit/3d7cff6731e0593bd1077fc7084f62a9ea807acb) - add C ndarray interface and refactor implementation for `stats/base/dnanminabs`[(#4238)](https://github.com/stdlib-js/stdlib/pull/4238)
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
+
-[`3d7cff6`](https://github.com/stdlib-js/stdlib/commit/3d7cff6731e0593bd1077fc7084f62a9ea807acb) - **feat:** add C ndarray interface and refactor implementation for `stats/base/dnanminabs`[(#4238)](https://github.com/stdlib-js/stdlib/pull/4238)_(by Aayush Khanna)_
15
26
-[`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
16
27
-[`a0eb37f`](https://github.com/stdlib-js/stdlib/commit/a0eb37f8a76369a7b0f6bec74affdf65d8a33b0c) - **refactor:** update `stats/base/dnanminabs` native addon from C++ to C [(#4126)](https://github.com/stdlib-js/stdlib/pull/4126)_(by Vivek maurya)_
17
28
-[`9e689ff`](https://github.com/stdlib-js/stdlib/commit/9e689ffcb7c6223afc521f1e574b42f10921cf5e) - **chore:** fix indentation in manifest.json files _(by Philipp Burckhardt)_
@@ -27,8 +38,9 @@
27
38
28
39
### Contributors
29
40
30
-
A total of 3 people contributed to this release. Thank you to the following contributors:
41
+
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 minimum absolute value of every other element in `x`,
91
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`,
var floor =require( '@stdlib/math-base-special-floor' );
112
108
113
109
var x0 =newFloat64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] );
114
110
var x1 =newFloat64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
115
111
116
-
varN=floor( x0.length/2 );
117
-
118
-
var v =dnanminabs( N, x1, 2 );
112
+
var v =dnanminabs( 4, x1, 2 );
119
113
// returns 1.0
120
114
```
121
115
122
-
#### dnanminabs.ndarray( N, x, stride, offset )
116
+
#### dnanminabs.ndarray( N, x, strideX, offsetX )
123
117
124
118
Computes the minimum absolute value of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics.
var x =newFloat64Array( [ 1.0, -2.0, NaN, 2.0 ] );
130
-
varN=x.length;
131
124
132
-
var v =dnanminabs.ndarray( N, x, 1, 0 );
125
+
var v =dnanminabs.ndarray( x.length, x, 1, 0 );
133
126
// returns 1.0
134
127
```
135
128
136
129
The function has the following additional parameters:
137
130
138
-
-**offset**: starting index for `x`.
131
+
-**offsetX**: starting index for `x`.
139
132
140
-
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 minimum absolute value for every other value in `x` starting from the second value
133
+
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 minimum absolute value for every other element in `x` starting from the second element
var floor =require( '@stdlib/math-base-special-floor' );
145
137
146
138
var x =newFloat64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] );
147
-
varN=floor( x.length/2 );
148
139
149
-
var v =dnanminabs.ndarray( N, x, 2, 1 );
140
+
var v =dnanminabs.ndarray( 4, x, 2, 1 );
150
141
// returns 1.0
151
142
```
152
143
@@ -197,6 +188,123 @@ console.log( v );
197
188
198
189
<!-- /.examples -->
199
190
191
+
<!-- C interface documentation. -->
192
+
193
+
* * *
194
+
195
+
<sectionclass="c">
196
+
197
+
## C APIs
198
+
199
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
200
+
201
+
<sectionclass="intro">
202
+
203
+
</section>
204
+
205
+
<!-- /.intro -->
206
+
207
+
<!-- C usage documentation. -->
208
+
209
+
<sectionclass="usage">
210
+
211
+
### Usage
212
+
213
+
```c
214
+
#include"stdlib/stats/base/dnanminabs.h"
215
+
```
216
+
217
+
#### stdlib_strided_dnanminabs( N, \*X, strideX )
218
+
219
+
Calculate the minimum absolute value of a double-precision floating-point strided array, ignoring `NaN` values.
220
+
221
+
```c
222
+
constdouble x[] = { 1.0, -2.0, 0.0 / 0.0, -4.0 };
223
+
224
+
double v = stdlib_strided_dnanminabs( 4, x, 1 );
225
+
// returns 1.0
226
+
```
227
+
228
+
The function accepts the following arguments:
229
+
230
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
231
+
- **X**: `[in] double*` input array.
232
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
#### stdlib_strided_dnanminabs_ndarray( N, \*X, strideX, offsetX )
239
+
240
+
Computes the minimum absolute value of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics.
241
+
242
+
```c
243
+
constdouble x[] = { 1.0, -2.0, 0.0 / 0.0, -4.0 };
244
+
245
+
double v = stdlib_strided_dnanminabs_ndarray( 4, x, 1, 0 );
246
+
// returns 1.0
247
+
```
248
+
249
+
The function accepts the following arguments:
250
+
251
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
252
+
- **X**: `[in] double*` input array.
253
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
254
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
0 commit comments