Skip to content

Commit b7ea8c0

Browse files
headlessNodeShabiShett07
authored andcommitted
docs: update blas/ext/base/dnannsumkbn2 to follow current project conventions
PR-URL: stdlib-js#5188 Reviewed-by: Philipp Burckhardt <[email protected]>
1 parent 57e140e commit b7ea8c0

File tree

12 files changed

+36
-41
lines changed

12 files changed

+36
-41
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The function has the following parameters:
5858
- **out**: output [`Float64Array`][@stdlib/array/float64] whose first element is the sum and whose second element is the number of non-NaN elements.
5959
- **strideOut**: stride length for `out`.
6060

61-
The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element in `x`,
61+
The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element:
6262

6363
```javascript
6464
var Float64Array = require( '@stdlib/array/float64' );
@@ -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 element starting from the second element:
109+
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 sum of every other element starting from the second element:
110110

111111
```javascript
112112
var Float64Array = require( '@stdlib/array/float64' );
@@ -146,7 +146,7 @@ var Float64Array = require( '@stdlib/array/float64' );
146146
var dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' );
147147

148148
function rand() {
149-
if ( bernoulli( 0.8 ) > 0 ) {
149+
if ( bernoulli( 0.5 ) < 1 ) {
150150
return discreteUniform( 0, 100 );
151151
}
152152
return NaN;
@@ -206,7 +206,7 @@ The function accepts the following arguments:
206206
207207
- **N**: `[in] CBLAS_INT` number of indexed elements.
208208
- **X**: `[in] double*` input array.
209-
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
209+
- **strideX**: `[in] CBLAS_INT` stride length.
210210
- **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements.
211211
212212
```c
@@ -219,7 +219,7 @@ Computes the sum of double-precision floating-point strided array elements, igno
219219

220220
```c
221221
const double x[] = { 1.0, 2.0, 0.0/0.0, 4.0 };
222-
CBLAS_INT n = 0;
222+
CBLAS_INT n = 0;
223223

224224
double v = stdlib_strided_dnannsumkbn2_ndarray( 4, x, 1, 0, &n );
225225
// returns 7.0
@@ -229,8 +229,8 @@ The function accepts the following arguments:
229229
230230
- **N**: `[in] CBLAS_INT` number of indexed elements.
231231
- **X**: `[in] double*` input array.
232-
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
233-
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
232+
- **strideX**: `[in] CBLAS_INT` stride length.
233+
- **offsetX**: `[in] CBLAS_INT` starting index.
234234
- **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements.
235235
236236
```c

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var dnannsumkbn2 = require( './../lib/dnannsumkbn2.js' );
4040
* @returns {number} random number
4141
*/
4242
function rand() {
43-
if ( bernoulli( 0.7 ) > 0 ) {
43+
if ( bernoulli( 0.5 ) < 1 ) {
4444
return discreteUniform( -10.0, 10.0 );
4545
}
4646
return NaN;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var opts = {
4949
* @returns {number} random number
5050
*/
5151
function rand() {
52-
if ( bernoulli( 0.8 ) > 0 ) {
52+
if ( bernoulli( 0.5 ) < 1 ) {
5353
return discreteUniform( -10.0, 10.0 );
5454
}
5555
return NaN;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var dnannsumkbn2 = require( './../lib/ndarray.js' );
4040
* @returns {number} random number
4141
*/
4242
function rand() {
43-
if ( bernoulli( 0.8 ) > 0 ) {
43+
if ( bernoulli( 0.5 ) < 1 ) {
4444
return discreteUniform( -10.0, 10.0 );
4545
}
4646
return NaN;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var opts = {
4949
* @returns {number} random number
5050
*/
5151
function rand() {
52-
if ( bernoulli( 0.8 ) > 0 ) {
52+
if ( bernoulli( 0.5 ) < 1 ) {
5353
return discreteUniform( -10.0, 10.0 );
5454
}
5555
return NaN;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
ignoring `NaN` values and using a second-order iterative Kahan–Babuška
55
algorithm.
66

7-
The `N` and stride parameters determine which elements in the strided
8-
array are accessed at runtime.
7+
The `N` and stride parameters determine which elements in the strided array
8+
are accessed at runtime.
99

1010
Indexing is relative to the first index. To introduce an offset, use a typed
1111
array view.
@@ -63,7 +63,7 @@
6363
algorithm and alternative indexing semantics.
6464

6565
While typed array views mandate a view offset based on the underlying
66-
buffer, offset parameters support indexing semantics based on starting
66+
buffer, the offset parameters support indexing semantics based on starting
6767
indices.
6868

6969
Parameters

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/docs/types/index.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ interface Routine {
2727
*
2828
* @param N - number of indexed elements
2929
* @param x - input array
30-
* @param strideX - `x` stride length
30+
* @param strideX - stride length for `x`
3131
* @param out - output array whose first element is the sum and whose second element is the number of non-NaN elements
32-
* @param strideOut - `out` stride length
32+
* @param strideOut - stride length for `out`
3333
* @returns output array
3434
*
3535
* @example
@@ -48,11 +48,11 @@ interface Routine {
4848
*
4949
* @param N - number of indexed elements
5050
* @param x - input array
51-
* @param strideX - `x` stride length
52-
* @param offsetX - `x` starting index
51+
* @param strideX - stride length for `x`
52+
* @param offsetX - starting index for `x`
5353
* @param out - output array whose first element is the sum and whose second element is the number of non-NaN elements
54-
* @param strideOut - `out` stride length
55-
* @param offsetOut - `out` starting index
54+
* @param strideOut - stride length for `out`
55+
* @param offsetOut - starting index for `out`
5656
* @returns output array
5757
*
5858
* @example
@@ -72,9 +72,9 @@ interface Routine {
7272
*
7373
* @param N - number of indexed elements
7474
* @param x - input array
75-
* @param strideX - `x` stride length
75+
* @param strideX - stride length for `x`
7676
* @param out - output array whose first element is the sum and whose second element is the number of non-NaN elements
77-
* @param strideOut - `out` stride length
77+
* @param strideOut - stride length for `out`
7878
* @returns output array
7979
*
8080
* @example

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var Float64Array = require( '@stdlib/array/float64' );
2525
var dnannsumkbn2 = require( './../lib' );
2626

2727
function rand() {
28-
if ( bernoulli( 0.8 ) > 0 ) {
28+
if ( bernoulli( 0.5 ) < 1 ) {
2929
return discreteUniform( 0, 100 );
3030
}
3131
return NaN;

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/lib/dnannsumkbn2.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ var ndarray = require( './ndarray.js' );
3939
*
4040
* @param {PositiveInteger} N - number of indexed elements
4141
* @param {Float64Array} x - input array
42-
* @param {integer} strideX - `x` stride length
42+
* @param {integer} strideX - stride length for `x`
4343
* @param {Float64Array} out - output array
44-
* @param {integer} strideOut - `out` stride length
44+
* @param {integer} strideOut - stride length for `out`
4545
* @returns {Float64Array} output array
4646
*
4747
* @example
@@ -54,12 +54,7 @@ var ndarray = require( './ndarray.js' );
5454
* // returns <Float64Array>[ 1.0, 3 ]
5555
*/
5656
function dnannsumkbn2( N, x, strideX, out, strideOut ) {
57-
var ix;
58-
var io;
59-
60-
ix = stride2offset( N, strideX );
61-
io = stride2offset( 2, strideOut );
62-
return ndarray( N, x, strideX, ix, out, strideOut, io );
57+
return ndarray( N, x, strideX, stride2offset( N, strideX ), out, strideOut, stride2offset( 2, strideOut ) ); // eslint-disable-line max-len
6358
}
6459

6560

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/lib/dnannsumkbn2.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ var addon = require( './../src/addon.node' );
3030
*
3131
* @param {PositiveInteger} N - number of indexed elements
3232
* @param {Float64Array} x - input array
33-
* @param {integer} strideX - `x` stride length
33+
* @param {integer} strideX - stride length for `x`
3434
* @param {Float64Array} out - output array
35-
* @param {integer} strideOut - `out` stride length
35+
* @param {integer} strideOut - stride length for `out`
3636
* @returns {Float64Array} output array
3737
*
3838
* @example

0 commit comments

Comments
 (0)