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 (2025-06-08)
7
+
## Unreleased (2025-06-29)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`716275f`](https://github.com/stdlib-js/stdlib/commit/716275fdf515090bb85f78ca5099be9011abcb66) - add C ndarray interface and refactor implementation for `stats/base/smeanlipw`[(#7500)](https://github.com/stdlib-js/stdlib/pull/7500)
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
+
-[`716275f`](https://github.com/stdlib-js/stdlib/commit/716275fdf515090bb85f78ca5099be9011abcb66) - **feat:** add C ndarray interface and refactor implementation for `stats/base/smeanlipw`[(#7500)](https://github.com/stdlib-js/stdlib/pull/7500)_(by Gururaj Gurram, Athan Reines, stdlib-bot)_
@@ -84,36 +84,33 @@ To view installation and usage instructions specific to each branch build, be su
84
84
var smeanlipw =require( '@stdlib/stats-base-smeanlipw' );
85
85
```
86
86
87
-
#### smeanlipw( N, x, stride )
87
+
#### smeanlipw( N, x, strideX )
88
88
89
-
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`using a one-pass trial mean algorithm with pairwise summation.
89
+
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using a one-pass trial mean algorithm with pairwise summation.
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 =newFloat32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
130
126
131
-
varN=floor( x0.length/2 );
132
-
133
-
var v =smeanlipw( N, x1, 2 );
127
+
var v =smeanlipw( 4, x1, 2 );
134
128
// returns 1.25
135
129
```
136
130
137
-
#### smeanlipw.ndarray( N, x, stride, offset )
131
+
#### smeanlipw.ndarray( N, x, strideX, offsetX )
138
132
139
133
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array using a one-pass trial mean algorithm with 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
var discreteUniform =require( '@stdlib/random-array-discrete-uniform' );
193
182
var smeanlipw =require( '@stdlib/stats-base-smeanlipw' );
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 =smeanlipw( 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/smeanlipw.h"
221
+
```
222
+
223
+
#### stdlib_strided_smeanlipw( 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 with pairwise summation.
#### stdlib_strided_smeanlipw_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 with pairwise summation and alternative indexing semantics.
0 commit comments