Skip to content

Commit 858ab0a

Browse files
authored
docs: update blas/ext/base/dnannsumpw to follow current project conventions
PR-URL: stdlib-js#5190 Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
1 parent 8171728 commit 858ab0a

File tree

13 files changed

+39
-47
lines changed

13 files changed

+39
-47
lines changed

lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/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 the strided array,
61+
The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element in the strided array:
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' );
@@ -147,7 +147,7 @@ var Float64Array = require( '@stdlib/array/float64' );
147147
var dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' );
148148

149149
function rand() {
150-
if ( bernoulli( 0.8 ) > 0 ) {
150+
if ( bernoulli( 0.5 ) < 1 ) {
151151
return discreteUniform( 0, 100 );
152152
}
153153
return NaN;
@@ -209,7 +209,7 @@ The function accepts the following arguments:
209209
210210
- **N**: `[in] CBLAS_INT` number of indexed elements.
211211
- **X**: `[in] double*` input array.
212-
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
212+
- **strideX**: `[in] CBLAS_INT` stride length.
213213
- **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements.
214214
215215
```c
@@ -224,7 +224,7 @@ Computes the sum of double-precision floating-point strided array elements, igno
224224
#include "stdlib/blas/base/shared.h"
225225

226226
const double x[] = { 1.0, 2.0, 0.0/0.0, 4.0 };
227-
CBLAS_INT n = 0;
227+
CBLAS_INT n = 0;
228228

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

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

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

lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/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 uniform( -10.0, 10.0 );
5454
}
5555
return NaN;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var dnannsumpw = 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 uniform( -10.0, 10.0 );
4545
}
4646
return NaN;

lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/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 uniform( -10.0, 10.0 );
5454
}
5555
return NaN;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
semantics.
6363

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

6868
Parameters

lib/node_modules/@stdlib/blas/ext/base/dnannsumpw/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/dnannsumpw/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 dnannsumpw = 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/dnannsumpw/lib/dnannsumpw.js

Lines changed: 3 additions & 10 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,14 +54,7 @@ var ndarray = require( './ndarray.js' );
5454
* // returns <Float64Array>[ 1.0, 3 ]
5555
*/
5656
function dnannsumpw( N, x, strideX, out, strideOut ) {
57-
var ix;
58-
var io;
59-
60-
ix = stride2offset( N, strideX );
61-
io = stride2offset( 2, strideOut );
62-
out[ io ] = 0.0;
63-
out[ io+strideOut ] = 0;
64-
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
6558
}
6659

6760

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