@stdlib/blas-ext-base-dsnansumpw 0.0.10 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2022 The Stdlib Authors.
1
+ Copyright (c) 2016-2024 The Stdlib Authors.
package/README.md CHANGED
@@ -18,6 +18,17 @@ limitations under the License.
18
18
 
19
19
  -->
20
20
 
21
+
22
+ <details>
23
+ <summary>
24
+ About stdlib...
25
+ </summary>
26
+ <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27
+ <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28
+ <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29
+ <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
21
32
  # dsnansumpw
22
33
 
23
34
  [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
@@ -197,10 +208,10 @@ console.log( v );
197
208
 
198
209
  ## See Also
199
210
 
200
- - <span class="package-name">[`@stdlib/blas/ext/base/dnansumpw`][@stdlib/blas/ext/base/dnansumpw]</span><span class="delimiter">: </span><span class="description">calculate the sum of double-precision floating-point strided array elements, ignoring NaN values and using pairwise summation.</span>
201
- - <span class="package-name">[`@stdlib/blas/ext/base/dssum`][@stdlib/blas/ext/base/dssum]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.</span>
202
- - <span class="package-name">[`@stdlib/blas/ext/base/dssumpw`][@stdlib/blas/ext/base/dssumpw]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.</span>
203
- - <span class="package-name">[`@stdlib/blas/ext/base/snansumpw`][@stdlib/blas/ext/base/snansumpw]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements, ignoring NaN values and using pairwise summation.</span>
211
+ - <span class="package-name">[`@stdlib/blas-ext/base/dnansumpw`][@stdlib/blas/ext/base/dnansumpw]</span><span class="delimiter">: </span><span class="description">calculate the sum of double-precision floating-point strided array elements, ignoring NaN values and using pairwise summation.</span>
212
+ - <span class="package-name">[`@stdlib/blas-ext/base/dssum`][@stdlib/blas/ext/base/dssum]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.</span>
213
+ - <span class="package-name">[`@stdlib/blas-ext/base/dssumpw`][@stdlib/blas/ext/base/dssumpw]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.</span>
214
+ - <span class="package-name">[`@stdlib/blas-ext/base/snansumpw`][@stdlib/blas/ext/base/snansumpw]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements, ignoring NaN values and using pairwise summation.</span>
204
215
 
205
216
  </section>
206
217
 
@@ -232,7 +243,7 @@ See [LICENSE][stdlib-license].
232
243
 
233
244
  ## Copyright
234
245
 
235
- Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
246
+ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
236
247
 
237
248
  </section>
238
249
 
@@ -245,8 +256,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
245
256
  [npm-image]: http://img.shields.io/npm/v/@stdlib/blas-ext-base-dsnansumpw.svg
246
257
  [npm-url]: https://npmjs.org/package/@stdlib/blas-ext-base-dsnansumpw
247
258
 
248
- [test-image]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/actions/workflows/test.yml/badge.svg?branch=v0.0.10
249
- [test-url]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/actions/workflows/test.yml?query=branch:v0.0.10
259
+ [test-image]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/actions/workflows/test.yml/badge.svg?branch=v0.2.0
260
+ [test-url]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/actions/workflows/test.yml?query=branch:v0.2.0
250
261
 
251
262
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/blas-ext-base-dsnansumpw/main.svg
252
263
  [coverage-url]: https://codecov.io/github/stdlib-js/blas-ext-base-dsnansumpw?branch=main
@@ -259,7 +270,7 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
259
270
  -->
260
271
 
261
272
  [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
262
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
273
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
263
274
 
264
275
  [stdlib]: https://github.com/stdlib-js/stdlib
265
276
 
@@ -269,8 +280,11 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
269
280
  [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
270
281
 
271
282
  [deno-url]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/tree/deno
283
+ [deno-readme]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/blob/deno/README.md
272
284
  [umd-url]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/tree/umd
285
+ [umd-readme]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/blob/umd/README.md
273
286
  [esm-url]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/tree/esm
287
+ [esm-readme]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/blob/esm/README.md
274
288
  [branches-url]: https://github.com/stdlib-js/blas-ext-base-dsnansumpw/blob/main/branches.md
275
289
 
276
290
  [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/blas-ext-base-dsnansumpw/main/LICENSE
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import dsnansumpw from '../docs/types/index';
3
+ export = dsnansumpw;
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";var j=function(u,a){return function(){return a||u((a={exports:{}}).exports,a),a.exports}};var E=j(function(J,_){
2
+ var v=require('@stdlib/math-base-assert-is-nanf/dist'),Z=require('@stdlib/math-base-special-floor/dist'),b=128;function t(u,a,n,e){var r,i,q,p,m,l,c,w,y,R,s,o,f;if(u<=0)return 0;if(u===1||n===0)return v(a[e])?0:a[e];if(r=e,u<8){for(s=0,f=0;f<u;f++)v(a[r])===!1&&(s+=a[r]),r+=n;return s}if(u<=b){for(i=v(a[r])?0:a[r],r+=n,q=v(a[r])?0:a[r],r+=n,p=v(a[r])?0:a[r],r+=n,m=v(a[r])?0:a[r],r+=n,l=v(a[r])?0:a[r],r+=n,c=v(a[r])?0:a[r],r+=n,w=v(a[r])?0:a[r],r+=n,y=v(a[r])?0:a[r],r+=n,R=u%8,f=8;f<u-R;f+=8)i+=v(a[r])?0:a[r],r+=n,q+=v(a[r])?0:a[r],r+=n,p+=v(a[r])?0:a[r],r+=n,m+=v(a[r])?0:a[r],r+=n,l+=v(a[r])?0:a[r],r+=n,c+=v(a[r])?0:a[r],r+=n,w+=v(a[r])?0:a[r],r+=n,y+=v(a[r])?0:a[r],r+=n;for(s=i+q+(p+m)+(l+c+(w+y)),f;f<u;f++)v(a[r])===!1&&(s+=a[r]),r+=n;return s}return o=Z(u/2),o-=o%8,t(o,a,n,r)+t(u-o,a,n,r+o*n)}_.exports=t
3
+ });var I=j(function(P,C){
4
+ var B=require('@stdlib/math-base-assert-is-nanf/dist'),g=E();function h(u,a,n){var e,r,i;if(u<=0)return 0;if(u===1||n===0)return B(a[0])?0:a[0];if(n<0?e=(1-u)*n:e=0,u<8){for(r=0,i=0;i<u;i++)B(a[e])===!1&&(r+=a[e]),e+=n;return r}return g(u,a,n,e)}C.exports=h
5
+ });var M=j(function(Q,L){
6
+ var k=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),K=I(),z=E();k(K,"ndarray",z);L.exports=K
7
+ });var A=require("path").join,D=require('@stdlib/utils-try-require/dist'),F=require('@stdlib/assert-is-error/dist'),G=M(),O,S=D(A(__dirname,"./native.js"));F(S)?O=G:O=S;module.exports=O;
8
+ /** @license Apache-2.0 */
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/ndarray.js", "../lib/dsnansumpw.js", "../lib/main.js", "../lib/index.js"],
4
+ "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 isnanf = require( '@stdlib/math-base-assert-is-nanf' );\nvar floor = require( '@stdlib/math-base-special-floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var floor = require( '@stdlib/math-base-special-floor' );\n*\n* var x = new Float32Array( [ 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 = dsnansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsnansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts1 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts2 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts3 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts4 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts5 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts6 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts7 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dsnansumpw( n, x, stride, ix ) + dsnansumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\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 isnanf = require( '@stdlib/math-base-assert-is-nanf' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsnansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( 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\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\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 dsnansumpw = require( './dsnansumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnansumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\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 single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas-ext-base-dsnansumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var dsnansumpw = require( '@stdlib/blas-ext-base-dsnansumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var floor = require( '@stdlib/math-base-special-floor' );\n* var dsnansumpw = require( '@stdlib/blas-ext-base-dsnansumpw' );\n*\n* var x = new Float32Array( [ 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 = dsnansumpw.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 dsnansumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnansumpw = main;\n} else {\n\tdsnansumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\n\n// exports: { \"ndarray\": \"dsnansumpw.ndarray\" }\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAS,QAAS,kCAAmC,EACrDC,EAAQ,QAAS,iCAAkC,EAMnDC,EAA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,IAAM,GAAKE,IAAW,EAC1B,OAAKL,EAAQI,EAAG,CAAE,CAAE,EACZ,EAEDA,EAAG,CAAE,EAOb,GALKC,EAAS,EACbC,GAAM,EAAEH,GAAKE,EAEbC,EAAK,EAEDH,EAAI,EAAI,CAGZ,IADAI,EAAI,EACE,EAAI,EAAG,EAAIJ,EAAG,IACdH,EAAQI,EAAGE,CAAG,CAAE,IAAM,KAC1BC,GAAKH,EAAGE,CAAG,GAEZA,GAAMD,EAEP,OAAOE,CACR,CACA,OAAON,EAAKE,EAAGC,EAAGC,EAAQC,CAAG,CAC9B,CAKAP,EAAO,QAAUG,ICzFjB,IAAAM,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",
6
+ "names": ["require_ndarray", "__commonJSMin", "exports", "module", "isnanf", "floor", "BLOCKSIZE", "dsnansumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "n", "i", "require_dsnansumpw", "__commonJSMin", "exports", "module", "isnanf", "sum", "dsnansumpw", "N", "x", "stride", "ix", "s", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsnansumpw", "ndarray", "join", "tryRequire", "isError", "main", "dsnansumpw", "tmp"]
7
+ }
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // TypeScript Version: 2.0
19
+ // TypeScript Version: 4.1
20
20
 
