Skip to content

Commit e5f1b44

Browse files
committed
chore: add review suggestion
1 parent 0da2404 commit e5f1b44

File tree

7 files changed

+56
-32
lines changed

7 files changed

+56
-32
lines changed

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ The function has the following additional parameters:
106106
- **offsetX**: starting index for `x`.
107107
- **offsetOut**: starting index for `out`.
108108

109-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the sum of every other value in `x` starting from the second value:
109+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the sum of every other element starting from the second element:
110110

111111
```javascript
112112
var Float64Array = require( '@stdlib/array/float64' );

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.js

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

3434
// FUNCTIONS //
3535

36+
/**
37+
* Returns a random number.
38+
*
39+
* @private
40+
* @returns {number} random number
41+
*/
42+
function rand() {
43+
if ( bernoulli( 0.7 ) > 0 ) {
44+
return discreteUniform( -10.0, 10.0 );
45+
}
46+
return NaN;
47+
}
48+
3649
/**
3750
* Creates a benchmark function.
3851
*
@@ -46,12 +59,6 @@ function createBenchmark( len ) {
4659
out = new Float64Array( 2 );
4760
return benchmark;
4861

49-
function rand() {
50-
if ( bernoulli( 0.7 ) > 0 ) {
51-
return discreteUniform( -10, 10 );
52-
}
53-
}
54-
5562
function benchmark( b ) {
5663
var i;
5764

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.native.js

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

4343
// FUNCTIONS //
4444

45+
/**
46+
* Returns a random number.
47+
*
48+
* @private
49+
* @returns {number} random number
50+
*/
51+
function rand() {
52+
if ( bernoulli( 0.7 ) > 0 ) {
53+
return discreteUniform( -10.0, 10.0 );
54+
}
55+
return NaN;
56+
}
57+
4558
/**
4659
* Creates a benchmark function.
4760
*
@@ -55,13 +68,6 @@ function createBenchmark( len ) {
5568
out = new Float64Array( 2 );
5669
return benchmark;
5770

58-
function rand() {
59-
if ( bernoulli( 0.7 ) > 0 ) {
60-
return discreteUniform( -10, 10 );
61-
}
62-
return NaN;
63-
}
64-
6571
function benchmark( b ) {
6672
var i;
6773

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.js

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

3434
// FUNCTIONS //
3535

36+
/**
37+
* Returns a random number.
38+
*
39+
* @private
40+
* @returns {number} random number
41+
*/
42+
function rand() {
43+
if ( bernoulli( 0.7 ) > 0 ) {
44+
return discreteUniform( -10.0, 10.0 );
45+
}
46+
return NaN;
47+
}
48+
3649
/**
3750
* Creates a benchmark function.
3851
*
@@ -46,13 +59,6 @@ function createBenchmark( len ) {
4659
out = new Float64Array( 2 );
4760
return benchmark;
4861

49-
function rand() {
50-
if ( bernoulli( 0.7 ) > 0 ) {
51-
return discreteUniform( -10, 10 );
52-
}
53-
return NaN;
54-
}
55-
5662
function benchmark( b ) {
5763
var i;
5864

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/benchmark/benchmark.ndarray.native.js

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

4343
// FUNCTIONS //
4444

45+
/**
46+
* Returns a random number.
47+
*
48+
* @private
49+
* @returns {number} random number
50+
*/
51+
function rand() {
52+
if ( bernoulli( 0.7 ) > 0 ) {
53+
return discreteUniform( -10.0, 10.0 );
54+
}
55+
return NaN;
56+
}
57+
4558
/**
4659
* Creates a benchmark function.
4760
*
@@ -55,13 +68,6 @@ function createBenchmark( len ) {
5568
out = new Float64Array( 2 );
5669
return benchmark;
5770

58-
function rand() {
59-
if ( bernoulli( 0.7 ) > 0 ) {
60-
return discreteUniform( -10, 10 );
61-
}
62-
return NaN;
63-
}
64-
6571
function benchmark( b ) {
6672
var i;
6773

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/docs/repl.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
> {{alias}}( x.length, x, 1, out, 1 )
4343
<Float64Array>[ 1.0, 3 ]
4444

45-
// Using `N` and `stride` parameters:
45+
// Using `N` and stride parameters:
4646
> x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN, NaN ] );
4747
> out = new {{alias:@stdlib/array/float64}}( 2 );
4848
> {{alias}}( 4, x, 2, out, 1 )
@@ -99,7 +99,7 @@
9999
// Standard Usage:
100100
> var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, NaN, 2.0 ] );
101101
> var out = new {{alias:@stdlib/array/float64}}( 2 );
102-
> {{alias}}.ndarray( x.length, x, 1, 0, out, 1, 0 )
102+
> {{alias}}.ndarray( 4, x, 1, 0, out, 1, 0 )
103103
<Float64Array>[ 1.0, 3 ]
104104

105105
// Using offset parameter:

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/src/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,8 @@ double API_SUFFIX(stdlib_strided_dnannsumkbn_ndarray)( const CBLAS_INT N, const
8080
if ( stdlib_base_is_nan( X[ ix ] ) ) {
8181
return sum;
8282
}
83-
sum = X[ ix ] * N;
8483
*n += N;
85-
return sum;
84+
return X[ ix ] * N;
8685
}
8786
c = 0.0;
8887
for ( i = 0; i < N; i++ ) {

0 commit comments

Comments
 (0)