From 9b4c596f8a35f5b4154acab0a0ab491e82b9cfc8 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Tue, 17 Dec 2024 03:02:17 +0000 Subject: [PATCH] Update artifacts --- array/fixed-endian-factory/coverage.ndjson | 1 + .../from_iterator.js.html | 2 +- .../from_iterator_map.js.html | 2 +- array/fixed-endian-factory/index.html | 22 +- array/fixed-endian-factory/index.js.html | 2 +- array/fixed-endian-factory/main.js.html | 35 +- assert/is-same-array/coverage.ndjson | 1 + assert/is-same-array/index.html | 4 +- assert/is-same-array/index.js.html | 4 +- assert/is-same-array/main.js.html | 4 +- blas/ext/base/gapxsumors/coverage.ndjson | 1 + blas/ext/base/gapxsumors/index.html | 146 ++++ blas/ext/base/gapxsumors/index.js.html | 265 +++++++ blas/ext/base/gapxsumors/main.js.html | 283 +++++++ blas/ext/base/gapxsumors/ndarray.js.html | 280 +++++++ iter/strided/coverage.ndjson | 1 + iter/strided/index.html | 131 ++++ iter/strided/index.js.html | 244 +++++++ iter/strided/main.js.html | 688 ++++++++++++++++++ .../is-nonpositive-finite/coverage.ndjson | 1 + .../assert/is-nonpositive-finite/index.html | 2 +- .../is-nonpositive-finite/index.js.html | 2 +- .../assert/is-nonpositive-finite/main.js.html | 2 +- .../is-nonpositive-finite/native.js.html | 2 +- .../base/special/kernel-log1p/coverage.ndjson | 1 + math/base/special/kernel-log1p/index.html | 2 +- math/base/special/kernel-log1p/index.js.html | 2 +- math/base/special/kernel-log1p/main.js.html | 2 +- math/base/special/kernel-log1p/native.js.html | 2 +- .../special/kernel-log1p/polyval_p.js.html | 2 +- .../special/kernel-log1p/polyval_q.js.html | 2 +- math/base/special/rcbrt/coverage.ndjson | 1 + math/base/special/rcbrt/index.html | 2 +- math/base/special/rcbrt/index.js.html | 2 +- math/base/special/rcbrt/main.js.html | 2 +- math/base/special/rcbrt/native.js.html | 2 +- .../special/ahavercos-by/coverage.ndjson | 1 + math/strided/special/ahavercos-by/index.html | 2 +- .../special/ahavercos-by/index.js.html | 2 +- .../strided/special/ahavercos-by/main.js.html | 2 +- .../special/ahavercos-by/ndarray.js.html | 2 +- random/array/weibull/coverage.ndjson | 1 + random/array/weibull/factory.js.html | 4 +- random/array/weibull/index.html | 4 +- random/array/weibull/index.js.html | 4 +- random/array/weibull/main.js.html | 4 +- string/base/first-code-point/coverage.ndjson | 1 + string/base/first-code-point/index.html | 4 +- string/base/first-code-point/index.js.html | 4 +- string/base/first-code-point/main.js.html | 4 +- .../first-grapheme-cluster/coverage.ndjson | 1 + string/base/first-grapheme-cluster/index.html | 4 +- .../base/first-grapheme-cluster/index.js.html | 4 +- .../base/first-grapheme-cluster/main.js.html | 4 +- utils/some-own-by/coverage.ndjson | 1 + utils/some-own-by/index.html | 2 +- utils/some-own-by/index.js.html | 2 +- utils/some-own-by/main.js.html | 2 +- 58 files changed, 2138 insertions(+), 68 deletions(-) create mode 100644 blas/ext/base/gapxsumors/coverage.ndjson create mode 100644 blas/ext/base/gapxsumors/index.html create mode 100644 blas/ext/base/gapxsumors/index.js.html create mode 100644 blas/ext/base/gapxsumors/main.js.html create mode 100644 blas/ext/base/gapxsumors/ndarray.js.html create mode 100644 iter/strided/coverage.ndjson create mode 100644 iter/strided/index.html create mode 100644 iter/strided/index.js.html create mode 100644 iter/strided/main.js.html diff --git a/array/fixed-endian-factory/coverage.ndjson b/array/fixed-endian-factory/coverage.ndjson index 05fb99bc7..ff0803a44 100644 --- a/array/fixed-endian-factory/coverage.ndjson +++ b/array/fixed-endian-factory/coverage.ndjson @@ -17,3 +17,4 @@ [1131,1388,81.4841,142,152,93.4211,21,32,65.625,1131,1388,81.4841,"a0ba090515dfdfe617e1179ddb7581db24fec44b","2024-12-01 21:32:50 -0500"] [1132,1383,81.851,142,154,92.2078,22,32,68.75,1132,1383,81.851,"e5d32c53f8f552fae4d672c8750619a59ce078ac","2024-12-03 09:04:02 -0500"] [1174,1425,82.386,155,167,92.8144,23,33,69.697,1174,1425,82.386,"1d10ce5163bb06f0b93f6dc0ef9697a8336054c2","2024-12-04 08:53:48 -0500"] +[1181,1432,82.4721,155,167,92.8144,23,33,69.697,1181,1432,82.4721,"b741528b1560b787e3f59e4b17dd7ccb081bf642","2024-12-17 02:58:20 +0000"] diff --git a/array/fixed-endian-factory/from_iterator.js.html b/array/fixed-endian-factory/from_iterator.js.html index 5cc722c06..b2f53b27a 100644 --- a/array/fixed-endian-factory/from_iterator.js.html +++ b/array/fixed-endian-factory/from_iterator.js.html @@ -214,7 +214,7 @@

