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-4
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,26 @@
4
4
5
5
<sectionclass="release"id="unreleased">
6
6
7
-
## Unreleased (2025-01-02)
7
+
## Unreleased (2025-01-19)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`cbb399f`](https://github.com/stdlib-js/stdlib/commit/cbb399f69098247acb31497af6e1370b51fe285d) - add C ndarray interface and refactor implementation for `stats/base/smeanli`[(#4785)](https://github.com/stdlib-js/stdlib/pull/4785)
14
+
15
+
</section>
16
+
17
+
<!-- /.features -->
8
18
9
19
<sectionclass="commits">
10
20
11
21
### Commits
12
22
13
23
<details>
14
24
15
-
-[`5f718b7`](https://github.com/stdlib-js/stdlib/commit/5f718b70ecd483de6fa502efbfed3da4cac79ce2) - **refactor:** update `stats/base/smeanli` native addon from C++ to C [(#4465)](https://github.com/stdlib-js/stdlib/pull/4465)_(by Vivek maurya)_
25
+
-[`cbb399f`](https://github.com/stdlib-js/stdlib/commit/cbb399f69098247acb31497af6e1370b51fe285d) - **feat:** add C ndarray interface and refactor implementation for `stats/base/smeanli`[(#4785)](https://github.com/stdlib-js/stdlib/pull/4785)_(by Aayush Khanna, Athan Reines, stdlib-bot)_
26
+
-[`5f718b7`](https://github.com/stdlib-js/stdlib/commit/5f718b70ecd483de6fa502efbfed3da4cac79ce2) - **refactor:** update `stats/base/smeanli` native addon from C++ to C [(#4465)](https://github.com/stdlib-js/stdlib/pull/4465)_(by Vivek Maurya)_
16
27
-[`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
17
28
-[`9e689ff`](https://github.com/stdlib-js/stdlib/commit/9e689ffcb7c6223afc521f1e574b42f10921cf5e) - **chore:** fix indentation in manifest.json files _(by Philipp Burckhardt)_
18
29
@@ -26,10 +37,12 @@
26
37
27
38
### Contributors
28
39
29
-
A total of 2 people contributed to this release. Thank you to the following contributors:
40
+
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`,
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 discreteUniform =require( '@stdlib/random-array-discrete-uniform' );
193
182
var smeanli =require( '@stdlib/stats-base-smeanli' );
194
183
195
-
var x;
196
-
var i;
197
-
198
-
x =newFloat32Array( 10 );
199
-
for ( i =0; i <x.length; i++ ) {
200
-
x[ i ] =round( (randu()*100.0) -50.0 );
201
-
}
184
+
var x =discreteUniform( 10, -50, 50, {
185
+
'dtype':'float32'
186
+
});
202
187
console.log( x );
203
188
204
189
var v =smeanli( x.length, x, 1 );
@@ -209,6 +194,123 @@ console.log( v );
209
194
210
195
<!-- /.examples -->
211
196
197
+
<!-- C interface documentation. -->
198
+
199
+
* * *
200
+
201
+
<sectionclass="c">
202
+
203
+
## C APIs
204
+
205
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
206
+
207
+
<sectionclass="intro">
208
+
209
+
</section>
210
+
211
+
<!-- /.intro -->
212
+
213
+
<!-- C usage documentation. -->
214
+
215
+
<sectionclass="usage">
216
+
217
+
### Usage
218
+
219
+
```c
220
+
#include"stdlib/stats/base/smeanli.h"
221
+
```
222
+
223
+
#### stdlib_strided_smeanli( N, \*X, strideX )
224
+
225
+
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using a one-pass trial mean algorithm.
226
+
227
+
```c
228
+
constfloat x[] = { 1.0f, 2.0f, 3.0f };
229
+
230
+
float v = stdlib_strided_smeanli( 3, x, 1 );
231
+
// returns 2.0f
232
+
```
233
+
234
+
The function accepts the following arguments:
235
+
236
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
#### stdlib_strided_smeanli_ndarray( N, \*X, strideX, offsetX )
245
+
246
+
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using a one-pass trial mean algorithm and alternative indexing semantics.
247
+
248
+
```c
249
+
constfloat x[] = { 1.0f, 2.0f, 3.0f };
250
+
251
+
float v = stdlib_strided_smeanli_ndarray( 3, x, 1, 0 );
252
+
// returns 2.0f
253
+
```
254
+
255
+
The function accepts the following arguments:
256
+
257
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
0 commit comments