From 8f72f2ba5f9f5effbcb066183f6ec5e71abbbb6a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 19 Aug 2023 14:42:18 +0000 Subject: [PATCH] Auto-generated commit --- .github/.keepalive | 1 - .github/workflows/productionize.yml | 15 --------------- dist/index.d.ts | 3 +++ dist/index.js | 9 +++++++++ dist/index.js.map | 7 +++++++ docs/types/index.d.ts | 2 +- 6 files changed, 20 insertions(+), 17 deletions(-) delete mode 100644 .github/.keepalive create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/index.js.map diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 9663e0b..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-08-01T05:55:00.061Z diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 334eb59..91f2b93 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -82,21 +82,6 @@ jobs: id: transform-error-messages uses: stdlib-js/transform-errors-action@main - # Format error messages: - - name: 'Replace double quotes with single quotes in rewritten format string error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \; - - # Format string literal error messages: - - name: 'Replace double quotes with single quotes in rewritten string literal error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \; - - # Format code: - - name: 'Replace double quotes with single quotes in inserted `require` calls' - run: | - find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \; - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - name: 'Update dependencies in package.json' run: | diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..fbfac3b --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import dnansumkbn from '../docs/types/index'; +export = dnansumkbn; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..ff05641 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,9 @@ +"use strict";var q=function(n,r){return function(){return r||n((r={exports:{}}).exports,r),r.exports}};var b=q(function(D,l){ +var o=require('@stdlib/math-base-assert-is-nan/dist'),c=require('@stdlib/math-base-special-abs/dist');function E(n,r,t){var a,e,u,i,v,s;if(n<=0)return 0;if(n===1||t===0)return o(r[0])?0:r[0];for(t<0?e=(1-n)*t:e=0,a=0,v=0,s=0;s=c(u)?v+=a-i+u:v+=u-i+a,a=i),e+=t;return a+v}l.exports=E +});var y=q(function(F,k){ +var p=require('@stdlib/math-base-assert-is-nan/dist'),d=require('@stdlib/math-base-special-abs/dist');function O(n,r,t,a){var e,u,i,v,s,f;if(n<=0)return 0;if(n===1||t===0)return p(r[a])?0:r[a];for(u=a,e=0,s=0,f=0;f=d(i)?s+=e-v+i:s+=i-v+e,e=v),u+=t;return e+s}k.exports=O +});var R=q(function(G,x){ +var g=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),j=b(),h=y();g(j,"ndarray",h);x.exports=j +});var w=require("path").join,z=require('@stdlib/utils-try-require/dist'),A=require('@stdlib/assert-is-error/dist'),B=R(),m,_=z(w(__dirname,"./native.js"));A(_)?m=B:m=_;module.exports=m; +/** @license Apache-2.0 */ +//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..96d2a01 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../lib/dnansumkbn.js", "../lib/ndarray.js", "../lib/main.js", "../lib/index.js"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar abs = require( '@stdlib/math-base-special-abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar abs = require( '@stdlib/math-base-special-abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var floor = require( '@stdlib/math-base-special-floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar dnansumkbn = require( './dnansumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas-ext-base-dnansumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var dnansumkbn = require( '@stdlib/blas-ext-base-dnansumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var floor = require( '@stdlib/math-base-special-floor' );\n* var dnansumkbn = require( '@stdlib/blas-ext-base-dnansumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils-try-require' );\nvar isError = require( '@stdlib/assert-is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansumkbn = main;\n} else {\n\tdnansumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n\n// exports: { \"ndarray\": \"dnansumkbn.ndarray\" }\n"], + "mappings": "uGAAA,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IG,EAAKD,EAEfE,GAAMF,EAAEC,EAAKH,EAEdA,EAAMG,GAEPF,GAAMH,EAEP,OAAOE,EAAMI,CACd,CAKAZ,EAAO,QAAUG,IC9FjB,IAAAW,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAa,IACbC,EAAU,IAKdF,EAAaC,EAAY,UAAWC,CAAQ,EAK5CH,EAAO,QAAUE,ICejB,IAAIE,EAAO,QAAS,MAAO,EAAE,KACzBC,EAAa,QAAS,2BAA4B,EAClDC,EAAU,QAAS,yBAA0B,EAC7CC,EAAO,IAKPC,EACAC,EAAMJ,EAAYD,EAAM,UAAW,aAAc,CAAE,EAClDE,EAASG,CAAI,EACjBD,EAAaD,EAEbC,EAAaC,EAMd,OAAO,QAAUD", + "names": ["require_dnansumkbn", "__commonJSMin", "exports", "module", "isnan", "abs", "dnansumkbn", "N", "x", "stride", "sum", "ix", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "abs", "dnansumkbn", "N", "x", "stride", "offset", "sum", "ix", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnansumkbn", "ndarray", "join", "tryRequire", "isError", "main", "dnansumkbn", "tmp"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index 2aac327..7839467 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Interface describing `dnansumkbn`.