@stdlib/blas-ext-base-dsnannsumors 0.0.9 → 0.1.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/CITATION.cff ADDED
@@ -0,0 +1,30 @@
1
+ cff-version: 1.2.0
2
+ title: stdlib
3
+ message: >-
4
+ If you use this software, please cite it using the
5
+ metadata from this file.
6
+
7
+ type: software
8
+
9
+ authors:
10
+ - name: The Stdlib Authors
11
+ url: https://github.com/stdlib-js/stdlib/graphs/contributors
12
+
13
+ repository-code: https://github.com/stdlib-js/stdlib
14
+ url: https://stdlib.io
15
+
16
+ abstract: |
17
+ Standard library for JavaScript and Node.js.
18
+
19
+ keywords:
20
+ - JavaScript
21
+ - Node.js
22
+ - TypeScript
23
+ - standard library
24
+ - scientific computing
25
+ - numerical computing
26
+ - statistical computing
27
+
28
+ license: Apache-2.0 AND BSL-1.0
29
+
30
+ date-released: 2016
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2022 The Stdlib Authors.
1
+ Copyright (c) 2016-2023 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
  # dsnannsumors
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] -->
@@ -200,9 +211,9 @@ console.log( out );
200
211
 
201
212
  ## See Also
202
213
 
203
- - <span class="package-name">[`@stdlib/blas/ext/base/dnannsumors`][@stdlib/blas/ext/base/dnannsumors]</span><span class="delimiter">: </span><span class="description">calculate the sum of double-precision floating-point strided array elements, ignoring NaN values and using ordinary recursive summation.</span>
204
- - <span class="package-name">[`@stdlib/blas/ext/base/dsnansumors`][@stdlib/blas/ext/base/dsnansumors]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements, ignoring NaN values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.</span>
205
- - <span class="package-name">[`@stdlib/blas/ext/base/dssumors`][@stdlib/blas/ext/base/dssumors]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and returning an extended precision result.</span>
214
+ - <span class="package-name">[`@stdlib/blas-ext/base/dnannsumors`][@stdlib/blas/ext/base/dnannsumors]</span><span class="delimiter">: </span><span class="description">calculate the sum of double-precision floating-point strided array elements, ignoring NaN values and using ordinary recursive summation.</span>
215
+ - <span class="package-name">[`@stdlib/blas-ext/base/dsnansumors`][@stdlib/blas/ext/base/dsnansumors]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements, ignoring NaN values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.</span>
216
+ - <span class="package-name">[`@stdlib/blas-ext/base/dssumors`][@stdlib/blas/ext/base/dssumors]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and returning an extended precision result.</span>
206
217
 
207
218
  </section>
208
219
 
@@ -234,7 +245,7 @@ See [LICENSE][stdlib-license].
234
245
 
235
246
  ## Copyright
236
247
 
237
- Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
248
+ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
238
249
 
239
250
  </section>
240
251
 
@@ -247,8 +258,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
247
258
  [npm-image]: http://img.shields.io/npm/v/@stdlib/blas-ext-base-dsnannsumors.svg
248
259
  [npm-url]: https://npmjs.org/package/@stdlib/blas-ext-base-dsnannsumors
249
260
 
250
- [test-image]: https://github.com/stdlib-js/blas-ext-base-dsnannsumors/actions/workflows/test.yml/badge.svg?branch=v0.0.9
251
- [test-url]: https://github.com/stdlib-js/blas-ext-base-dsnannsumors/actions/workflows/test.yml?query=branch:v0.0.9
261
+ [test-image]: https://github.com/stdlib-js/blas-ext-base-dsnannsumors/actions/workflows/test.yml/badge.svg?branch=v0.1.0
262
+ [test-url]: https://github.com/stdlib-js/blas-ext-base-dsnannsumors/actions/workflows/test.yml?query=branch:v0.1.0
252
263
 
253
264
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/blas-ext-base-dsnannsumors/main.svg
254
265
  [coverage-url]: https://codecov.io/github/stdlib-js/blas-ext-base-dsnannsumors?branch=main
