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
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-01-13)
7
+
## Unreleased (2025-01-19)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`6560077`](https://github.com/stdlib-js/stdlib/commit/6560077508ae3c79fbe9ba1e2f90ec6f5e610db8) - add C `ndarray` API and refactor `blas/ext/base/scusumpw`[(#4814)](https://github.com/stdlib-js/stdlib/pull/4814)
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
+
-[`6560077`](https://github.com/stdlib-js/stdlib/commit/6560077508ae3c79fbe9ba1e2f90ec6f5e610db8) - **feat:** add C `ndarray` API and refactor `blas/ext/base/scusumpw`[(#4814)](https://github.com/stdlib-js/stdlib/pull/4814)_(by Muhammad Haris, Athan Reines)_
15
26
-[`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`,
101
+
The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element:
@@ -148,7 +148,7 @@ The function has the following additional parameters:
148
148
-**offsetX**: starting index for `x`.
149
149
-**offsetY**: starting index for `y`.
150
150
151
-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY`parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x`starting from the second value and to store in the last `N` elements of `y` starting from the last element
151
+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the cumulative sum of every other element starting from the second element and to store in the last `N` elements of `y` starting from the last element:
var discreteUniform =require( '@stdlib/random-array-discrete-uniform' );
188
186
var scusumpw =require( '@stdlib/blas-ext-base-scusumpw' );
189
187
190
-
var x =filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
191
-
var y =newFloat32Array( x.length );
192
-
188
+
var x =discreteUniform( 10, -100, 100, {
189
+
'dtype':'float32'
190
+
});
193
191
console.log( x );
192
+
193
+
var y =discreteUniform( 10, -100, 100, {
194
+
'dtype':'float32'
195
+
});
194
196
console.log( y );
195
197
196
198
scusumpw( x.length, 0.0, x, 1, y, -1 );
@@ -201,8 +203,138 @@ console.log( y );
201
203
202
204
<!-- /.examples -->
203
205
206
+
<!-- C interface documentation. -->
207
+
204
208
* * *
205
209
210
+
<sectionclass="c">
211
+
212
+
## C APIs
213
+
214
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
215
+
216
+
<sectionclass="intro">
217
+
218
+
</section>
219
+
220
+
<!-- /.intro -->
221
+
222
+
<!-- C usage documentation. -->
223
+
224
+
<sectionclass="usage">
225
+
226
+
### Usage
227
+
228
+
```c
229
+
#include"stdlib/blas/ext/base/scusumpw.h"
230
+
```
231
+
232
+
#### stdlib_strided_scusumpw( N, sum, \*X, strideX, \*Y, strideY )
233
+
234
+
Computes the cumulative sum of single-precision floating-point strided array elements using pairwise summation.
235
+
236
+
```c
237
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f }
238
+
float y[] = { 0.0f, 0.0f, 0.0f, 0.0f }
239
+
240
+
stdlib_strided_scusumpw( 4, 0.0f, x, 1, y, 1 );
241
+
```
242
+
243
+
The function accepts the following arguments:
244
+
245
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
246
+
- **sum**: `[in] float` initial sum.
247
+
- **X**: `[in] float*` input array.
248
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
249
+
- **Y**: `[out] float*` output array.
250
+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
0 commit comments