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-2
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,17 @@
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
+
-[`04950f3`](https://github.com/stdlib-js/stdlib/commit/04950f32082d53f9dc2fa114c3885a69c02e3246) - add C `ndarray` API and refactor `blas/ext/base/sapxsumkbn2`[(#4730)](https://github.com/stdlib-js/stdlib/pull/4730)
14
+
15
+
</section>
16
+
17
+
<!-- /.features -->
8
18
9
19
<sectionclass="bug-fixes">
10
20
@@ -23,6 +33,7 @@
23
33
24
34
<details>
25
35
36
+
-[`04950f3`](https://github.com/stdlib-js/stdlib/commit/04950f32082d53f9dc2fa114c3885a69c02e3246) - **feat:** add C `ndarray` API and refactor `blas/ext/base/sapxsumkbn2`[(#4730)](https://github.com/stdlib-js/stdlib/pull/4730)_(by Muhammad Haris, Athan Reines)_
26
37
-[`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
27
38
-[`2ea848b`](https://github.com/stdlib-js/stdlib/commit/2ea848b62b686e1e9d861f7df25ece23a7d80798) - **style:** update to use tabs for indentation _(by Philipp Burckhardt)_
28
39
-[`2222d50`](https://github.com/stdlib-js/stdlib/commit/2222d505c97a6c4f8acf89bdb3aae6f504589e04) - **fix:** update include path and refactor addon _(by Athan Reines)_
@@ -42,9 +53,10 @@
42
53
43
54
### Contributors
44
55
45
-
A total of 2 people contributed to this release. Thank you to the following contributors:
56
+
A total of 3 people contributed to this release. Thank you to the following contributors:
> Add a constant to each single-precision floating-point strided array element and compute the sum using a second-order iterative Kahan–Babuška algorithm.
36
+
> Add a scalar constant to each single-precision floating-point strided array element and compute the sum using a second-order iterative Kahan–Babuška algorithm.
37
37
38
38
<sectionclass="intro">
39
39
@@ -69,27 +69,26 @@ To view installation and usage instructions specific to each branch build, be su
69
69
var sapxsumkbn2 =require( '@stdlib/blas-ext-base-sapxsumkbn2' );
70
70
```
71
71
72
-
#### sapxsumkbn2( N, alpha, x, stride )
72
+
#### sapxsumkbn2( N, alpha, x, strideX )
73
73
74
-
Adds a constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
74
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access 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 access every other element:
@@ -114,25 +113,24 @@ var v = sapxsumkbn2( 4, 5.0, x1, 2 );
114
113
// returns 25.0
115
114
```
116
115
117
-
#### sapxsumkbn2.ndarray( N, alpha, x, stride, offset )
116
+
#### sapxsumkbn2.ndarray( N, alpha, x, strideX, offsetX )
118
117
119
-
Adds a constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics.
118
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics.
var v =sapxsumkbn2.ndarray( x.length, 5.0, x, 1, 0 );
128
126
// returns 16.0
129
127
```
130
128
131
129
The function has the following additional parameters:
132
130
133
-
-**offset**: starting index for `x`.
131
+
-**offsetX**: starting index.
134
132
135
-
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 access 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 access every other element starting from the second element:
@@ -164,11 +162,12 @@ var v = sapxsumkbn2.ndarray( 4, 5.0, x, 2, 1 );
164
162
<!-- eslint no-undef: "error" -->
165
163
166
164
```javascript
167
-
var discreteUniform =require( '@stdlib/random-base-discrete-uniform' ).factory;
168
-
var filledarrayBy =require( '@stdlib/array-filled-by' );
165
+
var discreteUniform =require( '@stdlib/random-array-discrete-uniform' );
169
166
var sapxsumkbn2 =require( '@stdlib/blas-ext-base-sapxsumkbn2' );
170
167
171
-
var x =filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
168
+
var x =discreteUniform( 10, -100, 100, {
169
+
'dtype':'float32'
170
+
});
172
171
console.log( x );
173
172
174
173
var v =sapxsumkbn2( x.length, 5.0, x, 1 );
@@ -179,8 +178,125 @@ console.log( v );
179
178
180
179
<!-- /.examples -->
181
180
181
+
<!-- C interface documentation. -->
182
+
182
183
* * *
183
184
185
+
<sectionclass="c">
186
+
187
+
## C APIs
188
+
189
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
190
+
191
+
<sectionclass="intro">
192
+
193
+
</section>
194
+
195
+
<!-- /.intro -->
196
+
197
+
<!-- C usage documentation. -->
198
+
199
+
<sectionclass="usage">
200
+
201
+
### Usage
202
+
203
+
```c
204
+
#include"stdlib/blas/ext/base/sapxsumkbn2.h"
205
+
```
206
+
207
+
#### stdlib_strided_sapxsumkbn2( N, alpha, \*X, strideX )
208
+
209
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
210
+
211
+
```c
212
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
213
+
214
+
float v = stdlib_strided_sapxsumkbn2( 4, 5.0f, x, 1 );
215
+
// returns 30.0f
216
+
```
217
+
218
+
The function accepts the following arguments:
219
+
220
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
#### stdlib_strided_sapxsumkbn2_ndarray( N, alpha, \*X, strideX, offsetX )
230
+
231
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics.
232
+
233
+
```c
234
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
235
+
236
+
float v = stdlib_strided_sapxsumkbn2_ndarray( 4, 5.0f, x, 1, 0 );
237
+
// returns 30.0f
238
+
```
239
+
240
+
The function accepts the following arguments:
241
+
242
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
0 commit comments