Skip to content

Commit 8e5b82c

Browse files
authored
docs: update blas/ext/base/dnannsumors to follow current project conventions
PR-URL: #5189 Reviewed-by: Philipp Burckhardt <[email protected]>
1 parent 6f8225e commit 8e5b82c

File tree

12 files changed

+34
-43
lines changed

12 files changed

+34
-43
lines changed

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

+7-7
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' );
@@ -148,7 +148,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' );
148148
var dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' );
149149

150150
function rand() {
151-
if ( bernoulli( 0.8 ) > 0 ) {
151+
if ( bernoulli( 0.5 ) < 1 ) {
152152
return discreteUniform( 0, 100 );
153153
}
154154
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
@@ -221,7 +221,7 @@ Computes the sum of double-precision floating-point strided array elements, igno
221221

222222
```c
223223
const double x[] = { 1.0, 2.0, 0.0/0.0, 4.0 };
224-
CBLAS_INT n = 0;
224+
CBLAS_INT n = 0;
225225

226226
double v = stdlib_strided_dnannsumors_ndarray( 4, x, 1, 0, &n );
227227
// returns 7.0
@@ -231,8 +231,8 @@ The function accepts the following arguments:
231231
232232
- **N**: `[in] CBLAS_INT` number of indexed elements.
233233
- **X**: `[in] double*` input array.
234-
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
235-
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
234+
- **strideX**: `[in] CBLAS_INT` stride length.
235+
- **offsetX**: `[in] CBLAS_INT` starting index.
236236
- **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements.
237237
238238
```c

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var dnannsumors = require( './../lib/dnannsumors.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/dnannsumors/benchmark/benchmark.native.js

+1-1
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/dnannsumors/benchmark/benchmark.ndarray.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var dnannsumors = 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/dnannsumors/benchmark/benchmark.ndarray.native.js

+1-1
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/dnannsumors/docs/repl.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
indexing 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/dnannsumors/docs/types/index.d.ts

+8-8
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/dnannsumors/examples/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' );
2626
var dnannsumors = require( './../lib' );
2727

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

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

+3-12
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,16 +46,7 @@ var ndarray = require( './ndarray.js' );
4646
* // returns <Float64Array>[ 1.0, 3 ]
4747
*/
4848
function dnannsumors( N, x, strideX, out, strideOut ) {
49-
var ix;
50-
var io;
51-
52-
ix = stride2offset( N, strideX );
53-
if ( strideOut < 0 ) {
54-
io = -strideOut;
55-
} else {
56-
io = 0;
57-
}
58-
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
5950
}
6051

6152

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

+2-2
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

lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
3030
*
3131
* @param {PositiveInteger} N - number of indexed elements
3232
* @param {Float64Array} x - input array
33-
* @param {integer} strideX - `x` stride length
34-
* @param {NonNegativeInteger} offsetX - `x` starting index
33+
* @param {integer} strideX - stride length for `x`
34+
* @param {NonNegativeInteger} offsetX - starting index for `x`
3535
* @param {Float64Array} out - output array
36-
* @param {integer} strideOut - `out` stride length
37-
* @param {NonNegativeInteger} offsetOut - `out` starting index
36+
* @param {integer} strideOut - stride length for `out`
37+
* @param {NonNegativeInteger} offsetOut - starting index for `out`
3838
* @returns {Float64Array} output array
3939
*
4040
* @example

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ 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
34-
* @param {NonNegativeInteger} offsetX - `x` starting index
33+
* @param {integer} strideX - stride length for `x`
34+
* @param {NonNegativeInteger} offsetX - starting index for `x`
3535
* @param {Float64Array} out - output array
36-
* @param {integer} strideOut - `out` stride length
37-
* @param {NonNegativeInteger} offsetOut - `out` starting index
36+
* @param {integer} strideOut - stride length for `out`
37+
* @param {NonNegativeInteger} offsetOut - starting index for `out`
3838
* @returns {Float64Array} output array
3939
*
4040
* @example

0 commit comments

Comments
 (0)