Skip to content

Commit 4eba685

Browse files
committed
Auto-generated commit
1 parent ef78804 commit 4eba685

File tree

14 files changed

+78
-53
lines changed

14 files changed

+78
-53
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-02-02)
7+
## Unreleased (2025-02-11)
88

99
<section class="features">
1010

@@ -22,6 +22,7 @@
2222

2323
<details>
2424

25+
- [`0feb415`](https://github.com/stdlib-js/stdlib/commit/0feb415ee92e1d3851665ac6729b6ea819f926ff) - **docs:** update `blas/ext/base/dnanasum` to follow current project conventions [(#5172)](https://github.com/stdlib-js/stdlib/pull/5172) _(by Muhammad Haris)_
2526
- [`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
2627
- [`7f76495`](https://github.com/stdlib-js/stdlib/commit/7f76495810ffc554f5c8ef36d2458f6dfd1c31f2) - **test:** add tests to `blas/ext/base/dnanasum` [(#3056)](https://github.com/stdlib-js/stdlib/pull/3056) _(by Saurabh Singh, Athan Reines, stdlib-bot)_
2728
- [`ea7b344`](https://github.com/stdlib-js/stdlib/commit/ea7b34499a4847bd917e120595a0c677fe8bddb9) - **feat:** add C `ndarray` API and refactor `blas/ext/base/dnanasum` [(#2984)](https://github.com/stdlib-js/stdlib/pull/2984) _(by Muhammad Haris, Athan Reines)_

CONTRIBUTORS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ EuniceSim142 <[email protected]>
3737
Frank Kovacs <[email protected]>
3838
Golden Kumar <[email protected]>
3939
Gunj Joshi <[email protected]>
40-
Gururaj Gurram <[email protected].com>
40+
Gururaj Gurram <gururajgurram1512@gmail.com>
4141
4242
Harshita Kalani <[email protected]>
4343
Hridyanshu <[email protected]>
@@ -63,6 +63,7 @@ Marcus Fantham <[email protected]>
6363
Matt Cochrane <[email protected]>
6464
Mihir Pandit <[email protected]>
6565
Milan Raj <[email protected]>
66+
Mohammad Bin Aftab <[email protected]>
6667
Mohammad Kaif <[email protected]>
6768
Momtchil Momtchev <[email protected]>
6869
Muhammad Haris <[email protected]>
@@ -124,6 +125,8 @@ Vivek Maurya <[email protected]>
124125
Xiaochuan Ye <[email protected]>
125126
Yaswanth Kosuru <[email protected]>
126127
Yernar Yergaziyev <[email protected]>
128+
ekambains <[email protected]>
127129
olenkabilonizhka <[email protected]>
130+
pranav-1720 <[email protected]>
128131
129132

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,18 @@ Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision fl
9292
var Float64Array = require( '@stdlib/array-float64' );
9393

9494
var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );
95-
var N = x.length;
9695

97-
var v = dnanasum( N, x, 1 );
96+
var v = dnanasum( x.length, x, 1 );
9897
// returns 5.0
9998
```
10099

101100
The function has the following parameters:
102101

103102
- **N**: number of indexed elements.
104103
- **x**: input [`Float64Array`][@stdlib/array/float64].
105-
- **strideX**: index increment for `x`.
104+
- **strideX**: stride length.
106105

107-
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of absolute values ([_L1_ norm][l1norm]) for every other element in the strided array,
106+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of absolute values ([_L1_ norm][l1norm]) for every other element:
108107

109108
```javascript
110109
var Float64Array = require( '@stdlib/array-float64' );
@@ -144,9 +143,9 @@ var v = dnanasum.ndarray( 4, x, 1, 0 );
144143

145144
The function has the following additional parameters:
146145

147-
- **offsetX**: starting index for `x`.
146+
- **offsetX**: starting index.
148147

149-
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 absolute values ([_L1_ norm][l1norm]) for every other value in the strided array 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 sum of absolute values ([_L1_ norm][l1norm]) for every other value in the strided array starting from the second value:
150149

151150
```javascript
152151
var Float64Array = require( '@stdlib/array-float64' );
@@ -185,7 +184,7 @@ var Float64Array = require( '@stdlib/array-float64' );
185184
var dnanasum = require( '@stdlib/blas-ext-base-dnanasum' );
186185

187186
function rand() {
188-
if ( bernoulli( 0.8 ) > 0 ) {
187+
if ( bernoulli( 0.5 ) < 1 ) {
189188
return discreteUniform( 0, 100 );
190189
}
191190
return NaN;
@@ -243,7 +242,7 @@ The function accepts the following arguments:
243242
244243
- **N**: `[in] CBLAS_INT` number of indexed elements.
245244
- **X**: `[in] double*` input array.
246-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
245+
- **strideX**: `[in] CBLAS_INT` stride length.
247246
248247
```c
249248
double stdlib_strided_dnanasum( const CBLAS_INT N, const double *X, const CBLAS_INT strideX );
@@ -264,8 +263,8 @@ The function accepts the following arguments:
264263
265264
- **N**: `[in] CBLAS_INT` number of indexed elements.
266265
- **X**: `[in] double*` input array.
267-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
268-
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
266+
- **strideX**: `[in] CBLAS_INT` stride length.
267+
- **offsetX**: `[in] CBLAS_INT` starting index.
269268
270269
```c
271270
double stdlib_strided_dnanasum_ndarray( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );

benchmark/benchmark.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ var dnanasum = require( './../lib/dnanasum.js' );
3232

3333
// FUNCTIONS //
3434

35+
/**
36+
* Returns a random number.
37+
*
38+
* @private
39+
* @returns {number} random number
40+
*/
41+
function rand() {
42+
if ( bernoulli( 0.5 ) < 1 ) {
43+
return uniform( -10.0, 10.0 );
44+
}
45+
return NaN;
46+
}
47+
3548
/**
3649
* Creates a benchmark function.
3750
*
@@ -43,13 +56,6 @@ function createBenchmark( len ) {
4356
var x = filledarrayBy( len, 'float64', rand );
4457
return benchmark;
4558

46-
function rand() {
47-
if ( bernoulli( 0.8 ) > 0 ) {
48-
return uniform( -10.0, 10.0 );
49-
}
50-
return NaN;
51-
}
52-
5359
function benchmark( b ) {
5460
var v;
5561
var i;

benchmark/benchmark.native.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ var opts = {
4141

4242
// FUNCTIONS //
4343

44+
/**
45+
* Returns a random number.
46+
*
47+
* @private
48+
* @returns {number} random number
49+
*/
50+
function rand() {
51+
if ( bernoulli( 0.5 ) < 1 ) {
52+
return uniform( -10.0, 10.0 );
53+
}
54+
return NaN;
55+
}
56+
4457
/**
4558
* Creates a benchmark function.
4659
*
@@ -52,13 +65,6 @@ function createBenchmark( len ) {
5265
var x = filledarrayBy( len, 'float64', rand );
5366
return benchmark;
5467

55-
function rand() {
56-
if ( bernoulli( 0.8 ) > 0 ) {
57-
return uniform( -10.0, 10.0 );
58-
}
59-
return NaN;
60-
}
61-
6268
function benchmark( b ) {
6369
var v;
6470
var i;

benchmark/benchmark.ndarray.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ var dnanasum = require( './../lib/ndarray.js' );
3232

3333
// FUNCTIONS //
3434

35+
/**
36+
* Returns a random number.
37+
*
38+
* @private
39+
* @returns {number} random number
40+
*/
41+
function rand() {
42+
if ( bernoulli( 0.5 ) < 1 ) {
43+
return uniform( -10.0, 10.0 );
44+
}
45+
return NaN;
46+
}
47+
3548
/**
3649
* Creates a benchmark function.
3750
*
@@ -43,13 +56,6 @@ function createBenchmark( len ) {
4356
var x = filledarrayBy( len, 'float64', rand );
4457
return benchmark;
4558

46-
function rand() {
47-
if ( bernoulli( 0.8 ) > 0 ) {
48-
return uniform( -10.0, 10.0 );
49-
}
50-
return NaN;
51-
}
52-
5359
function benchmark( b ) {
5460
var v;
5561
var i;

benchmark/benchmark.ndarray.native.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ var opts = {
4141

4242
// FUNCTIONS //
4343

44+
/**
45+
* Returns a random number.
46+
*
47+
* @private
48+
* @returns {number} random number
49+
*/
50+
function rand() {
51+
if ( bernoulli( 0.5 ) < 1 ) {
52+
return uniform( -10.0, 10.0 );
53+
}
54+
return NaN;
55+
}
56+
4457
/**
4558
* Creates a benchmark function.
4659
*
@@ -52,13 +65,6 @@ function createBenchmark( len ) {
5265
var x = filledarrayBy( len, 'float64', rand );
5366
return benchmark;
5467

55-
function rand() {
56-
if ( bernoulli( 0.8 ) > 0 ) {
57-
return uniform( -10.0, 10.0 );
58-
}
59-
return NaN;
60-
}
61-
6268
function benchmark( b ) {
6369
var v;
6470
var i;

0 commit comments

Comments
 (0)