21
21
  /**
22
22
  * Interface describing `dsnansumpw`.
@@ -31,7 +31,7 @@ interface Routine {
31
31
  * @returns sum
32
32
  *
33
33
  * @example
34
- * var Float32Array = require( `@stdlib/array/float32` );
34
+ * var Float32Array = require( '@stdlib/array-float32' );
35
35
  *
36
36
  * var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );
37
37
  *
@@ -50,14 +50,14 @@ interface Routine {
50
50
  * @returns sum
51
51
  *
52
52
  * @example
53
- * var Float32Array = require( `@stdlib/array/float32` );
53
+ * var Float32Array = require( '@stdlib/array-float32' );
54
54
  *
55
55
  * var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );
56
56
  *
57
57
  * var v = dsnansumpw.ndarray( x.length, x, 1, 0 );
58
58
  * // returns 1.0
59
59
  */
60
- ndarray( N: number, x: Float32Array, stride: number, offset: number ): number; // tslint:disable-line:max-line-length
60
+ ndarray( N: number, x: Float32Array, stride: number, offset: number ): number;
61
61
  }
62
62
 
63
63
  /**
@@ -69,7 +69,7 @@ interface Routine {
69
69
  * @returns sum
70
70
  *
71
71
  * @example
72
- * var Float32Array = require( `@stdlib/array/float32` );
72
+ * var Float32Array = require( '@stdlib/array-float32' );
73
73
  *
74
74
  * var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );
75
75
  *
@@ -77,7 +77,7 @@ interface Routine {
77
77
  * // returns 1.0
78
78
  *
79
79
  * @example
80
- * var Float32Array = require( `@stdlib/array/float32` );
80
+ * var Float32Array = require( '@stdlib/array-float32' );
81
81
  *
82
82
  * var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );
83
83
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/blas-ext-base-dsnansumpw",
3
- "version": "0.0.10",
3
+ "version": "0.2.0",
4
4
  "description": "Calculate the sum of single-precision floating-point strided array elements, ignoring NaN values, using pairwise summation with extended accumulation, and returning an extended precision result.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -41,25 +41,26 @@
41
41
  "url": "https://github.com/stdlib-js/stdlib/issues"
42
42
  },
43
43
  "dependencies": {
44
- "@stdlib/assert-is-error": "^0.0.x",
45
- "@stdlib/math-base-assert-is-nanf": "^0.0.x",
46
- "@stdlib/math-base-special-floor": "^0.0.x",
47
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x",
48
- "@stdlib/utils-library-manifest": "^0.0.x",
49
- "@stdlib/utils-try-require": "^0.0.x"
44
+ "@stdlib/assert-is-error": "^0.2.0",
45
+ "@stdlib/math-base-assert-is-nanf": "^0.2.0",
46
+ "@stdlib/math-base-special-floor": "^0.2.0",
47
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.0",
48
+ "@stdlib/utils-library-manifest": "^0.2.0",
49
+ "@stdlib/utils-try-require": "^0.2.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@stdlib/array-float32": "^0.0.x",
53
- "@stdlib/assert-is-browser": "^0.0.x",
54
- "@stdlib/bench": "^0.0.x",
55
- "@stdlib/math-base-assert-is-nan": "^0.0.x",
56
- "@stdlib/math-base-special-pow": "^0.0.x",
57
- "@stdlib/math-base-special-round": "^0.0.x",
58
- "@stdlib/random-base-randu": "^0.0.x",
52
+ "@stdlib/array-float32": "^0.1.1",
53
+ "@stdlib/assert-is-browser": "^0.1.1",
54
+ "@stdlib/math-base-assert-is-nan": "^0.1.1",
55
+ "@stdlib/math-base-special-pow": "^0.1.0",
56
+ "@stdlib/math-base-special-round": "^0.1.1",
57
+ "@stdlib/random-base-randu": "^0.1.0",
59
58
  "proxyquire": "^2.0.0",
60
59
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
61
60
  "istanbul": "^0.4.1",
62
- "tap-spec": "5.x.x"
61
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
62
+ "@stdlib/bench-harness": "^0.2.0",
63
+ "@stdlib/bench": "^0.3.1"
63
64
  },
64
65
  "engines": {
65
66
  "node": ">=0.10.0",
@@ -101,7 +102,7 @@
101
102
  ],
102
103
  "__stdlib__": {},
103
104
  "funding": {
104
- "type": "patreon",
105
- "url": "https://www.patreon.com/athan"
105
+ "type": "opencollective",
106
+ "url": "https://opencollective.com/stdlib"
106
107
  }
107
108
  }
package/docs/repl.txt DELETED
@@ -1,96 +0,0 @@
1
-
2
- {{alias}}( N, x, stride )
3
- Computes the sum of single-precision floating-point strided array elements,
4
- ignoring `NaN` values, using pairwise summation with extended accumulation,
5
- and returning an extended precision result.
6
-
7
- The `N` and `stride` parameters determine which elements in `x` are accessed
8
- at runtime.
9
-
10
- Indexing is relative to the first index. To introduce an offset, use a typed
11
- array view.
12
-
13
- If `N <= 0`, the function returns `0.0`.
14
-
15
- Parameters
16
- ----------
17
- N: integer
18
- Number of indexed elements.
19
-
20
- x: Float32Array
21
- Input array.
22
-
23
- stride: integer
24
- Index increment.
25
-
26
- Returns
27
- -------
28
- out: number
29
- Sum.
30
-
31
- Examples
32
- --------
33
- // Standard Usage:
34
- > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, NaN, 2.0 ] );
35
- > {{alias}}( x.length, x, 1 )
36
- 1.0
37
-
38
- // Using `N` and `stride` parameters:
39
- > x = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN, NaN ] );
40
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
41
- > var stride = 2;
42
- > {{alias}}( N, x, stride )
43
- 1.0
44
-
45
- // Using view offsets:
46
- > var x0 = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ] );
47
- > var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
48
- > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
49
- > stride = 2;
50
- > {{alias}}( N, x1, stride )
51
- -1.0
52
-
53
- {{alias}}.ndarray( N, x, stride, offset )
54
- Computes the sum of single-precision floating-point strided array elements,
55
- ignoring `NaN` values and using pairwise summation with extended
56
- accumulation and alternative indexing semantics.
57
-
58
- While typed array views mandate a view offset based on the underlying
59
- buffer, the `offset` parameter supports indexing semantics based on a
60
- starting index.
61
-
62
- Parameters
63
- ----------
64
- N: integer
65
- Number of indexed elements.
66
-
67
- x: Float32Array
68
- Input array.
69
-
70
- stride: integer
71
- Index increment.
72
-
73
- offset: integer
74
- Starting index.
75
-
76
- Returns
77
- -------
78
- out: number
79
- Sum.
80
-
81
- Examples
82
- --------
83
- // Standard Usage:
84
- > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, NaN, 2.0 ] );
85
- > {{alias}}.ndarray( x.length, x, 1, 0 )
86
- 1.0
87
-
88
- // Using offset parameter:
89
- > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ] );
90
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
91
- > {{alias}}.ndarray( N, x, 2, 1 )
92
- -1.0
93
-
94
- See Also
95
- --------
96
-
@@ -1,157 +0,0 @@
1
- /*
2
- * @license Apache-2.0
3
- *
4
- * Copyright (c) 2020 The Stdlib Authors.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import dsnansumpw = require( './index' );
20
-
21
-
22
- // TESTS //
23
-
24
- // The function returns a number...
25
- {
26
- const x = new Float32Array( 10 );
27
-
28
- dsnansumpw( x.length, x, 1 ); // $ExpectType number
29
- }
30
-
31
- // The compiler throws an error if the function is provided a first argument which is not a number...
32
- {
33
- const x = new Float32Array( 10 );
34
-
35
- dsnansumpw( '10', x, 1 ); // $ExpectError
36
- dsnansumpw( true, x, 1 ); // $ExpectError
37
- dsnansumpw( false, x, 1 ); // $ExpectError
38
- dsnansumpw( null, x, 1 ); // $ExpectError
39
- dsnansumpw( undefined, x, 1 ); // $ExpectError
40
- dsnansumpw( [], x, 1 ); // $ExpectError
41
- dsnansumpw( {}, x, 1 ); // $ExpectError
42
- dsnansumpw( ( x: number ): number => x, x, 1 ); // $ExpectError
43
- }
44
-
45
- // The compiler throws an error if the function is provided a second argument which is not a Float32Array...
46
- {
47
- const x = new Float32Array( 10 );
48
-
49
- dsnansumpw( x.length, 10, 1 ); // $ExpectError
50
- dsnansumpw( x.length, '10', 1 ); // $ExpectError
51
- dsnansumpw( x.length, true, 1 ); // $ExpectError
52
- dsnansumpw( x.length, false, 1 ); // $ExpectError
53
- dsnansumpw( x.length, null, 1 ); // $ExpectError
54
- dsnansumpw( x.length, undefined, 1 ); // $ExpectError
55
- dsnansumpw( x.length, [], 1 ); // $ExpectError
56
- dsnansumpw( x.length, {}, 1 ); // $ExpectError
57
- dsnansumpw( x.length, ( x: number ): number => x, 1 ); // $ExpectError
58
- }
59
-
60
- // The compiler throws an error if the function is provided a third argument which is not a number...
61
- {
62
- const x = new Float32Array( 10 );
63
-
64
- dsnansumpw( x.length, x, '10' ); // $ExpectError
65
- dsnansumpw( x.length, x, true ); // $ExpectError
66
- dsnansumpw( x.length, x, false ); // $ExpectError
67
- dsnansumpw( x.length, x, null ); // $ExpectError
68
- dsnansumpw( x.length, x, undefined ); // $ExpectError
69
- dsnansumpw( x.length, x, [] ); // $ExpectError
70
- dsnansumpw( x.length, x, {} ); // $ExpectError
71
- dsnansumpw( x.length, x, ( x: number ): number => x ); // $ExpectError
72
- }
73
-
74
- // The compiler throws an error if the function is provided an unsupported number of arguments...
75
- {
76
- const x = new Float32Array( 10 );
77
-
78
- dsnansumpw(); // $ExpectError
79
- dsnansumpw( x.length ); // $ExpectError
80
- dsnansumpw( x.length, x ); // $ExpectError
81
- dsnansumpw( x.length, x, 1, 10 ); // $ExpectError
82
- }
83
-
84
- // Attached to main export is an `ndarray` method which returns a number...
85
- {
86
- const x = new Float32Array( 10 );
87
-
88
- dsnansumpw.ndarray( x.length, x, 1, 0 ); // $ExpectType number
89
- }
90
-
91
- // The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
92
- {
93
- const x = new Float32Array( 10 );
94
-
95
- dsnansumpw.ndarray( '10', x, 1, 0 ); // $ExpectError
96
- dsnansumpw.ndarray( true, x, 1, 0 ); // $ExpectError
97
- dsnansumpw.ndarray( false, x, 1, 0 ); // $ExpectError
98
- dsnansumpw.ndarray( null, x, 1, 0 ); // $ExpectError
99
- dsnansumpw.ndarray( undefined, x, 1, 0 ); // $ExpectError
100
- dsnansumpw.ndarray( [], x, 1, 0 ); // $ExpectError
101
- dsnansumpw.ndarray( {}, x, 1, 0 ); // $ExpectError
102
- dsnansumpw.ndarray( ( x: number ): number => x, x, 1, 0 ); // $ExpectError
103
- }
104
-
105
- // The compiler throws an error if the `ndarray` method is provided a second argument which is not a Float32Array...
106
- {
107
- const x = new Float32Array( 10 );
108
-
109
- dsnansumpw.ndarray( x.length, 10, 1, 0 ); // $ExpectError
110
- dsnansumpw.ndarray( x.length, '10', 1, 0 ); // $ExpectError
111
- dsnansumpw.ndarray( x.length, true, 1, 0 ); // $ExpectError
112
- dsnansumpw.ndarray( x.length, false, 1, 0 ); // $ExpectError
113
- dsnansumpw.ndarray( x.length, null, 1, 0 ); // $ExpectError
114
- dsnansumpw.ndarray( x.length, undefined, 1, 0 ); // $ExpectError
115
- dsnansumpw.ndarray( x.length, [], 1, 0 ); // $ExpectError
116
- dsnansumpw.ndarray( x.length, {}, 1, 0 ); // $ExpectError
117
- dsnansumpw.ndarray( x.length, ( x: number ): number => x, 1, 0 ); // $ExpectError
118
- }
119
-
120
- // The compiler throws an error if the `ndarray` method is provided a third argument which is not a number...
121
- {
122
- const x = new Float32Array( 10 );
123
-
124
- dsnansumpw.ndarray( x.length, x, '10', 0 ); // $ExpectError
125
- dsnansumpw.ndarray( x.length, x, true, 0 ); // $ExpectError
126
- dsnansumpw.ndarray( x.length, x, false, 0 ); // $ExpectError
127
- dsnansumpw.ndarray( x.length, x, null, 0 ); // $ExpectError
128
- dsnansumpw.ndarray( x.length, x, undefined, 0 ); // $ExpectError
129
- dsnansumpw.ndarray( x.length, x, [], 0 ); // $ExpectError
130
- dsnansumpw.ndarray( x.length, x, {}, 0 ); // $ExpectError
131
- dsnansumpw.ndarray( x.length, x, ( x: number ): number => x, 0 ); // $ExpectError
132
- }
133
-
134
- // The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number...
135
- {
136
- const x = new Float32Array( 10 );
137
-
138
- dsnansumpw.ndarray( x.length, x, 1, '10' ); // $ExpectError
139
- dsnansumpw.ndarray( x.length, x, 1, true ); // $ExpectError
140
- dsnansumpw.ndarray( x.length, x, 1, false ); // $ExpectError
141
- dsnansumpw.ndarray( x.length, x, 1, null ); // $ExpectError
142
- dsnansumpw.ndarray( x.length, x, 1, undefined ); // $ExpectError
143
- dsnansumpw.ndarray( x.length, x, 1, [] ); // $ExpectError
144
- dsnansumpw.ndarray( x.length, x, 1, {} ); // $ExpectError
145
- dsnansumpw.ndarray( x.length, x, 1, ( x: number ): number => x ); // $ExpectError
146
- }
147
-
148
- // The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
149
- {
150
- const x = new Float32Array( 10 );
151
-
152
- dsnansumpw.ndarray(); // $ExpectError
153
- dsnansumpw.ndarray( x.length ); // $ExpectError
154
- dsnansumpw.ndarray( x.length, x ); // $ExpectError
155
- dsnansumpw.ndarray( x.length, x, 1 ); // $ExpectError
156
- dsnansumpw.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError
157
- }