diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/README.md b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/README.md index 7a45f3b68821..65de33ac5618 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/README.md @@ -58,7 +58,7 @@ The function has the following parameters: - **out**: output [`Float64Array`][@stdlib/array/float64] whose first element is the sum and whose second element is the number of non-NaN elements. - **strideOut**: stride length for `out`. -The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element in `x`, +The `N` and stride parameters determine which elements are accessed at runtime. For example, to compute the sum of every other element: ```javascript var Float64Array = require( '@stdlib/array/float64' ); @@ -106,7 +106,7 @@ The function has the following additional parameters: - **offsetX**: starting index for `x`. - **offsetOut**: starting index for `out`. -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: +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: ```javascript var Float64Array = require( '@stdlib/array/float64' ); @@ -148,7 +148,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' ); function rand() { - if ( bernoulli( 0.8 ) > 0 ) { + if ( bernoulli( 0.5 ) < 1 ) { return discreteUniform( 0, 100 ); } return NaN; @@ -208,7 +208,7 @@ The function accepts the following arguments: - **N**: `[in] CBLAS_INT` number of indexed elements. - **X**: `[in] double*` input array. -- **strideX**: `[in] CBLAS_INT` stride length for `X`. +- **strideX**: `[in] CBLAS_INT` stride length. - **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements. ```c @@ -221,7 +221,7 @@ Computes the sum of double-precision floating-point strided array elements, igno ```c const double x[] = { 1.0, 2.0, 0.0/0.0, 4.0 }; -CBLAS_INT n = 0; +CBLAS_INT n = 0; double v = stdlib_strided_dnannsumors_ndarray( 4, x, 1, 0, &n ); // returns 7.0 @@ -231,8 +231,8 @@ The function accepts the following arguments: - **N**: `[in] CBLAS_INT` number of indexed elements. - **X**: `[in] double*` input array. -- **strideX**: `[in] CBLAS_INT` stride length for `X`. -- **offsetX**: `[in] CBLAS_INT` starting index for `X`. +- **strideX**: `[in] CBLAS_INT` stride length. +- **offsetX**: `[in] CBLAS_INT` starting index. - **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements. ```c diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.js index 4d2257a7a65e..0b2ca9b38c86 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.js @@ -40,7 +40,7 @@ var dnannsumors = require( './../lib/dnannsumors.js' ); * @returns {number} random number */ function rand() { - if ( bernoulli( 0.8 ) > 0 ) { + if ( bernoulli( 0.5 ) < 1 ) { return uniform( -10.0, 10.0 ); } return NaN; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.native.js index f84ba3760bff..cece790d10e6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.native.js @@ -49,7 +49,7 @@ var opts = { * @returns {number} random number */ function rand() { - if ( bernoulli( 0.8 ) > 0 ) { + if ( bernoulli( 0.5 ) < 1 ) { return uniform( -10.0, 10.0 ); } return NaN; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.js index 4fc746c4e269..d419d0358e99 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.js @@ -40,7 +40,7 @@ var dnannsumors = require( './../lib/ndarray.js' ); * @returns {number} random number */ function rand() { - if ( bernoulli( 0.8 ) > 0 ) { + if ( bernoulli( 0.5 ) < 1 ) { return uniform( -10.0, 10.0 ); } return NaN; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.native.js index 641de067a529..1266676df811 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/benchmark/benchmark.ndarray.native.js @@ -49,7 +49,7 @@ var opts = { * @returns {number} random number */ function rand() { - if ( bernoulli( 0.8 ) > 0 ) { + if ( bernoulli( 0.5 ) < 1 ) { return uniform( -10.0, 10.0 ); } return NaN; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/docs/repl.txt index 70761fb274be..1007728e2513 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/docs/repl.txt @@ -62,7 +62,7 @@ indexing semantics. While typed array views mandate a view offset based on the underlying - buffer, offset parameters support indexing semantics based on starting + buffer, the offset parameters support indexing semantics based on starting indices. Parameters diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/docs/types/index.d.ts index e1d81121a671..326ad5e2ac6a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/docs/types/index.d.ts @@ -27,9 +27,9 @@ interface Routine { * * @param N - number of indexed elements * @param x - input array - * @param strideX - `x` stride length + * @param strideX - stride length for `x` * @param out - output array whose first element is the sum and whose second element is the number of non-NaN elements - * @param strideOut - `out` stride length + * @param strideOut - stride length for `out` * @returns output array * * @example @@ -48,11 +48,11 @@ interface Routine { * * @param N - number of indexed elements * @param x - input array - * @param strideX - `x` stride length - * @param offsetX - `x` starting index + * @param strideX - stride length for `x` + * @param offsetX - starting index for `x` * @param out - output array whose first element is the sum and whose second element is the number of non-NaN elements - * @param strideOut - `out` stride length - * @param offsetOut - `out` starting index + * @param strideOut - stride length for `out` + * @param offsetOut - starting index for `out` * @returns output array * * @example @@ -72,9 +72,9 @@ interface Routine { * * @param N - number of indexed elements * @param x - input array -* @param strideX - `x` stride length +* @param strideX - stride length for `x` * @param out - output array whose first element is the sum and whose second element is the number of non-NaN elements -* @param strideOut - `out` stride length +* @param strideOut - stride length for `out` * @returns output array * * @example diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/examples/index.js index 3cc9af81ae1c..6a9e0a5d57e7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/examples/index.js @@ -26,7 +26,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var dnannsumors = require( './../lib' ); function rand() { - if ( bernoulli( 0.8 ) > 0 ) { + if ( bernoulli( 0.5 ) < 1 ) { return discreteUniform( 0, 100 ); } return NaN; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/dnannsumors.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/dnannsumors.js index cdd2d9a21076..ed2a41577f6a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/dnannsumors.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/dnannsumors.js @@ -31,9 +31,9 @@ var ndarray = require( './ndarray.js' ); * * @param {PositiveInteger} N - number of indexed elements * @param {Float64Array} x - input array -* @param {integer} strideX - `x` stride length +* @param {integer} strideX - stride length for `x` * @param {Float64Array} out - output array -* @param {integer} strideOut - `out` stride length +* @param {integer} strideOut - stride length for `out` * @returns {Float64Array} output array * * @example @@ -46,16 +46,7 @@ var ndarray = require( './ndarray.js' ); * // returns [ 1.0, 3 ] */ function dnannsumors( N, x, strideX, out, strideOut ) { - var ix; - var io; - - ix = stride2offset( N, strideX ); - if ( strideOut < 0 ) { - io = -strideOut; - } else { - io = 0; - } - return ndarray( N, x, strideX, ix, out, strideOut, io ); + return ndarray( N, x, strideX, stride2offset( N, strideX ), out, strideOut, stride2offset( 2, strideOut ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/dnannsumors.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/dnannsumors.native.js index 5443a3953e41..f766d54bbba5 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/dnannsumors.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/dnannsumors.native.js @@ -30,9 +30,9 @@ var addon = require( './../src/addon.node' ); * * @param {PositiveInteger} N - number of indexed elements * @param {Float64Array} x - input array -* @param {integer} strideX - `x` stride length +* @param {integer} strideX - stride length for `x` * @param {Float64Array} out - output array -* @param {integer} strideOut - `out` stride length +* @param {integer} strideOut - stride length for `out` * @returns {Float64Array} output array * * @example diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.js index 0e9968d27a3a..9fcb3a8f114a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.js @@ -30,11 +30,11 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); * * @param {PositiveInteger} N - number of indexed elements * @param {Float64Array} x - input array -* @param {integer} strideX - `x` stride length -* @param {NonNegativeInteger} offsetX - `x` starting index +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - starting index for `x` * @param {Float64Array} out - output array -* @param {integer} strideOut - `out` stride length -* @param {NonNegativeInteger} offsetOut - `out` starting index +* @param {integer} strideOut - stride length for `out` +* @param {NonNegativeInteger} offsetOut - starting index for `out` * @returns {Float64Array} output array * * @example diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.native.js index 66bbb1bb4b6f..a02b99db2860 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.native.js @@ -30,11 +30,11 @@ var addon = require( './../src/addon.node' ); * * @param {PositiveInteger} N - number of indexed elements * @param {Float64Array} x - input array -* @param {integer} strideX - `x` stride length -* @param {NonNegativeInteger} offsetX - `x` starting index +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - starting index for `x` * @param {Float64Array} out - output array -* @param {integer} strideOut - `out` stride length -* @param {NonNegativeInteger} offsetOut - `out` starting index +* @param {integer} strideOut - stride length for `out` +* @param {NonNegativeInteger} offsetOut - starting index for `out` * @returns {Float64Array} output array * * @example