Skip to content

Commit b696b2c

Browse files
committed
Auto-generated commit
1 parent a548483 commit b696b2c

26 files changed

+367
-152
lines changed

Diff for: CHANGELOG.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<section class="release" id="unreleased">
66

7-
## Unreleased (2024-12-29)
7+
## Unreleased (2025-01-02)
88

99
<section class="packages">
1010

@@ -951,6 +951,28 @@ This release closes the following issue:
951951

952952
<!-- /.package -->
953953

954+
<section class="package" id="blas-ext-base-dssum-unreleased">
955+
956+
#### [@stdlib/blas/ext/base/dssum](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dssum)
957+
958+
<details>
959+
960+
<section class="features">
961+
962+
##### Features
963+
964+
- [`f78ae7b`](https://github.com/stdlib-js/stdlib/commit/f78ae7b4ed12879282a4e9c20e6c7b5baf2d6e39) - add C `ndarray` API and refactor `blas/ext/base/dssum` [(#4262)](https://github.com/stdlib-js/stdlib/pull/4262)
965+
966+
</section>
967+
968+
<!-- /.features -->
969+
970+
</details>
971+
972+
</section>
973+
974+
<!-- /.package -->
975+
954976
<section class="package" id="blas-ext-base-dssumors-unreleased">
955977

956978
#### [@stdlib/blas/ext/base/dssumors](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dssumors)
@@ -1246,6 +1268,7 @@ A total of 8 people contributed to this release. Thank you to the following cont
12461268

12471269
<details>
12481270

1271+
- [`f78ae7b`](https://github.com/stdlib-js/stdlib/commit/f78ae7b4ed12879282a4e9c20e6c7b5baf2d6e39) - **feat:** add C `ndarray` API and refactor `blas/ext/base/dssum` [(#4262)](https://github.com/stdlib-js/stdlib/pull/4262) _(by Muhammad Haris)_
12491272
- [`0d8ee2d`](https://github.com/stdlib-js/stdlib/commit/0d8ee2dd2425d7414487f65940dfc4c25c79ad1d) - **docs:** update related packages sections [(#4334)](https://github.com/stdlib-js/stdlib/pull/4334) _(by stdlib-bot)_
12501273
- [`cb750b6`](https://github.com/stdlib-js/stdlib/commit/cb750b6d8686990b958c9f62905dd236c86f98c6) - **docs:** fix C examples in `blas/ext/base/dsumkbn` [(#4315)](https://github.com/stdlib-js/stdlib/pull/4315) _(by Muhammad Haris)_
12511274
- [`a6f3921`](https://github.com/stdlib-js/stdlib/commit/a6f3921560705503dcb5ee2575dd2f11417f58fb) - **docs:** update related packages sections [(#4242)](https://github.com/stdlib-js/stdlib/pull/4242) _(by stdlib-bot, Athan Reines)_

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ See [LICENSE][stdlib-license].
148148

149149
## Copyright
150150

151-
Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
151+
Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
152152

153153
</section>
154154

Diff for: ext/base/dssum/README.md

+128-11
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,26 @@ limitations under the License.
3636
var dssum = require( '@stdlib/blas/ext/base/dssum' );
3737
```
3838

39-
#### dssum( N, x, stride )
39+
#### dssum( N, x, strideX )
4040

4141
Computes the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.
4242

4343
```javascript
4444
var Float32Array = require( '@stdlib/array/float32' );
4545

4646
var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
47-
var N = x.length;
4847

49-
var v = dssum( N, x, 1 );
48+
var v = dssum( x.length, x, 1 );
5049
// returns 1.0
5150
```
5251

5352
The function has the following parameters:
5453

5554
- **N**: number of indexed elements.
5655
- **x**: input [`Float32Array`][@stdlib/array/float32].
57-
- **stride**: index increment for `x`.
56+
- **strideX**: stride length for `x`.
5857

59-
The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array,
58+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element:
6059

6160
```javascript
6261
var Float32Array = require( '@stdlib/array/float32' );
@@ -81,7 +80,7 @@ var v = dssum( 4, x1, 2 );
8180
// returns 5.0
8281
```
8382

84-
#### dssum.ndarray( N, x, stride, offset )
83+
#### dssum.ndarray( N, x, strideX, offsetX )
8584

8685
Computes the sum of single-precision floating-point strided array elements using extended accumulation and alternative indexing semantics and returning an extended precision result.
8786

@@ -96,9 +95,9 @@ var v = dssum.ndarray( 3, x, 1, 0 );
9695

9796
The function has the following additional parameters:
9897

99-
- **offset**: starting index for `x`.
98+
- **offsetX**: starting index for `x`.
10099

101-
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 sum of every other value in the strided array starting from the second value
100+
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 sum of every other element starting from the second element:
102101

103102
```javascript
104103
var Float32Array = require( '@stdlib/array/float32' );
@@ -131,11 +130,12 @@ var v = dssum.ndarray( 4, x, 2, 1 );
131130
<!-- eslint no-undef: "error" -->
132131

133132
```javascript
134-
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
135-
var filledarrayBy = require( '@stdlib/array/filled-by' );
133+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
136134
var dssum = require( '@stdlib/blas/ext/base/dssum' );
137135

138-
var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
136+
var x = discreteUniform( 10.0, -100, 100, {
137+
'dtype': 'float32'
138+
});
139139
console.log( x );
140140

141141
var v = dssum( x.length, x, 1 );
@@ -146,6 +146,123 @@ console.log( v );
146146

147147
<!-- /.examples -->
148148

149+
<!-- C interface documentation. -->
150+
151+
* * *
152+
153+
<section class="c">
154+
155+
## C APIs
156+
157+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
158+
159+
<section class="intro">
160+
161+
</section>
162+
163+
<!-- /.intro -->
164+
165+
<!-- C usage documentation. -->
166+
167+
<section class="usage">
168+
169+
### Usage
170+
171+
```c
172+
#include "stdlib/blas/ext/base/dssum.h"
173+
```
174+
175+
#### stdlib_strided_dssum( N, \*X, strideX )
176+
177+
Computes the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.
178+
179+
```c
180+
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
181+
182+
double v = stdlib_strided_dssum( 4, x, 1 );
183+
// returns 10.0
184+
```
185+
186+
The function accepts the following arguments:
187+
188+
- **N**: `[in] CBLAS_INT` number of indexed elements.
189+
- **X**: `[in] float*` input array.
190+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
191+
192+
```c
193+
double stdlib_strided_dssum( const CBLAS_INT N, const float *X, const CBLAS_INT strideX );
194+
```
195+
196+
#### stdlib_strided_dssum_ndarray( N, \*X, strideX, offsetX )
197+
198+
Computes the sum of single-precision floating-point strided array elements using extended accumulation and alternative indexing semantics and returning an extended precision result.
199+
200+
```c
201+
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
202+
203+
double v = stdlib_strided_dssum_ndarray( 4, x, 1, 0 );
204+
// returns 10.0
205+
```
206+
207+
The function accepts the following arguments:
208+
209+
- **N**: `[in] CBLAS_INT` number of indexed elements.
210+
- **X**: `[in] float*` input array.
211+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
212+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
213+
214+
```c
215+
double stdlib_strided_dssum_ndarray( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
216+
```
217+
218+
</section>
219+
220+
<!-- /.usage -->
221+
222+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
223+
224+
<section class="notes">
225+
226+
</section>
227+
228+
<!-- /.notes -->
229+
230+
<!-- C API usage examples. -->
231+
232+
<section class="examples">
233+
234+
### Examples
235+
236+
```c
237+
#include "stdlib/blas/ext/base/dssum.h"
238+
#include <stdio.h>
239+
240+
int main( void ) {
241+
// Create a strided array:
242+
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
243+
244+
// Specify the number of elements:
245+
const int N = 5;
246+
247+
// Specify the stride length:
248+
const int strideX = 2;
249+
250+
// Compute the sum:
251+
double v = stdlib_strided_dssum( N, x, strideX );
252+
253+
// Print the result:
254+
printf( "sum: %lf\n", v );
255+
}
256+
```
257+
258+
</section>
259+
260+
<!-- /.examples -->
261+
262+
</section>
263+
264+
<!-- /.c -->
265+
149266
<section class="references">
150267
151268
</section>

Diff for: ext/base/dssum/benchmark/benchmark.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
25-
var filledarrayBy = require( '@stdlib/array/filled-by' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
2625
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2726
var pow = require( '@stdlib/math/base/special/pow' );
2827
var pkg = require( './../package.json' ).name;
@@ -31,7 +30,9 @@ var dssum = require( './../lib/dssum.js' );
3130

3231
// VARIABLES //
3332

34-
var rand = uniform( -10.0, 10.0 );
33+
var options = {
34+
'dtype': 'float32'
35+
};
3536

3637

3738
// FUNCTIONS //
@@ -44,7 +45,7 @@ var rand = uniform( -10.0, 10.0 );
4445
* @returns {Function} benchmark function
4546
*/
4647
function createBenchmark( len ) {
47-
var x = filledarrayBy( len, 'float32', rand );
48+
var x = uniform( len, -100, 100, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

Diff for: ext/base/dssum/benchmark/benchmark.native.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
26-
var filledarrayBy = require( '@stdlib/array/filled-by' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
2726
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2827
var pow = require( '@stdlib/math/base/special/pow' );
2928
var tryRequire = require( '@stdlib/utils/try-require' );
@@ -36,7 +35,9 @@ var dssum = tryRequire( resolve( __dirname, './../lib/dssum.native.js' ) );
3635
var opts = {
3736
'skip': ( dssum instanceof Error )
3837
};
39-
var rand = uniform( -10.0, 10.0 );
38+
var options = {
39+
'dtype': 'float32'
40+
};
4041

4142

4243
// FUNCTIONS //
@@ -49,7 +50,7 @@ var rand = uniform( -10.0, 10.0 );
4950
* @returns {Function} benchmark function
5051
*/
5152
function createBenchmark( len ) {
52-
var x = filledarrayBy( len, 'float32', rand );
53+
var x = uniform( len, -100, 100, options );
5354
return benchmark;
5455

5556
function benchmark( b ) {

Diff for: ext/base/dssum/benchmark/benchmark.ndarray.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
25-
var filledarrayBy = require( '@stdlib/array/filled-by' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
2625
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2726
var pow = require( '@stdlib/math/base/special/pow' );
2827
var pkg = require( './../package.json' ).name;
@@ -31,7 +30,9 @@ var dssum = require( './../lib/ndarray.js' );
3130

3231
// VARIABLES //
3332

34-
var rand = uniform( -10.0, 10.0 );
33+
var options = {
34+
'dtype': 'float32'
35+
};
3536

3637

3738
// FUNCTIONS //
@@ -44,7 +45,7 @@ var rand = uniform( -10.0, 10.0 );
4445
* @returns {Function} benchmark function
4546
*/
4647
function createBenchmark( len ) {
47-
var x = filledarrayBy( len, 'float32', rand );
48+
var x = uniform( len, -100, 100, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

Diff for: ext/base/dssum/benchmark/benchmark.ndarray.native.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
26-
var filledarrayBy = require( '@stdlib/array/filled-by' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
2726
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2827
var pow = require( '@stdlib/math/base/special/pow' );
2928
var tryRequire = require( '@stdlib/utils/try-require' );
@@ -36,7 +35,9 @@ var dssum = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) );
3635
var opts = {
3736
'skip': ( dssum instanceof Error )
3837
};
39-
var rand = uniform( -10.0, 10.0 );
38+
var options = {
39+
'dtype': 'float32'
40+
};
4041

4142

4243
// FUNCTIONS //
@@ -49,7 +50,7 @@ var rand = uniform( -10.0, 10.0 );
4950
* @returns {Function} benchmark function
5051
*/
5152
function createBenchmark( len ) {
52-
var x = filledarrayBy( len, 'float32', rand );
53+
var x = uniform( len, -100, 100, options );
5354
return benchmark;
5455

5556
function benchmark( b ) {

0 commit comments

Comments
 (0)