diff --git a/blas/ext/base/dnansumkbn/coverage.ndjson b/blas/ext/base/dnansumkbn/coverage.ndjson index 3b060f9c0..da734a9ca 100644 --- a/blas/ext/base/dnansumkbn/coverage.ndjson +++ b/blas/ext/base/dnansumkbn/coverage.ndjson @@ -1,2 +1,3 @@ [440,440,100,40,40,100,4,4,100,440,440,100,"a9016c65a013cbabcf819c0733c05c59618d198c","2024-03-26 08:55:12 -0400"] [440,440,100,40,40,100,4,4,100,440,440,100,"3080f032a477cbd046b4201d7ffdd407c9d93816","2024-03-29 11:47:48 -0400"] +[392,394,99.4924,22,23,95.6522,4,4,100,392,394,99.4924,"371a49427e62050eb23947678b66aa529ee3890b","2024-10-29 20:51:13 -0400"] diff --git a/blas/ext/base/dnansumkbn/dnansumkbn.js.html b/blas/ext/base/dnansumkbn/dnansumkbn.js.html index 7a0638af2..b4a9a55c9 100644 --- a/blas/ext/base/dnansumkbn/dnansumkbn.js.html +++ b/blas/ext/base/dnansumkbn/dnansumkbn.js.html @@ -25,14 +25,14 @@

All files / bla
100% Statements - 97/97 + 60/60
100% Branches - 17/17 + 2/2
@@ -46,7 +46,7 @@

All files / bla
100% Lines - 97/97 + 60/60
@@ -123,44 +123,7 @@

All files / bla 58 59 60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -982x +612x 2x 2x 2x @@ -212,48 +175,11 @@

All files / bla 2x 2x 2x -2x -15x -15x -15x -15x -15x -15x 15x 15x 15x 2x 2x -15x -4x -1x -1x -3x -3x -15x -1x -15x -8x -8x -9x -9x -15x -45x -45x -34x -34x -13x -34x -21x -21x -34x -34x -45x -45x -9x -15x -2x -2x 2x 2x 2x @@ -279,8 +205,8 @@

All files / bla   // MODULES //   -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var ndarray = require( './ndarray.js' );     // MAIN // @@ -298,56 +224,19 @@

All files / bla * * @param {PositiveInteger} N - number of indexed elements * @param {Float64Array} x - input array -* @param {integer} stride - stride length +* @param {integer} strideX - stride length * @returns {number} sum * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -* var N = x.length; * -* var v = dnansumkbn( N, x, 1 ); +* var v = dnansumkbn( x.length, x, 1 ); * // returns 1.0 */ -function dnansumkbn( N, x, stride ) { - var sum; - var ix; - var v; - var t; - var c; - var i; -  - if ( N <= 0 ) { - return 0.0; - } - if ( N === 1 || stride === 0 ) { - if ( isnan( x[ 0 ] ) ) { - return 0.0; - } - return x[ 0 ]; - } - if ( stride < 0 ) { - ix = (1-N) * stride; - } else { - ix = 0; - } - sum = 0.0; - c = 0.0; - for ( i = 0; i < N; i++ ) { - v = x[ ix ]; - if ( isnan( v ) === false ) { - t = sum + v; - if ( abs( sum ) >= abs( v ) ) { - c += (sum-t) + v; - } else { - c += (v-t) + sum; - } - sum = t; - } - ix += stride; - } - return sum + c; +function dnansumkbn( N, x, strideX ) { + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); }     @@ -361,7 +250,7 @@

All files / bla