All files / array/fix + + + + + + \ No newline at end of file diff --git a/blas/ext/base/gapxsumors/index.js.html b/blas/ext/base/gapxsumors/index.js.html new file mode 100644 index 000000000..d86363d48 --- /dev/null +++ b/blas/ext/base/gapxsumors/index.js.html @@ -0,0 +1,265 @@ + + + + + + Code coverage report for blas/ext/base/gapxsumors/lib/index.js + + + + + + + + + +
+
+

All files / blas/ext/base/gapxsumors/lib index.js

+
+ +
+ 100% + Statements + 60/60 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 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 +612x +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 +2x +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';
+ 
+/**
+* Add a constant to each strided array element and compute the sum using ordinary recursive summation.
+*
+* @module @stdlib/blas/ext/base/gapxsumors
+*
+* @example
+* var gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' );
+*
+* var x = [ 1.0, -2.0, 2.0 ];
+* var N = x.length;
+*
+* var v = gapxsumors( N, 5.0, x, 1 );
+* // returns 16.0
+*
+* @example
+* var floor = require( '@stdlib/math/base/special/floor' );
+* var gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' );
+*
+* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
+* var N = floor( x.length / 2 );
+*
+* var v = gapxsumors.ndarray( N, 5.0, x, 2, 1 );
+* // returns 25.0
+*/
+ 
+// MODULES //
+ 
+var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var main = require( './main.js' );
+var ndarray = require( './ndarray.js' );
+ 
+ 
+// MAIN //
+ 
+setReadOnly( main, 'ndarray', ndarray );
+ 
+ 
+// EXPORTS //
+ 
+module.exports = main;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/ext/base/gapxsumors/main.js.html b/blas/ext/base/gapxsumors/main.js.html new file mode 100644 index 000000000..2bdac45af --- /dev/null +++ b/blas/ext/base/gapxsumors/main.js.html @@ -0,0 +1,283 @@ + + + + + + Code coverage report for blas/ext/base/gapxsumors/lib/main.js + + + + + + + + + +
+
+

All files / blas/ext/base/gapxsumors/lib main.js

+
+ +
+ 100% + Statements + 66/66 +
+ + +
+ 100% + Branches + 12/12 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 66/66 +
+ + +
+

