Skip to content

Commit de798dd

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

File tree

12 files changed

+35
-43
lines changed

12 files changed

+35
-43
lines changed

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

Lines changed: 6 additions & 6 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 in the strided array are accessed at runtime. For example, to compute the sum of every other element in the strided array:
61+
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:
6262

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

148148
function rand() {
149-
if ( bernoulli( 0.7 ) > 0 ) {
149+
if ( bernoulli( 0.5 ) < 1 ) {
150150
return discreteUniform( 0, 100 );
151151
}
152152
return NaN;
@@ -208,7 +208,7 @@ The function accepts the following arguments:
208208
209209
- **N**: `[in] CBLAS_INT` number of indexed elements.
210210
- **X**: `[in] double*` input array.
211-
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
211+
- **strideX**: `[in] CBLAS_INT` stride length.
212212
- **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements.
213213
214214
```c
@@ -223,7 +223,7 @@ Computes the sum of double-precision floating-point strided array elements, igno
223223
#include "stdlib/blas/base/shared.h"
224224

225225
const double x[] = { 1.0, 2.0, 0.0/0.0, 4.0 };
226-
CBLAS_INT n = 0;
226+
CBLAS_INT n = 0;
227227

228228
double v = stdlib_strided_dnannsum_ndarray( 4, x, 1, 0, &n );
229229
// returns 7.0
@@ -233,8 +233,8 @@ The function accepts the following arguments:
233233
234234
- **N**: `[in] CBLAS_INT` number of indexed elements.
235235
- **X**: `[in] double*` input array.
236-
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
237-
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
236+
- **strideX**: `[in] CBLAS_INT` stride length.
237+
- **offsetX**: `[in] CBLAS_INT` starting index.
238238
- **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements.
239239
240240
```c

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var dnannsum = require( './../lib/dnannsum.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, 10 );
4545
}
4646
return NaN;

lib/node_modules/@stdlib/blas/ext/base/dnannsum/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.7 ) > 0 ) {
52+
if ( bernoulli( 0.5 ) < 1 ) {
5353
return discreteUniform( -10, 10 );
5454
}
5555
return NaN;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var dnannsum = require( './../lib/ndarray.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, 10 );
4545
}
4646
return NaN;

lib/node_modules/@stdlib/blas/ext/base/dnannsum/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.7 ) > 0 ) {
52+
if ( bernoulli( 0.5 ) < 1 ) {
5353
return discreteUniform( -10, 10 );
5454
}
5555
return NaN;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
ignoring `NaN` values and using alternative indexing semantics.
6262

6363
While typed array views mandate a view offset based on the underlying
64-
buffer, the offset parameters support indexing semantics based on
65-
starting indices.
64+
buffer, the offset parameters support indexing semantics based on starting
65+
indices.
6666

6767
Parameters
6868
----------

lib/node_modules/@stdlib/blas/ext/base/dnannsum/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/dnannsum/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 dnannsum = require( './../lib' );
2626

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

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ var ndarray = require( './ndarray.js' );
3131
*
3232
* @param {PositiveInteger} N - number of indexed elements
3333
* @param {Float64Array} x - input array
34-
* @param {integer} strideX - `x` stride length
34+
* @param {integer} strideX - stride length for `x`
3535
* @param {Float64Array} out - output array
36-
* @param {integer} strideOut - `out` stride length
36+
* @param {integer} strideOut - stride length for `out`
3737
* @returns {Float64Array} output array
3838
*
3939
* @example
@@ -46,12 +46,7 @@ var ndarray = require( './ndarray.js' );
4646
* // returns <Float64Array>[ 1.0, 3 ]
4747
*/
4848
function dnannsum( N, x, strideX, out, strideOut ) {
49-
var ix;
50-
var io;
51-
52-
ix = stride2offset( N, strideX );
53-
io = stride2offset( 2, strideOut );
54-
return ndarray( N, x, strideX, ix, out, strideOut, io );
49+
return ndarray( N, x, strideX, stride2offset( N, strideX ), out, strideOut, stride2offset( 2, strideOut ) ); // eslint-disable-line max-len
5550
}
5651

5752

lib/node_modules/@stdlib/blas/ext/base/dnannsum/lib/dnannsum.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)