From 50d2990ecd91a6e88390bcd0a7d23df22565b499 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:57:14 +0000 Subject: [PATCH] Update artifacts --- blas/ext/base/dnansumkbn/coverage.ndjson | 1 + blas/ext/base/dnansumkbn/dnansumkbn.js.html | 376 ++++++++++++++++++ .../base/dnansumkbn/dnansumkbn.native.js.html | 241 +++++++++++ blas/ext/base/dnansumkbn/index.html | 206 ++++++++++ blas/ext/base/dnansumkbn/index.js.html | 289 ++++++++++++++ blas/ext/base/dnansumkbn/main.js.html | 190 +++++++++ blas/ext/base/dnansumkbn/native.js.html | 190 +++++++++ blas/ext/base/dnansumkbn/ndarray.js.html | 364 +++++++++++++++++ .../base/dnansumkbn/ndarray.native.js.html | 265 ++++++++++++ 9 files changed, 2122 insertions(+) create mode 100644 blas/ext/base/dnansumkbn/coverage.ndjson create mode 100644 blas/ext/base/dnansumkbn/dnansumkbn.js.html create mode 100644 blas/ext/base/dnansumkbn/dnansumkbn.native.js.html create mode 100644 blas/ext/base/dnansumkbn/index.html create mode 100644 blas/ext/base/dnansumkbn/index.js.html create mode 100644 blas/ext/base/dnansumkbn/main.js.html create mode 100644 blas/ext/base/dnansumkbn/native.js.html create mode 100644 blas/ext/base/dnansumkbn/ndarray.js.html create mode 100644 blas/ext/base/dnansumkbn/ndarray.native.js.html diff --git a/blas/ext/base/dnansumkbn/coverage.ndjson b/blas/ext/base/dnansumkbn/coverage.ndjson new file mode 100644 index 000000000..9487d112a --- /dev/null +++ b/blas/ext/base/dnansumkbn/coverage.ndjson @@ -0,0 +1 @@ +[440,440,100,40,40,100,4,4,100,440,440,100,"a9016c65a013cbabcf819c0733c05c59618d198c","2024-03-26 08:55:12 -0400"] diff --git a/blas/ext/base/dnansumkbn/dnansumkbn.js.html b/blas/ext/base/dnansumkbn/dnansumkbn.js.html new file mode 100644 index 000000000..6e12d08fe --- /dev/null +++ b/blas/ext/base/dnansumkbn/dnansumkbn.js.html @@ -0,0 +1,376 @@ + + + + +
++ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +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 +98 | 2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +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 + | /** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var abs = require( '@stdlib/math/base/special/abs' ); + + +// MAIN // + +/** +* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. +* +* ## Method +* +* - This implementation uses an "improved Kahan–Babuška algorithm", as described by Neumaier (1974). +* +* ## References +* +* - Neumaier, Arnold. 1974. "Rounding Error Analysis of Some Methods for Summing Finite Sums." _Zeitschrift Für Angewandte Mathematik Und Mechanik_ 54 (1): 39–51. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106). +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} stride - 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 ); +* // 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; +} + + +// EXPORTS // + +module.exports = dnansumkbn; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 | 3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +55x +55x +55x +3x +3x +3x +3x +3x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} stride - 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 ); +* // returns 1.0 +*/ +function dnansumkbn( N, x, stride ) { + return addon( N, x, stride ); +} + + +// EXPORTS // + +module.exports = dnansumkbn; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
---|---|---|---|---|---|---|---|---|---|
dnansumkbn.js | +
+
+ |
+ 100% | +97/97 | +100% | +17/17 | +100% | +1/1 | +100% | +97/97 | +
dnansumkbn.native.js | +
+
+ |
+ 100% | +52/52 | +100% | +2/2 | +100% | +1/1 | +100% | +52/52 | +
index.js | +
+
+ |
+ 100% | +68/68 | +100% | +3/3 | +100% | +0/0 | +100% | +68/68 | +
main.js | +
+
+ |
+ 100% | +35/35 | +100% | +1/1 | +100% | +0/0 | +100% | +35/35 | +
native.js | +
+
+ |
+ 100% | +35/35 | +100% | +1/1 | +100% | +0/0 | +100% | +35/35 | +
ndarray.js | +
+
+ |
+ 100% | +93/93 | +100% | +14/14 | +100% | +1/1 | +100% | +93/93 | +
ndarray.native.js | +
+
+ |
+ 100% | +60/60 | +100% | +2/2 | +100% | +1/1 | +100% | +60/60 | +
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 | 3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +3x +2x +2x +3x +3x +3x +3x +3x +3x +3x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. +* +* @module @stdlib/blas/ext/base/dnansumkbn +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' ); +* +* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); +* +* var v = dnansumkbn( 4, x, 1 ); +* // returns 1.0 +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' ); +* +* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] ); +* +* var v = dnansumkbn.ndarray( 5, x, 2, 1 ); +* // returns 5.0 +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var dnansumkbn; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dnansumkbn = main; +} else { + dnansumkbn = tmp; +} + + +// EXPORTS // + +module.exports = dnansumkbn; + +// exports: { "ndarray": "dnansumkbn.ndarray" } + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 | 1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dnansumkbn = require( './dnansumkbn.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dnansumkbn, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dnansumkbn; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 | 1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dnansumkbn = require( './dnansumkbn.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( dnansumkbn, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dnansumkbn; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +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 | 2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +15x +15x +15x +15x +15x +15x +15x +15x +15x +2x +2x +15x +4x +1x +1x +3x +3x +9x +9x +9x +15x +42x +42x +34x +34x +13x +34x +21x +21x +34x +34x +42x +42x +9x +15x +2x +2x +2x +2x +2x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var abs = require( '@stdlib/math/base/special/abs' ); + + +// MAIN // + +/** +* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. +* +* ## Method +* +* - This implementation uses an "improved Kahan–Babuška algorithm", as described by Neumaier (1974). +* +* ## References +* +* - Neumaier, Arnold. 1974. "Rounding Error Analysis of Some Methods for Summing Finite Sums." _Zeitschrift Für Angewandte Mathematik Und Mechanik_ 54 (1): 39–51. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106). +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - starting index +* @returns {number} sum +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] ); +* +* var v = dnansumkbn( 5, x, 2, 1 ); +* // returns 5.0 +*/ +function dnansumkbn( N, x, stride, offset ) { + 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[ offset ] ) ) { + return 0.0; + } + return x[ offset ]; + } + ix = offset; + 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; +} + + +// EXPORTS // + +module.exports = dnansumkbn; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 | 2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +15x +15x +15x +15x +15x +15x +15x +15x +15x +2x +2x +2x +2x +2x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); +var offsetView = require( '@stdlib/strided/base/offset-view' ); +var addon = require( './dnansumkbn.native.js' ); + + +// MAIN // + +/** +* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - starting index +* @returns {number} sum +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] ); +* +* var v = dnansumkbn( 5, x, 2, 1 ); +* // returns 5.0 +*/ +function dnansumkbn( N, x, stride, offset ) { + var view; + + offset = minViewBufferIndex( N, stride, offset ); + + view = offsetView( x, offset ); + + return addon( N, view, stride ); +} + + +// EXPORTS // + +module.exports = dnansumkbn; + |