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 (2025-01-18)
8
+
9
+
<sectionclass="features">
10
+
11
+
### Features
12
+
13
+
-[`6641a29`](https://github.com/stdlib-js/stdlib/commit/6641a29ca92ada4779b1a55d5c681cf375eae791) - add C `ndarray` API and refactor `blas/ext/base/scusum`[(#4799)](https://github.com/stdlib-js/stdlib/pull/4799)
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
+
-[`6641a29`](https://github.com/stdlib-js/stdlib/commit/6641a29ca92ada4779b1a55d5c681cf375eae791) - **feat:** add C `ndarray` API and refactor `blas/ext/base/scusum`[(#4799)](https://github.com/stdlib-js/stdlib/pull/4799)_(by Muhammad Haris)_
15
26
-[`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
16
27
17
28
</details>
@@ -24,8 +35,9 @@
24
35
25
36
### Contributors
26
37
27
-
A total of 1 person contributed to this release. Thank you to this contributor:
38
+
A total of 2 people contributed to this release. Thank you to the following contributors:
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 the strided input array,
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 the strided input array starting from the second value and to store in the last `N` elements of the strided output array 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 in the strided input array starting from the second element and to store in the last `N` elements of the strided output array starting from the last element:
var discreteUniform =require( '@stdlib/random-array-discrete-uniform' );
187
185
var scusum =require( '@stdlib/blas-ext-base-scusum' );
188
186
189
-
var x =filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
190
-
var y =newFloat32Array( x.length );
187
+
var x =discreteUniform( 10, -100, 100, {
188
+
'dtype':'float32'
189
+
});
191
190
console.log( x );
191
+
192
+
var y =discreteUniform( 10, -100, 100, {
193
+
'dtype':'float32'
194
+
});
192
195
console.log( y );
193
196
194
197
scusum( x.length, 0.0, x, 1, y, -1 );
@@ -199,6 +202,138 @@ console.log( y );
199
202
200
203
<!-- /.examples -->
201
204
205
+
<!-- C interface documentation. -->
206
+
207
+
* * *
208
+
209
+
<sectionclass="c">
210
+
211
+
## C APIs
212
+
213
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
214
+
215
+
<sectionclass="intro">
216
+
217
+
</section>
218
+
219
+
<!-- /.intro -->
220
+
221
+
<!-- C usage documentation. -->
222
+
223
+
<sectionclass="usage">
224
+
225
+
### Usage
226
+
227
+
```c
228
+
#include"stdlib/blas/ext/base/scusum.h"
229
+
```
230
+
231
+
#### stdlib_strided_scusum( N, sum, \*X, strideX, \*Y, strideY )
232
+
233
+
Computes the cumulative sum of single-precision floating-point strided array elements.
234
+
235
+
```c
236
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
237
+
float y[] = { 0.0f, 0.0f, 0.0f, 0.0f };
238
+
239
+
stdlib_strided_scusum( 4, 0.0f, x, 1, y, 1 );
240
+
```
241
+
242
+
The function accepts the following arguments:
243
+
244
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
245
+
- **sum**: `[in] float` initial sum.
246
+
- **X**: `[in] float*` input array.
247
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
248
+
- **Y**: `[out] float*` output array.
249
+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
0 commit comments