+ 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 +672x +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 +12x +12x +12x +12x +12x +12x +2x +2x +12x +2x +2x +12x +1x +12x +7x +7x +8x +12x +35x +35x +35x +8x +12x +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';
+ 
+// MAIN //
+ 
+/**
+* Adds a constant to each strided array element and computes the sum using ordinary recursive summation.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {number} alpha - constant
+* @param {NumericArray} x - input array
+* @param {integer} stride - stride length
+* @returns {number} sum
+*
+* @example
+* var x = [ 1.0, -2.0, 2.0 ];
+* var N = x.length;
+*
+* var v = gapxsumors( N, 5.0, x, 1 );
+* // returns 16.0
+*/
+function gapxsumors( N, alpha, x, stride ) {
+	var sum;
+	var ix;
+	var i;
+ 
+	if ( N <= 0 ) {
+		return 0.0;
+	}
+	if ( N === 1 || stride === 0 ) {
+		return alpha + x[ 0 ];
+	}
+	if ( stride < 0 ) {
+		ix = (1-N) * stride;
+	} else {
+		ix = 0;
+	}
+	sum = 0.0;
+	for ( i = 0; i < N; i++ ) {
+		sum += alpha + x[ ix ];
+		ix += stride;
+	}
+	return sum;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = gapxsumors;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/ext/base/gapxsumors/ndarray.js.html b/blas/ext/base/gapxsumors/ndarray.js.html new file mode 100644 index 000000000..de8c6c3b2 --- /dev/null +++ b/blas/ext/base/gapxsumors/ndarray.js.html @@ -0,0 +1,280 @@ + + + + + + Code coverage report for blas/ext/base/gapxsumors/lib/ndarray.js + + + + + + + + + +
+
+

All files / blas/ext/base/gapxsumors/lib ndarray.js

+
+ +
+ 100% + Statements + 65/65 +
+ + +
+ 100% + Branches + 9/9 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 65/65 +
+ + +
+

+ 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 +663x +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 +12x +12x +12x +12x +12x +12x +2x +2x +12x +2x +2x +8x +8x +12x +35x +35x +35x +8x +12x +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';
+ 
+// MAIN //
+ 
+/**
+* Adds a constant to each strided array element and computes the sum using ordinary recursive summation.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {number} alpha - constant
+* @param {NumericArray} x - input array
+* @param {integer} stride - stride length
+* @param {NonNegativeInteger} offset - starting index
+* @returns {number} sum
+*
+* @example
+* var floor = require( '@stdlib/math/base/special/floor' );
+*
+* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
+* var N = floor( x.length / 2 );
+*
+* var v = gapxsumors( N, 5.0, x, 2, 1 );
+* // returns 25.0
+*/
+function gapxsumors( N, alpha, x, stride, offset ) {
+	var sum;
+	var ix;
+	var i;
+ 
+	if ( N <= 0 ) {
+		return 0.0;
+	}
+	if ( N === 1 || stride === 0 ) {
+		return alpha + x[ offset ];
+	}
+	ix = offset;
+	sum = 0.0;
+	for ( i = 0; i < N; i++ ) {
+		sum += alpha + x[ ix ];
+		ix += stride;
+	}
+	return sum;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = gapxsumors;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/iter/strided/coverage.ndjson b/iter/strided/coverage.ndjson new file mode 100644 index 000000000..1e704055b --- /dev/null +++ b/iter/strided/coverage.ndjson @@ -0,0 +1 @@ +[254,254,100,40,40,100,4,4,100,254,254,100,"b741528b1560b787e3f59e4b17dd7ccb081bf642","2024-12-17 02:58:20 +0000"] diff --git a/iter/strided/index.html b/iter/strided/index.html new file mode 100644 index 000000000..1d6de5585 --- /dev/null +++ b/iter/strided/index.html @@ -0,0 +1,131 @@ + + + + + + Code coverage report for iter/strided/lib + + + + + + + + + +
+
+

All files iter/strided/lib

+
+ +
+ 100% + Statements + 254/254 +
+ + +
+ 100% + Branches + 40/40 +
+ + +
+ 100% + Functions + 4/4 +
+ + +
+ 100% + Lines + 254/254 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
index.js +
+
100%53/53100%1/1100%0/0100%53/53
main.js +
+
100%201/201100%39/39100%4/4100%201/201
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/iter/strided/index.js.html b/iter/strided/index.js.html new file mode 100644 index 000000000..747278cef --- /dev/null +++ b/iter/strided/index.js.html @@ -0,0 +1,244 @@ + + + + + + Code coverage report for iter/strided/lib/index.js + + + + + + + + + +
+
+

All files / iter/strided/lib index.js

+
+ +
+ 100% + Statements + 53/53 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 53/53 +
+ + +
+

+ 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 +541x +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 +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2019 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';
+ 
+/**
+* Create an iterator which steps by a specified amount.
+*
+* @module @stdlib/iter/strided
+*
+* @example
+* var array2iterator = require( '@stdlib/array/to-iterator' );
+* var iterStrided = require( '@stdlib/iter/strided' );
+*
+* var arr = array2iterator( [ 0, 1, 2, 3, 4, 5, 6, 7 ] );
+*
+* var iter = iterStrided( arr, 2, 1 );
+*
+* var r = iter.next().value;
+* // returns 1
+*
+* r = iter.next().value;
+* // returns 3
+*
+* r = iter.next().value;
+* // returns 5
+*
+* // ...
+*/
+ 
+// MODULES //
+ 
+var main = require( './main.js' );
+ 
+ 
+// EXPORTS //
+ 
+module.exports = main;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/iter/strided/main.js.html b/iter/strided/main.js.html new file mode 100644 index 000000000..44afc2fce --- /dev/null +++ b/iter/strided/main.js.html @@ -0,0 +1,688 @@ + + + + + + Code coverage report for iter/strided/lib/main.js + + + + + + + + + +
+
+

All files / iter/strided/lib main.js

+
+ +
+ 100% + Statements + 201/201 +
+ + +
+ 100% + Branches + 39/39 +
+ + +
+ 100% + Functions + 4/4 +
+ + +
+ 100% + Lines + 201/201 +
+ + +
+

+ 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 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +2027x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +7x +114x +114x +114x +114x +114x +114x +114x +114x +114x +114x +30x +30x +114x +36x +36x +114x +14x +11x +11x +3x +3x +114x +26x +11x +11x +15x +26x +8x +8x +7x +34x +8x +8x +8x +114x +4x +12x +12x +1x +1x +1x +1x +12x +4x +4x +114x +14x +14x +18x +18x +18x +18x +18x +18x +114x +12x +12x +12x +18x +18x +18x +18x +18x +18x +18x +18x +18x +173x +173x +3x +1x +1x +1x +1x +2x +2x +2x +2x +170x +173x +957x +957x +3x +3x +3x +954x +954x +167x +167x +173x +1x +1x +167x +173x +18x +18x +18x +18x +18x +18x +18x +18x +18x +2x +2x +1x +1x +1x +1x +1x +1x +1x +1x +2x +18x +18x +18x +18x +18x +18x +18x +18x +4x +4x +114x +7x +7x +7x +7x +7x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2019 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
+var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' );
+var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
+var isFunction = require( '@stdlib/assert/is-function' );
+var isIteratorLike = require( '@stdlib/assert/is-iterator-like' );
+var iteratorSymbol = require( '@stdlib/symbol/iterator' );
+var format = require( '@stdlib/string/format' );
+ 
+ 
+// VARIABLES //
+ 
+var DEFAULT_OFFSET = 0;
+var DEFAULT_EAGER = false;
+ 
+ 
+// MAIN //
+ 
+/**
+* Returns an iterator which steps by a specified amount.
+*
+* @param {Iterator} iterator - input iterator
+* @param {PositiveInteger} stride - stride
+* @param {NonNegativeInteger} [offset=0] - offset
+* @param {boolean} [eager=false] - boolean indicating whether to eagerly advance the input iterator when provided a non-zero offset
+* @throws {TypeError} first argument must be an iterator protocol-compliant object
+* @throws {TypeError} second argument must be a positive integer
+* @throws {TypeError} third argument must be a nonnegative integer
+* @throws {TypeError} fourth argument must be a boolean
+* @returns {Iterator} iterator
+*
+* @example
+* var array2iterator = require( '@stdlib/array/to-iterator' );
+*
+* var arr = array2iterator( [ 0, 1, 2, 3, 4, 5, 6, 7 ] );
+*
+* var iter = iterStrided( arr, 2, 1 );
+*
+* var r = iter.next().value;
+* // returns 1
+*
+* r = iter.next().value;
+* // returns 3
+*
+* r = iter.next().value;
+* // returns 5
+*
+* // ...
+*/
+function iterStrided( iterator, stride, offset, eager ) {
+	var iter;
+	var bool;
+	var FLG;
+	var idx;
+	var ret;
+	var o;
+	var v;
+	var i;
+	if ( !isIteratorLike( iterator ) ) {
+		throw new TypeError( format( 'invalid argument. First argument must be an iterator protocol-compliant object. Value: `%s`.', iterator ) );
+	}
+	if ( !isPositiveInteger( stride ) ) {
+		throw new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', stride ) );
+	}
+	if ( arguments.length === 3 ) {
+		if ( !isNonNegativeInteger( offset ) ) {
+			throw new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', offset ) );
+		}
+		idx = offset;
+		bool = DEFAULT_EAGER;
+	} else if ( arguments.length > 3 ) {
+		if ( !isNonNegativeInteger( offset ) ) {
+			throw new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', offset ) );
+		}
+		idx = offset;
+		if ( !isBoolean( eager ) ) {
+			throw new TypeError( format( 'invalid argument. Fourth argument must be a boolean. Value: `%s`.', eager ) );
+		}
+		bool = eager;
+	} else {
+		idx = DEFAULT_OFFSET;
+		bool = DEFAULT_EAGER;
+	}
+	if ( bool ) {
+		for ( i = 0; i < idx; i++ ) {
+			v = iterator.next();
+			if ( v.done ) {
+				FLG = true;
+				ret = v;
+				break;
+			}
+		}
+		// NOTE: if we've successfully advanced the input iterator, `i` is currently equal to `idx` (i.e., the offset)
+		i -= 1;
+	} else {
+		i = -1;
+	}
+	// Create an iterator protocol-compliant object:
+	iter = {};
+	setReadOnly( iter, 'next', next );
+	setReadOnly( iter, 'return', end );
+ 
+	// If an environment supports `Symbol.iterator` and the provided iterator is iterable, make the iterator iterable:
+	if ( iteratorSymbol && isFunction( iterator[ iteratorSymbol ] ) ) {
+		o = idx;
+		setReadOnly( iter, iteratorSymbol, factory );
+	}
+	return iter;
+ 
+	/**
+	* Returns an iterator protocol-compliant object containing the next iterated value.
+	*
+	* @private
+	* @returns {Object} iterator protocol-compliant object
+	*/
+	function next() {
+		var v;
+		if ( FLG ) {
+			if ( ret ) {
+				v = ret;
+				ret = null;
+				return v;
+			}
+			return {
+				'done': true
+			};
+		}
+		i += 1;
+		while ( i < idx ) {
+			v = iterator.next();
+			if ( v.done ) {
+				FLG = true;
+				return v;
+			}
+			i += 1;
+		}
+		idx += stride;
+		v = iterator.next();
+		if ( v.done ) {
+			FLG = true;
+		}
+		return v;
+	}
+ 
+	/**
+	* Finishes an iterator.
+	*
+	* @private
+	* @param {*} [value] - value to return
+	* @returns {Object} iterator protocol-compliant object
+	*/
+	function end( value ) {
+		FLG = true;
+		if ( arguments.length ) {
+			return {
+				'value': value,
+				'done': true
+			};
+		}
+		return {
+			'done': true
+		};
+	}
+ 
+	/**
+	* Returns a new iterator.
+	*
+	* @private
+	* @returns {Iterator} iterator
+	*/
+	function factory() {
+		return iterStrided( iterator[ iteratorSymbol ](), stride, o, bool );
+	}
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = iterStrided;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/math/base/assert/is-nonpositive-finite/coverage.ndjson b/math/base/assert/is-nonpositive-finite/coverage.ndjson index bcf98ab8a..2294211a1 100644 --- a/math/base/assert/is-nonpositive-finite/coverage.ndjson +++ b/math/base/assert/is-nonpositive-finite/coverage.ndjson @@ -1,3 +1,4 @@ [107,107,100,4,4,100,1,1,100,107,107,100,"1b163e9c6c6d81533a9418206e349df3bfca3858","2023-08-19 21:48:51 -0400"] [158,158,100,6,6,100,2,2,100,158,158,100,"f9cbee7fb312af11b695ff8829401acf81609813","2024-03-13 22:33:08 -0400"] [158,158,100,6,6,100,2,2,100,158,158,100,"d27da5ddf7d6acb8da8c4f7bdee5a05df139329e","2024-03-16 21:26:17 -0400"] +[158,158,100,6,6,100,2,2,100,158,158,100,"b741528b1560b787e3f59e4b17dd7ccb081bf642","2024-12-17 02:58:20 +0000"] diff --git a/math/base/assert/is-nonpositive-finite/index.html b/math/base/assert/is-nonpositive-finite/index.html index e5f64d1b0..9e03e9a57 100644 --- a/math/base/assert/is-nonpositive-finite/index.html +++ b/math/base/assert/is-nonpositive-finite/index.html @@ -131,7 +131,7 @@

All files math/base/assert/is-nonpos