@@ -261,7 +272,7 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
261
272
  -->
262
273
 
263
274
  [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
264
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
275
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
265
276
 
266
277
  [stdlib]: https://github.com/stdlib-js/stdlib
267
278
 
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import dsnannsumors from '../docs/types/index';
3
+ export = dsnannsumors;
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";var p=function(s,a){return function(){return a||s((a={exports:{}}).exports,a),a.exports}};var _=p(function(I,R){
2
+ var j=require('@stdlib/math-base-assert-is-nan/dist');function x(s,a,m,e,r){var v,q,n,f,i;if(m<0?q=(1-s)*m:q=0,r<0?n=-r:n=0,v=0,s<=0)return e[n]=v,e[n+r]=0,e;if(s===1||m===0)return j(a[q])?(e[n]=v,e[n+r]=0,e):(e[n]=a[q],e[n+r]=1,e);for(f=0,i=0;i<s;i++)j(a[q])===!1&&(v+=a[q],f+=1),q+=m;return e[n]=v,e[n+r]=f,e}R.exports=x
3
+ });var g=p(function(J,b){
4
+ var E=require('@stdlib/math-base-assert-is-nan/dist');function z(s,a,m,e,r,v,q){var n,f,i,c,l;if(f=e,i=q,n=0,s<=0)return r[i]=n,r[i+v]=0,r;if(s===1||m===0)return E(a[f])?(r[i]=n,r[i+v]=0,r):(r[i]=a[f],r[i+v]=1,r);for(c=0,l=0;l<s;l++)E(a[f])===!1&&(n+=a[f],c+=1),f+=m;return r[i]=n,r[i+v]=c,r}b.exports=z
5
+ });var u=p(function(K,k){
6
+ var A=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),h=_(),B=g();A(h,"ndarray",B);k.exports=h
7
+ });var C=require("path").join,D=require('@stdlib/utils-try-require/dist'),F=require('@stdlib/assert-is-error/dist'),G=u(),y,w=D(C(__dirname,"./native.js"));F(w)?y=G:y=w;module.exports=y;
8
+ /** @license Apache-2.0 */
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/dsnannsumors.js", "../lib/ndarray.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 isnan = require( '@stdlib/math-base-assert-is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dsnannsumors( x.length, x, 1, out, 1 );\n* // returns <Float64Array>[ 1.0, 3 ]\n*/\nfunction dsnannsumors( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\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' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var Float64Array = require( '@stdlib/array-float64' );\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 out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dsnannsumors( N, x, 2, 1, out, 1, 0 );\n* // returns <Float64Array>[ 5.0, 4 ]\n*/\nfunction dsnannsumors( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\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 dsnannsumors = require( './dsnannsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnannsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\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 ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas-ext-base-dsnannsumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var Float64Array = require( '@stdlib/array-float64' );\n* var dsnannsumors = require( '@stdlib/blas-ext-base-dsnannsumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dsnannsumors( x.length, x, 1, out, 1 );\n* // returns <Float64Array>[ 1.0, 3 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var Float64Array = require( '@stdlib/array-float64' );\n* var floor = require( '@stdlib/math-base-special-floor' );\n* var dsnannsumors = require( '@stdlib/blas-ext-base-dsnannsumors' );\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 out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dsnannsumors.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns <Float64Array>[ 5.0, 4 ]\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 dsnannsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnannsumors = main;\n} else {\n\tdsnannsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\n\n// exports: { \"ndarray\": \"dsnannsumors.ndarray\" }\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EAyBvD,SAASC,EAAcC,EAAGC,EAAGC,EAASC,EAAKC,EAAY,CACtD,IAAIC,EACAC,EACAC,EACAC,EACA,EAaJ,GAXKN,EAAU,EACdI,GAAM,EAAEN,GAAKE,EAEbI,EAAK,EAEDF,EAAY,EAChBG,EAAK,CAACH,EAENG,EAAK,EAENF,EAAM,EACDL,GAAK,EACT,OAAAG,EAAKI,CAAG,EAAIF,EACZF,EAAKI,EAAGH,CAAU,EAAI,EACfD,EAER,GAAKH,IAAM,GAAKE,IAAY,EAC3B,OAAKJ,EAAOG,EAAGK,CAAG,CAAE,GACnBH,EAAKI,CAAG,EAAIF,EACZF,EAAKI,EAAGH,CAAU,EAAI,EACfD,IAERA,EAAKI,CAAG,EAAIN,EAAGK,CAAG,EAClBH,EAAKI,EAAGH,CAAU,EAAI,EACfD,GAGR,IADAK,EAAI,EACE,EAAI,EAAG,EAAIR,EAAG,IACdF,EAAOG,EAAGK,CAAG,CAAE,IAAM,KACzBD,GAAOJ,EAAGK,CAAG,EACbE,GAAK,GAENF,GAAMJ,EAEP,OAAAC,EAAKI,CAAG,EAAIF,EACZF,EAAKI,EAAGH,CAAU,EAAII,EACfL,CACR,CAKAN,EAAO,QAAUE,IChGjB,IAAAU,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EA8BvD,SAASC,EAAcC,EAAGC,EAAGC,EAASC,EAASC,EAAKC,EAAWC,EAAY,CAC1E,IAAIC,EACAC,EACAC,EACAC,EACAC,EAMJ,GAJAH,EAAKL,EACLM,EAAKH,EAELC,EAAM,EACDP,GAAK,EACT,OAAAI,EAAKK,CAAG,EAAIF,EACZH,EAAKK,EAAGJ,CAAU,EAAI,EACfD,EAER,GAAKJ,IAAM,GAAKE,IAAY,EAC3B,OAAKJ,EAAOG,EAAGO,CAAG,CAAE,GACnBJ,EAAKK,CAAG,EAAIF,EACZH,EAAKK,EAAGJ,CAAU,EAAI,EACfD,IAERA,EAAKK,CAAG,EAAIR,EAAGO,CAAG,EAClBJ,EAAKK,EAAGJ,CAAU,EAAI,EACfD,GAGR,IADAM,EAAI,EACEC,EAAI,EAAGA,EAAIX,EAAGW,IACdb,EAAOG,EAAGO,CAAG,CAAE,IAAM,KACzBD,GAAON,EAAGO,CAAG,EACbE,GAAK,GAENF,GAAMN,EAEP,OAAAE,EAAKK,CAAG,EAAIF,EACZH,EAAKK,EAAGJ,CAAU,EAAIK,EACfN,CACR,CAKAP,EAAO,QAAUE,IC9FjB,IAAAa,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAe,IACfC,EAAU,IAKdF,EAAaC,EAAc,UAAWC,CAAQ,EAK9CH,EAAO,QAAUE,ICmBjB,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,EAAeD,EAEfC,EAAeC,EAMhB,OAAO,QAAUD",
6
+ "names": ["require_dsnannsumors", "__commonJSMin", "exports", "module", "isnan", "dsnannsumors", "N", "x", "strideX", "out", "strideOut", "sum", "ix", "io", "n", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "dsnannsumors", "N", "x", "strideX", "offsetX", "out", "strideOut", "offsetOut", "sum", "ix", "io", "n", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsnannsumors", "ndarray", "join", "tryRequire", "isError", "main", "dsnannsumors", "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 `dsnannsumors`.
package/lib/index.js CHANGED
@@ -53,6 +53,7 @@
53
53
 
54
54
  var join = require( 'path' ).join;
55
55
  var tryRequire = require( '@stdlib/utils-try-require' );
56
+ var isError = require( '@stdlib/assert-is-error' );
56
57
  var main = require( './main.js' );
57
58
 
58
59
 
@@ -60,7 +61,7 @@ var main = require( './main.js' );
60
61
 
61
62
  var dsnannsumors;
62
63
  var tmp = tryRequire( join( __dirname, './native.js' ) );
63
- if ( tmp instanceof Error ) {
64
+ if ( isError( tmp ) ) {
64
65
  dsnannsumors = main;
65
66
  } else {
66
67
  dsnannsumors = tmp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/blas-ext-base-dsnannsumors",
3
- "version": "0.0.9",
3
+ "version": "0.1.0",
4
4
  "description": "Calculate the sum of single-precision floating-point strided array elements, ignoring NaN values, using ordinary recursive 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/math-base-assert-is-nan": "^0.0.x",
45
- "@stdlib/math-base-assert-is-nanf": "^0.0.x",
46
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x",
47
- "@stdlib/utils-library-manifest": "^0.0.x",
48
- "@stdlib/utils-try-require": "^0.0.x"
44
+ "@stdlib/assert-is-error": "^0.1.0",
45
+ "@stdlib/math-base-assert-is-nan": "^0.1.0",
46
+ "@stdlib/math-base-assert-is-nanf": "^0.1.0",
47
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0",
48
+ "@stdlib/utils-library-manifest": "^0.1.0",
49
+ "@stdlib/utils-try-require": "^0.1.0"
49
50
  },
50
51
  "devDependencies": {
51
- "@stdlib/array-float32": "^0.0.x",
52
- "@stdlib/array-float64": "^0.0.x",
53
- "@stdlib/assert-is-browser": "^0.0.x",
54
- "@stdlib/bench": "^0.0.x",
55
- "@stdlib/math-base-special-floor": "^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.0.6",
53
+ "@stdlib/array-float64": "^0.0.6",
54
+ "@stdlib/assert-is-browser": "^0.1.0",
55
+ "@stdlib/bench": "^0.1.0",
56
+ "@stdlib/math-base-special-floor": "^0.0.8",
57
+ "@stdlib/math-base-special-pow": "^0.0.7",
58
+ "@stdlib/math-base-special-round": "^0.1.0",
59
+ "@stdlib/random-base-randu": "^0.0.8",
59
60
  "proxyquire": "^2.0.0",
60
61
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
61
62
  "istanbul": "^0.4.1",
62
- "tap-spec": "5.x.x"
63
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git"
63
64
  },
64
65
  "engines": {
65
66
  "node": ">=0.10.0",
@@ -100,7 +101,7 @@
100
101
  ],
101
102
  "__stdlib__": {},
102
103
  "funding": {
103
- "type": "patreon",
104
- "url": "https://www.patreon.com/athan"
104
+ "type": "opencollective",
105
+ "url": "https://opencollective.com/stdlib"
105
106
  }
106
107
  }
package/docs/repl.txt DELETED
@@ -1,116 +0,0 @@
1
-
2
- {{alias}}( N, x, strideX, out, strideOut )
3
- Computes the sum of single-precision floating-point strided array elements,
4
- ignoring `NaN` values, using ordinary recursive summation with extended
5
- accumulation, and returning an extended precision result.
6
-
7
- The `N` and `stride` parameters determine which elements are accessed at
8
- 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 a sum equal to `0.0`.
14
-
15
- Parameters
16
- ----------
17
- N: integer
18
- Number of indexed elements.
19
-
20
- x: Float32Array
21
- Input array.
22
-
23
- strideX: integer
24
- Index increment for `x`.
25
-
26
- out: Float64Array
27
- Output array.
28
-
29
- strideOut: integer
30
- Index increment for `out`.
31
-
32
- Returns
33
- -------
34
- out: Float64Array
35
- Output array whose first element is the sum and whose second element is
36
- the number of non-NaN elements.
37
-
38
- Examples
39
- --------
40
- // Standard Usage:
41
- > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, NaN, 2.0 ] );
42
- > var out = new {{alias:@stdlib/array/float64}}( 2 );
43
- > {{alias}}( x.length, x, 1, out, 1 )
44
- <Float64Array>[ 1.0, 3 ]
45
-
46
- // Using `N` and `stride` parameters:
47
- > x = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN, NaN ] );
48
- > out = new {{alias:@stdlib/array/float64}}( 2 );
49
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
50
- > {{alias}}( N, x, 2, out, 1 )
51
- <Float64Array>[ 1.0, 3 ]
52
-
53
- // Using view offsets:
54
- > var x0 = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, 1.0, NaN, NaN ] );
55
- > var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
56
- > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
57
- > out = new {{alias:@stdlib/array/float64}}( 2 );
58
- > {{alias}}( N, x1, 2, out, 1 )
59
- <Float64Array>[ 1.0, 3 ]
60
-
61
- {{alias}}.ndarray( N, x, strideX, offsetX, out, strideOut, offsetOut )
62
- Computes the sum of single-precision floating-point strided array elements,
63
- ignoring `NaN` values and using ordinary recursive summation with extended
64
- accumulation and alternative indexing semantics.
65
-
66
- While typed array views mandate a view offset based on the underlying
67
- buffer, the `offset` parameter supports indexing semantics based on a
68
- starting index.
69
-
70
- Parameters
71
- ----------
72
- N: integer
73
- Number of indexed elements.
74
-
75
- x: Float32Array
76
- Input array.
77
-
78
- strideX: integer
79
- Index increment for `x`.
80
-
81
- offsetX: integer
82
- Starting index for `x`.
83
-
84
- out: Float64Array
85
- Output array.
86
-
87
- strideOut: integer
88
- Index increment for `out`.
89
-
90
- offsetOut: integer
91
- Starting index for `out`.
92
-
93
- Returns
94
- -------
95
- out: Float64Array
96
- Output array whose first element is the sum and whose second element is
97
- the number of non-NaN elements.
98
-
99
- Examples
100
- --------
101
- // Standard Usage:
102
- > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, NaN, 2.0 ] );
103
- > var out = new {{alias:@stdlib/array/float64}}( 2 );
104
- > {{alias}}.ndarray( x.length, x, 1, 0, out, 1, 0 )
105
- <Float64Array>[ 1.0, 3 ]
106
-
107
- // Using offset parameter:
108
- > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, 1.0, NaN, NaN ] );
109
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
110
- > out = new {{alias:@stdlib/array/float64}}( 2 );
111
- > {{alias}}.ndarray( N, x, 2, 1, out, 1, 0 )
112
- <Float64Array>[ 1.0, 3 ]
113
-
114
- See Also
115
- --------
116
-
@@ -1,248 +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 dsnannsumors = require( './index' );
20
-
21
-
22
- // TESTS //
23
-
24
- // The function returns a Float64Array...
25
- {
26
- const x = new Float32Array( 10 );
27
- const out = new Float64Array( 2 );
28
-
29
- dsnannsumors( x.length, x, 1, out, 1 ); // $ExpectType Float64Array
30
- }
31
-
32
- // The compiler throws an error if the function is provided a first argument which is not a number...
33
- {
34
- const x = new Float32Array( 10 );
35
- const out = new Float64Array( 2 );
36
-
37
- dsnannsumors( '10', x, 1, out, 1 ); // $ExpectError
38
- dsnannsumors( true, x, 1, out, 1 ); // $ExpectError
39
- dsnannsumors( false, x, 1, out, 1 ); // $ExpectError
40
- dsnannsumors( null, x, 1, out, 1 ); // $ExpectError
41
- dsnannsumors( undefined, x, 1, out, 1 ); // $ExpectError
42
- dsnannsumors( [], x, 1, out, 1 ); // $ExpectError
43
- dsnannsumors( {}, x, 1, out, 1 ); // $ExpectError
44
- dsnannsumors( ( x: number ): number => x, x, 1, out, 1 ); // $ExpectError
45
- }
46
-
47
- // The compiler throws an error if the function is provided a second argument which is not a Float32Array...
48
- {
49
- const x = new Float32Array( 10 );
50
- const out = new Float64Array( 2 );
51
-
52
- dsnannsumors( x.length, 10, 1, out, 1 ); // $ExpectError
53
- dsnannsumors( x.length, '10', 1, out, 1 ); // $ExpectError
54
- dsnannsumors( x.length, true, 1, out, 1 ); // $ExpectError
55
- dsnannsumors( x.length, false, 1, out, 1 ); // $ExpectError
56
- dsnannsumors( x.length, null, 1, out, 1 ); // $ExpectError
57
- dsnannsumors( x.length, undefined, 1, out, 1 ); // $ExpectError
58
- dsnannsumors( x.length, [ '1' ], 1, out, 1 ); // $ExpectError
59
- dsnannsumors( x.length, {}, 1, out, 1 ); // $ExpectError
60
- dsnannsumors( x.length, ( x: number ): number => x, 1, out, 1 ); // $ExpectError
61
- }
62
-
63
- // The compiler throws an error if the function is provided a third argument which is not a number...
64
- {
65
- const x = new Float32Array( 10 );
66
- const out = new Float64Array( 2 );
67
-
68
- dsnannsumors( x.length, x, '10', out, 1 ); // $ExpectError
69
- dsnannsumors( x.length, x, true, out, 1 ); // $ExpectError
70
- dsnannsumors( x.length, x, false, out, 1 ); // $ExpectError
71
- dsnannsumors( x.length, x, null, out, 1 ); // $ExpectError
72
- dsnannsumors( x.length, x, undefined, out, 1 ); // $ExpectError
73
- dsnannsumors( x.length, x, [], out, 1 ); // $ExpectError
74
- dsnannsumors( x.length, x, {}, out, 1 ); // $ExpectError
75
- dsnannsumors( x.length, x, ( x: number ): number => x, out, 1 ); // $ExpectError
76
- }
77
-
78
- // The compiler throws an error if the function is provided a fourth argument which is not a Float64Array...
79
- {
80
- const x = new Float64Array( 10 );
81
-
82
- dsnannsumors( x.length, x, 1, 10, 1 ); // $ExpectError
83
- dsnannsumors( x.length, x, 1, '10', 1 ); // $ExpectError
84
- dsnannsumors( x.length, x, 1, true, 1 ); // $ExpectError
85
- dsnannsumors( x.length, x, 1, false, 1 ); // $ExpectError
86
- dsnannsumors( x.length, x, 1, null, 1 ); // $ExpectError
87
- dsnannsumors( x.length, x, 1, undefined, 1 ); // $ExpectError
88
- dsnannsumors( x.length, x, 1, [ '1' ], 1 ); // $ExpectError
89
- dsnannsumors( x.length, x, 1, {}, 1 ); // $ExpectError
90
- dsnannsumors( x.length, x, 1, ( x: number ): number => x, 1 ); // $ExpectError
91
- }
92
-
93
- // The compiler throws an error if the function is provided a fifth argument which is not a number...
94
- {
95
- const x = new Float32Array( 10 );
96
- const out = new Float64Array( 2 );
97
-
98
- dsnannsumors( x.length, x, 1, out, '10' ); // $ExpectError
99
- dsnannsumors( x.length, x, 1, out, true ); // $ExpectError
100
- dsnannsumors( x.length, x, 1, out, false ); // $ExpectError
101
- dsnannsumors( x.length, x, 1, out, null ); // $ExpectError
102
- dsnannsumors( x.length, x, 1, out, undefined ); // $ExpectError
103
- dsnannsumors( x.length, x, 1, out, [] ); // $ExpectError
104
- dsnannsumors( x.length, x, 1, out, {} ); // $ExpectError
105
- dsnannsumors( x.length, x, 1, out, ( x: number ): number => x ); // $ExpectError
106
- }
107
-
108
- // The compiler throws an error if the function is provided an unsupported number of arguments...
109
- {
110
- const x = new Float32Array( 10 );
111
- const out = new Float64Array( 2 );
112
-
113
- dsnannsumors(); // $ExpectError
114
- dsnannsumors( x.length ); // $ExpectError
115
- dsnannsumors( x.length, x ); // $ExpectError
116
- dsnannsumors( x.length, x, 1 ); // $ExpectError
117
- dsnannsumors( x.length, x, 1, out ); // $ExpectError
118
- dsnannsumors( x.length, x, 1, out, 1, 10 ); // $ExpectError
119
- }
120
-
121
- // Attached to main export is an `ndarray` method which returns a Float64Array...
122
- {
123
- const x = new Float32Array( 10 );
124
- const out = new Float64Array( 2 );
125
-
126
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, 0 ); // $ExpectType Float64Array
127
- }
128
-
129
- // The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
130
- {
131
- const x = new Float32Array( 10 );
132
- const out = new Float64Array( 2 );
133
-
134
- dsnannsumors.ndarray( '10', x, 1, 0, out, 1, 0 ); // $ExpectError
135
- dsnannsumors.ndarray( true, x, 1, 0, out, 1, 0 ); // $ExpectError
136
- dsnannsumors.ndarray( false, x, 1, 0, out, 1, 0 ); // $ExpectError
137
- dsnannsumors.ndarray( null, x, 1, 0, out, 1, 0 ); // $ExpectError
138
- dsnannsumors.ndarray( undefined, x, 1, 0, out, 1, 0 ); // $ExpectError
139
- dsnannsumors.ndarray( [], x, 1, 0, out, 1, 0 ); // $ExpectError
140
- dsnannsumors.ndarray( {}, x, 1, 0, out, 1, 0 ); // $ExpectError
141
- dsnannsumors.ndarray( ( x: number ): number => x, x, 1, 0, out, 1, 0 ); // $ExpectError
142
- }
143
-
144
- // The compiler throws an error if the `ndarray` method is provided a second argument which is not a Float32Array...
145
- {
146
- const x = new Float32Array( 10 );
147
- const out = new Float64Array( 2 );
148
-
149
- dsnannsumors.ndarray( x.length, 10, 1, 0, out, 1, 0 ); // $ExpectError
150
- dsnannsumors.ndarray( x.length, '10', 1, 0, out, 1, 0 ); // $ExpectError
151
- dsnannsumors.ndarray( x.length, true, 1, 0, out, 1, 0 ); // $ExpectError
152
- dsnannsumors.ndarray( x.length, false, 1, 0, out, 1, 0 ); // $ExpectError
153
- dsnannsumors.ndarray( x.length, null, 1, 0, out, 1, 0 ); // $ExpectError
154
- dsnannsumors.ndarray( x.length, undefined, 1, 0, out, 1, 0 ); // $ExpectError
155
- dsnannsumors.ndarray( x.length, [ '1' ], 1, 0, out, 1, 0 ); // $ExpectError
156
- dsnannsumors.ndarray( x.length, {}, 1, 0, out, 1, 0 ); // $ExpectError
157
- dsnannsumors.ndarray( x.length, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError
158
- }
159
-
160
- // The compiler throws an error if the `ndarray` method is provided a third argument which is not a number...
161
- {
162
- const x = new Float32Array( 10 );
163
- const out = new Float64Array( 2 );
164
-
165
- dsnannsumors.ndarray( x.length, x, '10', 0, out, 1, 0 ); // $ExpectError
166
- dsnannsumors.ndarray( x.length, x, true, 0, out, 1, 0 ); // $ExpectError
167
- dsnannsumors.ndarray( x.length, x, false, 0, out, 1, 0 ); // $ExpectError
168
- dsnannsumors.ndarray( x.length, x, null, 0, out, 1, 0 ); // $ExpectError
169
- dsnannsumors.ndarray( x.length, x, undefined, 0, out, 1, 0 ); // $ExpectError
170
- dsnannsumors.ndarray( x.length, x, [], 0, out, 1, 0 ); // $ExpectError
171
- dsnannsumors.ndarray( x.length, x, {}, 0, out, 1, 0 ); // $ExpectError
172
- dsnannsumors.ndarray( x.length, x, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError
173
- }
174
-
175
- // The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number...
176
- {
177
- const x = new Float32Array( 10 );
178
- const out = new Float64Array( 2 );
179
-
180
- dsnannsumors.ndarray( x.length, x, 1, '10', out, 1, 0 ); // $ExpectError
181
- dsnannsumors.ndarray( x.length, x, 1, true, out, 1, 0 ); // $ExpectError
182
- dsnannsumors.ndarray( x.length, x, 1, false, out, 1, 0 ); // $ExpectError
183
- dsnannsumors.ndarray( x.length, x, 1, null, out, 1, 0 ); // $ExpectError
184
- dsnannsumors.ndarray( x.length, x, 1, undefined, out, 1, 0 ); // $ExpectError
185
- dsnannsumors.ndarray( x.length, x, 1, [], out, 1, 0 ); // $ExpectError
186
- dsnannsumors.ndarray( x.length, x, 1, {}, out, 1, 0 ); // $ExpectError
187
- dsnannsumors.ndarray( x.length, x, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError
188
- }
189
-
190
- // The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a Float64Array...
191
- {
192
- const x = new Float32Array( 10 );
193
-
194
- dsnannsumors.ndarray( x.length, x, 1, 0, 10, 1, 0 ); // $ExpectError
195
- dsnannsumors.ndarray( x.length, x, 1, 0, '10', 1, 0 ); // $ExpectError
196
- dsnannsumors.ndarray( x.length, x, 1, 0, true, 1, 0 ); // $ExpectError
197
- dsnannsumors.ndarray( x.length, x, 1, 0, false, 1, 0 ); // $ExpectError
198
- dsnannsumors.ndarray( x.length, x, 1, 0, null, 1, 0 ); // $ExpectError
199
- dsnannsumors.ndarray( x.length, x, 1, 0, undefined, 1, 0 ); // $ExpectError
200
- dsnannsumors.ndarray( x.length, x, 1, 0, [ '1' ], 1, 0 ); // $ExpectError
201
- dsnannsumors.ndarray( x.length, x, 1, 0, {}, 1, 0 ); // $ExpectError
202
- dsnannsumors.ndarray( x.length, x, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError
203
- }
204
-
205
- // The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number...
206
- {
207
- const x = new Float32Array( 10 );
208
- const out = new Float64Array( 2 );
209
-
210
- dsnannsumors.ndarray( x.length, x, 1, 0, out, '10', 0 ); // $ExpectError
211
- dsnannsumors.ndarray( x.length, x, 1, 0, out, true, 0 ); // $ExpectError
212
- dsnannsumors.ndarray( x.length, x, 1, 0, out, false, 0 ); // $ExpectError
213
- dsnannsumors.ndarray( x.length, x, 1, 0, out, null, 0 ); // $ExpectError
214
- dsnannsumors.ndarray( x.length, x, 1, 0, out, undefined, 0 ); // $ExpectError
215
- dsnannsumors.ndarray( x.length, x, 1, 0, out, [], 0 ); // $ExpectError
216
- dsnannsumors.ndarray( x.length, x, 1, 0, out, {}, 0 ); // $ExpectError
217
- dsnannsumors.ndarray( x.length, x, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError
218
- }
219
-
220
- // The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number...
221
- {
222
- const x = new Float32Array( 10 );
223
- const out = new Float64Array( 2 );
224
-
225
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, '10' ); // $ExpectError
226
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, true ); // $ExpectError
227
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, false ); // $ExpectError
228
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, null ); // $ExpectError
229
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, undefined ); // $ExpectError
230
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, [] ); // $ExpectError
231
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, {} ); // $ExpectError
232
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError
233
- }
234
-
235
- // The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
236
- {
237
- const x = new Float32Array( 10 );
238
- const out = new Float64Array( 2 );
239
-
240
- dsnannsumors.ndarray(); // $ExpectError
241
- dsnannsumors.ndarray( x.length ); // $ExpectError
242
- dsnannsumors.ndarray( x.length, x ); // $ExpectError
243
- dsnannsumors.ndarray( x.length, x, 1 ); // $ExpectError
244
- dsnannsumors.ndarray( x.length, x, 1, 0 ); // $ExpectError
245
- dsnannsumors.ndarray( x.length, x, 1, 0, out ); // $ExpectError
246
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1 ); // $ExpectError
247
- dsnannsumors.ndarray( x.length, x, 1, 0, out, 1, 0, 10 ); // $ExpectError
248
- }