diff --git a/base/flipud3d/README.md b/base/flipud3d/README.md
new file mode 100644
index 00000000..2cf27c6a
--- /dev/null
+++ b/base/flipud3d/README.md
@@ -0,0 +1,110 @@
+
+
+# flipud3d
+
+> Reverse the order of elements along the second-to-last dimension of a three-dimensional nested input array.
+
+
+
+
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var flipud3d = require( '@stdlib/array/base/flipud3d' );
+```
+
+#### flipud3d( x )
+
+Reverses the order of elements along the second-to-last dimension of a three-dimensional nested input array.
+
+```javascript
+var out = flipud3d( [ [ [ 1, 2 ], [ 3, 4 ] ] ] );
+// returns [ [ [ 3, 4 ], [ 1, 2 ] ] ]
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
+var filled3dBy = require( '@stdlib/array/base/filled3d-by' );
+var flipud3d = require( '@stdlib/array/base/flipud3d' );
+
+var x = filled3dBy( [ 3, 3, 3 ], discreteUniform( -50, 50 ) );
+console.log( x );
+
+var y = flipud3d( x );
+console.log( y );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/base/flipud3d/benchmark/benchmark.size.js b/base/flipud3d/benchmark/benchmark.size.js
new file mode 100644
index 00000000..6c561261
--- /dev/null
+++ b/base/flipud3d/benchmark/benchmark.size.js
@@ -0,0 +1,110 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 bench = require( '@stdlib/bench' );
+var uniform = require( '@stdlib/random/base/uniform' ).factory;
+var isnan = require( '@stdlib/math/base/assert/is-nan' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var floor = require( '@stdlib/math/base/special/floor' );
+var filled3dBy = require( './../../../base/filled3d-by' );
+var numel = require( '@stdlib/ndarray/base/numel' );
+var pkg = require( './../package.json' ).name;
+var flipud3d = require( './../lib' );
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveIntegerArray} shape - array shape
+* @returns {Function} benchmark function
+*/
+function createBenchmark( shape ) {
+ var x = filled3dBy( shape, uniform( -100.0, 100.0 ) );
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var out;
+ var i0;
+ var i1;
+ var i2;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ out = flipud3d( x );
+ i2 = i % shape[ 0 ];
+ i1 = i % shape[ 1 ];
+ i0 = i % shape[ 2 ];
+ if ( isnan( out[ i2 ][ i1 ][ i0 ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+
+ i2 = i % shape[ 0 ];
+ i1 = i % shape[ 1 ];
+ i0 = i % shape[ 2 ];
+ if ( isnan( out[ i2 ][ i1 ][ i0 ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+/**
+* Main execution sequence.
+*
+* @private
+*/
+function main() {
+ var min;
+ var max;
+ var sh;
+ var N;
+ var f;
+ var i;
+
+ min = 1; // 10^min
+ max = 6; // 10^max
+
+ for ( i = min; i <= max; i++ ) {
+ N = floor( pow( pow( 10, i ), 1.0/3.0 ) );
+ sh = [ N, N, N ];
+ f = createBenchmark( sh );
+ bench( pkg+'::equidimensional:size='+numel( sh ), f );
+ }
+}
+
+main();
diff --git a/base/flipud3d/docs/repl.txt b/base/flipud3d/docs/repl.txt
new file mode 100644
index 00000000..dc7f36ca
--- /dev/null
+++ b/base/flipud3d/docs/repl.txt
@@ -0,0 +1,25 @@
+
+{{alias}}( x )
+ Reverses the order of elements along the second-to-last dimension of a
+ three-dimensional nested input array.
+
+ The function does *not* perform a deep copy of nested array elements.
+
+ Parameters
+ ----------
+ x: ArrayLikeObject
+ Input nested array.
+
+ Returns
+ -------
+ out: Array
+ Output array.
+
+ Examples
+ --------
+ > var out = {{alias}}( [ [ [ 1, 2 ], [ 3, 4 ] ] ] )
+ [ [ [ 3, 4 ], [ 1, 2 ] ] ]
+
+ See Also
+ --------
+
diff --git a/base/flipud3d/docs/types/index.d.ts b/base/flipud3d/docs/types/index.d.ts
new file mode 100644
index 00000000..4449210c
--- /dev/null
+++ b/base/flipud3d/docs/types/index.d.ts
@@ -0,0 +1,46 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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.
+*/
+
+// TypeScript Version: 4.1
+
+///
+
+import { Array3D } from '@stdlib/types/array';
+
+/**
+* Reverses the order of elements along the second-to-last dimension of a three-dimensional nested input array.
+*
+* ## Notes
+*
+* - The function does **not** perform a deep copy of nested array elements.
+*
+* @param x - input nested array
+* @returns output array
+*
+* @example
+* var x = [ [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ];
+*
+* var out = flipud3d( x );
+* // returns [ [ [ 5, 6 ], [ 3, 4 ], [ 1, 2 ] ] ]
+*/
+declare function flipud3d( x: Array3D ): Array3D;
+
+
+// EXPORTS //
+
+export = flipud3d;
diff --git a/base/flipud3d/docs/types/test.ts b/base/flipud3d/docs/types/test.ts
new file mode 100644
index 00000000..3acc220e
--- /dev/null
+++ b/base/flipud3d/docs/types/test.ts
@@ -0,0 +1,48 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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.
+*/
+
+import flipud3d = require( './index' );
+
+
+// TESTS //
+
+// The function returns a nested array...
+{
+ const x = [ [ [ 1, 2 ], [ 3, 4 ] ] ];
+
+ flipud3d( x ); // $ExpectType Array3D
+}
+
+// The compiler throws an error if the function is provided a first argument which is not a nested array...
+{
+ flipud3d( 'abc' ); // $ExpectError
+ flipud3d( 1 ); // $ExpectError
+ flipud3d( true ); // $ExpectError
+ flipud3d( false ); // $ExpectError
+ flipud3d( null ); // $ExpectError
+ flipud3d( {} ); // $ExpectError
+ flipud3d( ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = [ [ [ 1, 2 ], [ 3, 4 ] ] ];
+
+ flipud3d(); // $ExpectError
+ flipud3d( x, 2 ); // $ExpectError
+}
diff --git a/base/flipud3d/examples/index.js b/base/flipud3d/examples/index.js
new file mode 100644
index 00000000..3c2dd04c
--- /dev/null
+++ b/base/flipud3d/examples/index.js
@@ -0,0 +1,29 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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';
+
+var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
+var filled3dBy = require( './../../../base/filled3d-by' );
+var flipud3d = require( './../lib' );
+
+var x = filled3dBy( [ 3, 3, 3 ], discreteUniform( -50, 50 ) );
+console.log( x );
+
+var y = flipud3d( x );
+console.log( y );
diff --git a/base/flipud3d/lib/index.js b/base/flipud3d/lib/index.js
new file mode 100644
index 00000000..4006751f
--- /dev/null
+++ b/base/flipud3d/lib/index.js
@@ -0,0 +1,42 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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';
+
+/**
+* Reverse the order of elements along the second-to-last dimension of a three-dimensional nested input array.
+*
+* @module @stdlib/array/base/flipud3d
+*
+* @example
+* var flipud = require( '@stdlib/array/base/flipud3d' );
+*
+* var x = [ [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ];
+*
+* var out = flipud3d( x );
+* // returns [ [ [ 5, 6 ], [ 3, 4 ], [ 1, 2 ] ] ]
+*/
+
+// MODULES //
+
+var main = require( './main.js' );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/base/flipud3d/lib/main.js b/base/flipud3d/lib/main.js
new file mode 100644
index 00000000..8967d6be
--- /dev/null
+++ b/base/flipud3d/lib/main.js
@@ -0,0 +1,58 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 flipud2d = require( './../../../base/flipud2d' );
+
+
+// MAIN //
+
+/**
+* Reverses the order of elements along the second-to-last dimension of a three-dimensional nested input array.
+*
+* ## Notes
+*
+* - The function does **not** perform a deep copy of nested array elements.
+*
+* @param {ArrayLikeObject>} x - nested input array
+* @returns {Array>} output array
+*
+* @example
+* var x = [ [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ];
+*
+* var out = flipud3d( x );
+* // returns [ [ [ 5, 6 ], [ 3, 4 ], [ 1, 2 ] ] ]
+*/
+function flipud3d( x ) {
+ var out;
+ var i;
+
+ out = [];
+ for ( i = 0; i < x.length; i++ ) {
+ out.push( flipud2d( x[ i ] ) );
+ }
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = flipud3d;
diff --git a/base/flipud3d/package.json b/base/flipud3d/package.json
new file mode 100644
index 00000000..fe5c6852
--- /dev/null
+++ b/base/flipud3d/package.json
@@ -0,0 +1,66 @@
+{
+ "name": "@stdlib/array/base/flipud3d",
+ "version": "0.0.0",
+ "description": "Reverse the order of elements along the second-to-last dimension of a three-dimensional nested input array.",
+ "license": "Apache-2.0",
+ "author": {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ },
+ "contributors": [
+ {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ }
+ ],
+ "main": "./lib",
+ "directories": {
+ "benchmark": "./benchmark",
+ "doc": "./docs",
+ "example": "./examples",
+ "lib": "./lib",
+ "test": "./test"
+ },
+ "types": "./docs/types",
+ "scripts": {},
+ "homepage": "https://github.com/stdlib-js/stdlib",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/stdlib-js/stdlib.git"
+ },
+ "bugs": {
+ "url": "https://github.com/stdlib-js/stdlib/issues"
+ },
+ "dependencies": {},
+ "devDependencies": {},
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "keywords": [
+ "stdlib",
+ "utilities",
+ "utils",
+ "generic",
+ "array",
+ "flip",
+ "reverse",
+ "transform",
+ "rotate",
+ "3d",
+ "matrix",
+ "ndarray",
+ "multidimensional"
+ ]
+}
diff --git a/base/flipud3d/test/test.js b/base/flipud3d/test/test.js
new file mode 100644
index 00000000..40b81c2d
--- /dev/null
+++ b/base/flipud3d/test/test.js
@@ -0,0 +1,161 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 tape = require( 'tape' );
+var flipud3d = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof flipud3d, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function reverses the order of elements along the second-to-last dimension', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ x = [
+ [
+ [ 1, 2 ],
+ [ 3, 4 ]
+ ],
+ [
+ [ 1, 2 ],
+ [ 3, 4 ]
+ ]
+ ];
+ expected = [
+ [
+ [ 3, 4 ],
+ [ 1, 2 ]
+ ],
+ [
+ [ 3, 4 ],
+ [ 1, 2 ]
+ ]
+ ];
+ actual = flipud3d( x );
+ t.notEqual( actual, x, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ x = [
+ [
+ [ 1, 2, 3, 4 ],
+ [ 5, 6, 7, 8 ],
+ [ 9, 10, 11, 12 ]
+ ]
+ ];
+ expected = [
+ [
+ [ 9, 10, 11, 12 ],
+ [ 5, 6, 7, 8 ],
+ [ 1, 2, 3, 4 ]
+ ]
+ ];
+ actual = flipud3d( x );
+ t.notEqual( actual, x, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ x = [
+ [
+ [ 1 ],
+ [ 2 ],
+ [ 3 ],
+ [ 4 ]
+ ]
+ ];
+ expected = [
+ [
+ [ 4 ],
+ [ 3 ],
+ [ 2 ],
+ [ 1 ]
+ ]
+ ];
+ actual = flipud3d( x );
+ t.notEqual( actual, x, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns empty arrays if provided an array whose first dimension has a length equal to zero', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ expected = [];
+
+ x = [];
+ actual = flipud3d( x );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns empty arrays if provided an array whose second dimension has a length equal to zero', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ expected = [
+ [],
+ []
+ ];
+
+ x = [
+ [],
+ []
+ ];
+ actual = flipud3d( x );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns empty arrays if provided an array whose third dimension has a length equal to zero', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ expected = [
+ [
+ [],
+ []
+ ]
+ ];
+
+ x = [
+ [
+ [],
+ []
+ ]
+ ];
+ actual = flipud3d( x );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
diff --git a/base/lib/index.js b/base/lib/index.js
index 32064aad..8bea9cd3 100644
--- a/base/lib/index.js
+++ b/base/lib/index.js
@@ -540,6 +540,15 @@ setReadOnly( ns, 'fliplr5d', require( './../../base/fliplr5d' ) );
*/
setReadOnly( ns, 'flipud2d', require( './../../base/flipud2d' ) );
+/**
+* @name flipud3d
+* @memberof ns
+* @readonly
+* @type {Function}
+* @see {@link module:@stdlib/array/base/flipud3d}
+*/
+setReadOnly( ns, 'flipud3d', require( './../../base/flipud3d' ) );
+
/**
* @name strided2array
* @memberof ns
diff --git a/dist/index.js b/dist/index.js
index 5d117c43..ab49cb24 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,4 +1,4 @@
-"use strict";var l=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var yi=l(function(UO,gi){"use strict";var pi="function";function ph(r){return typeof r.get===pi&&typeof r.set===pi}gi.exports=ph});var J=l(function(DO,di){"use strict";var gh=yi();di.exports=gh});var xi=l(function(GO,hi){"use strict";var qi={float64:yh,float32:dh,int32:qh,int16:hh,int8:xh,uint32:wh,uint16:bh,uint8:Sh,uint8c:Eh,generic:Ah,default:Th};function yh(r,e){return r[e]}function dh(r,e){return r[e]}function qh(r,e){return r[e]}function hh(r,e){return r[e]}function xh(r,e){return r[e]}function wh(r,e){return r[e]}function bh(r,e){return r[e]}function Sh(r,e){return r[e]}function Eh(r,e){return r[e]}function Ah(r,e){return r[e]}function Th(r,e){return r[e]}function kh(r){var e=qi[r];return typeof e=="function"?e:qi.default}hi.exports=kh});var Q=l(function(YO,wi){"use strict";var jh=xi();wi.exports=jh});var Ei=l(function(WO,Si){"use strict";var bi={float64:_h,float32:Vh,int32:Ch,int16:Oh,int8:Fh,uint32:zh,uint16:Lh,uint8:Rh,uint8c:Mh,generic:Bh,default:Ih};function _h(r,e,t){r[e]=t}function Vh(r,e,t){r[e]=t}function Ch(r,e,t){r[e]=t}function Oh(r,e,t){r[e]=t}function Fh(r,e,t){r[e]=t}function zh(r,e,t){r[e]=t}function Lh(r,e,t){r[e]=t}function Rh(r,e,t){r[e]=t}function Mh(r,e,t){r[e]=t}function Bh(r,e,t){r[e]=t}function Ih(r,e,t){r[e]=t}function Nh(r){var e=bi[r];return typeof e=="function"?e:bi.default}Si.exports=Nh});var ue=l(function(ZO,Ai){"use strict";var Ph=Ei();Ai.exports=Ph});var ji=l(function(KO,ki){"use strict";var Ti={complex128:Uh,complex64:Dh,default:Gh};function Uh(r,e){return r.get(e)}function Dh(r,e){return r.get(e)}function Gh(r,e){return r.get(e)}function Yh(r){var e=Ti[r];return typeof e=="function"?e:Ti.default}ki.exports=Yh});var $=l(function(XO,_i){"use strict";var Wh=ji();_i.exports=Wh});var Oi=l(function(HO,Ci){"use strict";var Vi={complex128:Zh,complex64:Kh,default:Xh};function Zh(r,e,t){r.set(t,e)}function Kh(r,e,t){r.set(t,e)}function Xh(r,e,t){r.set(t,e)}function Hh(r){var e=Vi[r];return typeof e=="function"?e:Vi.default}Ci.exports=Hh});var oe=l(function(JO,Fi){"use strict";var Jh=Oi();Fi.exports=Jh});var Li=l(function($O,zi){"use strict";var $h={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"};zi.exports=$h});var Mi=l(function(QO,Ri){"use strict";var Qh=typeof Float64Array=="function"?Float64Array:void 0;Ri.exports=Qh});var Ii=l(function(rF,Bi){"use strict";function r2(){throw new Error("not implemented")}Bi.exports=r2});var sr=l(function(eF,Ni){"use strict";var e2=require("@stdlib/assert/has-float64array-support"),t2=Mi(),i2=Ii(),Ze;e2()?Ze=t2:Ze=i2;Ni.exports=Ze});var Ui=l(function(tF,Pi){"use strict";var a2=typeof Float32Array=="function"?Float32Array:void 0;Pi.exports=a2});var Gi=l(function(iF,Di){"use strict";function n2(){throw new Error("not implemented")}Di.exports=n2});var fr=l(function(aF,Yi){"use strict";var u2=require("@stdlib/assert/has-float32array-support"),o2=Ui(),v2=Gi(),Ke;u2()?Ke=o2:Ke=v2;Yi.exports=Ke});var Zi=l(function(nF,Wi){"use strict";var s2=typeof Uint32Array=="function"?Uint32Array:void 0;Wi.exports=s2});var Xi=l(function(uF,Ki){"use strict";function f2(){throw new Error("not implemented")}Ki.exports=f2});var gr=l(function(oF,Hi){"use strict";var l2=require("@stdlib/assert/has-uint32array-support"),c2=Zi(),m2=Xi(),Xe;l2()?Xe=c2:Xe=m2;Hi.exports=Xe});var $i=l(function(vF,Ji){"use strict";var p2=typeof Int32Array=="function"?Int32Array:void 0;Ji.exports=p2});var ra=l(function(sF,Qi){"use strict";function g2(){throw new Error("not implemented")}Qi.exports=g2});var yr=l(function(fF,ea){"use strict";var y2=require("@stdlib/assert/has-int32array-support"),d2=$i(),q2=ra(),He;y2()?He=d2:He=q2;ea.exports=He});var ia=l(function(lF,ta){"use strict";var h2=typeof Uint16Array=="function"?Uint16Array:void 0;ta.exports=h2});var na=l(function(cF,aa){"use strict";function x2(){throw new Error("not implemented")}aa.exports=x2});var dr=l(function(mF,ua){"use strict";var w2=require("@stdlib/assert/has-uint16array-support"),b2=ia(),S2=na(),Je;w2()?Je=b2:Je=S2;ua.exports=Je});var va=l(function(pF,oa){"use strict";var E2=typeof Int16Array=="function"?Int16Array:void 0;oa.exports=E2});var fa=l(function(gF,sa){"use strict";function A2(){throw new Error("not implemented")}sa.exports=A2});var qr=l(function(yF,la){"use strict";var T2=require("@stdlib/assert/has-int16array-support"),k2=va(),j2=fa(),$e;T2()?$e=k2:$e=j2;la.exports=$e});var ma=l(function(dF,ca){"use strict";var _2=typeof Uint8Array=="function"?Uint8Array:void 0;ca.exports=_2});var ga=l(function(qF,pa){"use strict";function V2(){throw new Error("not implemented")}pa.exports=V2});var hr=l(function(hF,ya){"use strict";var C2=require("@stdlib/assert/has-uint8array-support"),O2=ma(),F2=ga(),Qe;C2()?Qe=O2:Qe=F2;ya.exports=Qe});var qa=l(function(xF,da){"use strict";var z2=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;da.exports=z2});var xa=l(function(wF,ha){"use strict";function L2(){throw new Error("not implemented")}ha.exports=L2});var xr=l(function(bF,wa){"use strict";var R2=require("@stdlib/assert/has-uint8clampedarray-support"),M2=qa(),B2=xa(),rt;R2()?rt=M2:rt=B2;wa.exports=rt});var Sa=l(function(SF,ba){"use strict";var I2=typeof Int8Array=="function"?Int8Array:void 0;ba.exports=I2});var Aa=l(function(EF,Ea){"use strict";function N2(){throw new Error("not implemented")}Ea.exports=N2});var wr=l(function(AF,Ta){"use strict";var P2=require("@stdlib/assert/has-int8array-support"),U2=Sa(),D2=Aa(),et;P2()?et=U2:et=D2;Ta.exports=et});var ja=l(function(TF,ka){"use strict";var G2=require("@stdlib/assert/is-array-like-object"),Y2=require("@stdlib/assert/is-complex-like"),W2=require("@stdlib/complex/realf"),Z2=require("@stdlib/complex/imagf"),K2=require("@stdlib/string/format");function X2(r){var e,t,i;for(e=[];t=r.next(),!t.done;)if(i=t.value,G2(i)&&i.length>=2)e.push(i[0],i[1]);else if(Y2(i))e.push(W2(i),Z2(i));else return new TypeError(K2("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));return e}ka.exports=X2});var Va=l(function(kF,_a){"use strict";var H2=require("@stdlib/assert/is-array-like-object"),J2=require("@stdlib/assert/is-complex-like"),$2=require("@stdlib/complex/realf"),Q2=require("@stdlib/complex/imagf"),rx=require("@stdlib/string/format");function ex(r,e,t){var i,a,u,o;for(i=[],o=-1;a=r.next(),!a.done;)if(o+=1,u=e.call(t,a.value,o),H2(u)&&u.length>=2)i.push(u[0],u[1]);else if(J2(u))i.push($2(u),Q2(u));else return new TypeError(rx("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",u));return i}_a.exports=ex});var Oa=l(function(jF,Ca){"use strict";var tx=require("@stdlib/assert/is-complex-like"),ix=require("@stdlib/complex/realf"),ax=require("@stdlib/complex/imagf");function nx(r,e){var t,i,a,u;for(t=e.length,u=0,a=0;at.byteLength-r)throw new RangeError(L("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*rr));t=new ur(t,r,i*2)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(M,"BYTES_PER_ELEMENT",rr);D(M,"name","Complex64Array");D(M,"from",function(e){var t,i,a,u,o,n,v,s,f,c,m,p;if(!er(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ia(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(a=arguments[1],!er(a))throw new TypeError(L("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(K(e)){if(s=e.length,a){for(u=new this(s),o=u._buffer,p=0,m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return u}return new this(e)}if(tt(e)){if(a){for(s=e.length,e.get&&e.set?v=lx("default"):v=fx("default"),m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return u}return new this(e)}if(La(e)&&Ba&&er(e[Pr])){if(o=e[Pr](),!er(o.next))throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a?n=cx(o,a,t):n=Ma(o),n instanceof Error)throw n;for(s=n.length/2,u=new this(s),o=u._buffer,m=0;m=this._length))return br(this._buffer,e)});se(M.prototype,"buffer",function(){return this._buffer.buffer});se(M.prototype,"byteLength",function(){return this._buffer.byteLength});se(M.prototype,"byteOffset",function(){return this._buffer.byteOffset});D(M.prototype,"BYTES_PER_ELEMENT",M.BYTES_PER_ELEMENT);D(M.prototype,"copyWithin",function(e,t){if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,t*2):this._buffer.copyWithin(e*2,t*2,arguments[2]*2),this});D(M.prototype,"entries",function(){var e,t,i,a,u,o,n;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,e=this._buffer,a=this._length,o=-1,n=-2,i={},D(i,"next",v),D(i,"return",s),Pr&&D(i,Pr,f),i;function v(){var c;return o+=1,u||o>=a?{done:!0}:(n+=2,c=new Ra(e[n],e[n+1]),{value:[o,c],done:!1})}function s(c){return u=!0,arguments.length?{value:c,done:!0}:{done:!0}}function f(){return t.entries()}});D(M.prototype,"every",function(e,t){var i,a;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=0;a--)if(u=br(i,a),e.call(t,u,a,this))return u});D(M.prototype,"findLastIndex",function(e,t){var i,a,u;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=this._length-1;a>=0;a--)if(u=br(i,a),e.call(t,u,a,this))return a;return-1});D(M.prototype,"forEach",function(e,t){var i,a,u;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=this._length))return br(this._buffer,e)});D(M.prototype,"includes",function(e,t){var i,a,u,o,n;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Er(e))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Ar(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(u=Fr(e),o=zr(e),i=this._buffer,n=t;n1){if(!Ar(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(u=Fr(e),o=zr(e),i=this._buffer,n=t;n1){if(!Ar(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(u=Fr(e),o=zr(e),i=this._buffer,n=t;n>=0;n--)if(a=2*n,u===i[a]&&o===i[a+1])return n;return-1});se(M.prototype,"length",function(){return this._length});D(M.prototype,"set",function(e){var t,i,a,u,o,n,v,s,f;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,arguments.length>1){if(i=arguments[1],!Hr(i))throw new TypeError(L("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(Er(e)){if(i>=this._length)throw new RangeError(L("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,a[i]=Fr(e),a[i+1]=zr(e);return}if(K(e)){if(n=e._length,i+n>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=a.byteOffset+i*rr,t.buffer===a.buffer&&t.byteOffsetf){for(u=new ur(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=a.byteOffset+i*rr,t.buffer===a.buffer&&t.byteOffsetf){for(u=new ur(n),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,s=0;su&&(t=u)}}return e>=u?(u=0,i=a.byteLength):e>=t?(u=0,i=a.byteOffset+e*rr):(u=t-e,i=a.byteOffset+e*rr),new this.constructor(a.buffer,i,u<0?0:u)});Na.exports=M});var Tr=l(function(VF,Ua){"use strict";var yx=Pa();Ua.exports=yx});var Ga=l(function(CF,Da){"use strict";var dx=require("@stdlib/assert/is-array-like-object"),qx=require("@stdlib/assert/is-complex-like"),hx=require("@stdlib/string/format"),xx=require("@stdlib/complex/real"),wx=require("@stdlib/complex/imag");function bx(r){var e,t,i;for(e=[];t=r.next(),!t.done;)if(i=t.value,dx(i)&&i.length>=2)e.push(i[0],i[1]);else if(qx(i))e.push(xx(i),wx(i));else return new TypeError(hx("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));return e}Da.exports=bx});var Wa=l(function(OF,Ya){"use strict";var Sx=require("@stdlib/assert/is-array-like-object"),Ex=require("@stdlib/assert/is-complex-like"),Ax=require("@stdlib/string/format"),Tx=require("@stdlib/complex/real"),kx=require("@stdlib/complex/imag");function jx(r,e,t){var i,a,u,o;for(i=[],o=-1;a=r.next(),!a.done;)if(o+=1,u=e.call(t,a.value,o),Sx(u)&&u.length>=2)i.push(u[0],u[1]);else if(Ex(u))i.push(Tx(u),kx(u));else return new TypeError(Ax("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",u));return i}Ya.exports=jx});var Ka=l(function(FF,Za){"use strict";var _x=require("@stdlib/assert/is-complex-like"),Vx=require("@stdlib/complex/real"),Cx=require("@stdlib/complex/imag");function Ox(r,e){var t,i,a,u;for(t=e.length,u=0,a=0;at.byteLength-r)throw new RangeError(P("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*tr));t=new or(t,r,i*2)}}return X(this,"_buffer",t),X(this,"_length",t.length/2),this}X(G,"BYTES_PER_ELEMENT",tr);X(G,"name","Complex128Array");X(G,"from",function(e){var t,i,a,u,o,n,v,s,f,c,m,p;if(!lr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!en(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(a=arguments[1],!lr(a))throw new TypeError(P("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(cr(e)){if(s=e.length,a){for(u=new this(s),o=u._buffer,p=0,m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(P("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return u}return new this(e)}if(it(e)){if(a){for(s=e.length,e.get&&e.set?v=Bx("default"):v=Mx("default"),m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(P("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return u}return new this(e)}if(Ja(e)&&rn&&lr(e[Dr])){if(o=e[Dr](),!lr(o.next))throw new TypeError(P("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a?n=Ix(o,a,t):n=Qa(o),n instanceof Error)throw n;for(s=n.length/2,u=new this(s),o=u._buffer,m=0;m=this._length))return Gr(this._buffer,e)});pe(G.prototype,"buffer",function(){return this._buffer.buffer});pe(G.prototype,"byteLength",function(){return this._buffer.byteLength});pe(G.prototype,"byteOffset",function(){return this._buffer.byteOffset});X(G.prototype,"BYTES_PER_ELEMENT",G.BYTES_PER_ELEMENT);X(G.prototype,"copyWithin",function(e,t){if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,t*2):this._buffer.copyWithin(e*2,t*2,arguments[2]*2),this});X(G.prototype,"entries",function(){var e,t,i,a,u,o,n;if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,e=this._buffer,a=this._length,o=-1,n=-2,i={},X(i,"next",v),X(i,"return",s),Dr&&X(i,Dr,f),i;function v(){var c;return o+=1,u||o>=a?{done:!0}:(n+=2,c=new $a(e[n],e[n+1]),{value:[o,c],done:!1})}function s(c){return u=!0,arguments.length?{value:c,done:!0}:{done:!0}}function f(){return t.entries()}});X(G.prototype,"every",function(e,t){var i,a;if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!lr(e))throw new TypeError(P("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=0;a--)if(u=Gr(i,a),e.call(t,u,a,this))return u});X(G.prototype,"get",function(e){if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Jr(e))throw new TypeError(P("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return Gr(this._buffer,e)});pe(G.prototype,"length",function(){return this._length});X(G.prototype,"set",function(e){var t,i,a,u,o,n,v,s,f;if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,arguments.length>1){if(i=arguments[1],!Jr(i))throw new TypeError(P("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(Ur(e)){if(i>=this._length)throw new RangeError(P("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,a[i]=ce(e),a[i+1]=me(e);return}if(cr(e)){if(n=e._length,i+n>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=a.byteOffset+i*tr,t.buffer===a.buffer&&t.byteOffsetf){for(u=new or(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=a.byteOffset+i*tr,t.buffer===a.buffer&&t.byteOffsetf){for(u=new or(n),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,s=0;s=0;s--)if(f=n-o+s,!(f<0)){if(v=e[f],a=t[s],a!==0&&a=0;s--)n=f%o,f-=n,f/=o,a[s]=n;for(i=[],s=0;s=0;u--)i.push(t[u]);e.push(i)}return e}zs.exports=C6});var pt=l(function(ZL,Rs){"use strict";var O6=Ls();Rs.exports=O6});var Bs=l(function(KL,Ms){"use strict";var F6=pt();function z6(r){var e,t;for(e=[],t=0;t=0;t--)e.push(r[t]);return e}Zs.exports=U6});var Hs=l(function(eR,Xs){"use strict";var D6=Ks();Xs.exports=D6});var $s=l(function(tR,Js){"use strict";var G6=pr();function Y6(r,e,t,i){var a,u,o,n;for(u=G6(e),o=i,a=[],n=0;n=0;a--)if(Se(r[a]))return a;return-1}for(a=t;a>=0;a--)if(e===r[a])return a;return-1}function vS(r,e,t,i){var a,u,o;if(a=r.data,u=r.accessors[0],i&&Se(e)){for(o=t;o>=0;o--)if(Se(u(a,o)))return o;return-1}for(o=t;o>=0;o--)if(e===u(a,o))return o;return-1}function sS(r,e,t,i){var a;if(uS(r,"lastIndexOf")&&i===!1)return r.lastIndexOf(e,t);if(t<0){if(t+=r.length,t<0)return-1}else t>r.length&&(t=r.length-1);return a=nS(r),a.accessorProtocol?vS(a,e,t,i):oS(r,e,t,i)}mf.exports=sS});var yf=l(function(lR,gf){"use strict";var fS=pf();gf.exports=fS});var qf=l(function(cR,df){"use strict";function lS(r,e,t){var i,a,u,o;if(t===0)return[];for(a=t-1,u=(e-r)/a,i=[r],o=1;o=0;m--)f=p%i[m],p-=f,p/=i[m],v[m]=f;for(o=[],m=0;m4&&(a=arguments[4]),c=r[0],m=r[1],v=0;v2){if(arguments.length===3?R0(t)?a=t:(u=t,o=!1):(a=i,u=t),u===0)return[];if(!b4(u)||u<0)throw new TypeError(Mr("invalid argument. Length must be a positive integer. Value: `%s`.",u));if(o){if(!R0(a))throw new TypeError(Mr("invalid argument. Options argument must be an object. Value: `%s`.",a));if(w4(a,"round")){if(!S4(a.round))throw new TypeError(Mr("invalid option. `%s` option must be a string. Option: `%s`.","round",a.round));if(M0.indexOf(a.round)===-1)throw new Error(Mr('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"round",M0.join('", "'),a.round))}}}switch(a.round){case"round":s=A4;break;case"ceil":s=T4;break;case"floor":default:s=E4;break}for(v=u-1,c=(e.getTime()-r.getTime())/v,n=new Array(u),f=r,n[0]=f,f=f.getTime(),m=1;m1?i=arguments[1]:i="float64",i==="generic")return rA(r);if(e=eA(i),e===null)throw new TypeError(tp("invalid argument. Second argument must be a supported data type. Value: `%s`.",i));return a=Q4(i),n=e*r,i==="complex128"&&(n+=8),u=$4(n),t=u.byteOffset,i==="complex128"&&(ep(t/e)||(t+=8)),o=new a(u.buffer,t,r),o}ip.exports=tA});var op=l(function(VB,up){"use strict";var iA=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aA=Rr(),nA=jr(),np=require("@stdlib/string/format");function uA(r){var e,t;if(!iA(r))throw new TypeError(np("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(arguments.length>1?e=arguments[1]:e="float64",e==="generic")return nA(r);if(t=aA(e),t===null)throw new TypeError(np("invalid argument. Second argument must be a recognized data type. Value: `%s`.",e));return new t(r)}up.exports=uA});var Ee=l(function(CB,vp){"use strict";var oA=op();vp.exports=oA});var lp=l(function(OB,fp){"use strict";var sp=Ee();function vA(r){return arguments.length>1?sp(r,arguments[1]):sp(r)}fp.exports=vA});var Vt=l(function(FB,cp){"use strict";var sA=X0(),fA=ap(),lA=lp(),_t;sA()?_t=fA:_t=lA;cp.exports=_t});var pp=l(function(zB,mp){"use strict";var cA=W(),mA=Vt(),pA=require("@stdlib/string/format");function gA(r){var e=cA(r);if(e===null)throw new TypeError(pA("invalid argument. First argument must be either an array, typed array, or complex typed array. Value: `%s`.",r));return arguments.length>1&&(e=arguments[1]),mA(r.length,e)}mp.exports=gA});var yp=l(function(LB,gp){"use strict";var yA=pp();gp.exports=yA});var bp=l(function(RB,wp){"use strict";var dA=require("@stdlib/assert/is-string").isPrimitive,dp=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qp=require("@stdlib/assert/is-collection"),Ct=require("@stdlib/assert/is-arraybuffer"),hp=require("@stdlib/assert/is-object"),Ae=require("@stdlib/assert/is-function"),qA=Rr(),hA=require("@stdlib/blas/ext/base/gfill"),xA=mr(),wA=require("@stdlib/assert/has-iterator-symbol-support"),Te=require("@stdlib/symbol/iterator"),bA=require("@stdlib/iter/length"),Sr=require("@stdlib/string/format"),xp=wA();function SA(r,e){var t,i;for(t=[];i=r.next(),!i.done;)t.push(e);return t}function EA(r,e){var t;for(t=0;t=0&&dA(arguments[e])?(t=arguments[e],e-=1):t="float64",i=qA(t),i===null)throw new TypeError(Sr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(e<=0)return[];if(r=arguments[0],o=arguments[1],e===1){if(dp(o)?u=o:qp(o)&&(u=o.length),u!==void 0)return xA(r,u);if(Ct(o))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(hp(o)){if(xp===!1)throw new TypeError(Sr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",o));if(!Ae(o[Te]))throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));if(o=o[Te](),!Ae(o.next))throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));return SA(o,r)}throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o))}else if(Ct(o))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o))}if(e<=0)return new i(0);if(e===1)if(o=arguments[1],qp(o))a=new i(o.length);else if(Ct(o))a=new i(o);else if(dp(o))a=new i(o);else if(hp(o)){if(xp===!1)throw new TypeError(Sr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",o));if(!Ae(o[Te]))throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));if(o=o[Te](),!Ae(o.next))throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));a=new i(bA(o))}else throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));else e===2?a=new i(arguments[1],arguments[2]):a=new i(arguments[1],arguments[2],arguments[3]);return a.length>0&&(/^complex/.test(t)?EA(a,arguments[0]):hA(a.length,arguments[0],a,1)),a}wp.exports=AA});var Ep=l(function(MB,Sp){"use strict";var TA=bp();Sp.exports=TA});var Op=l(function(BB,Cp){"use strict";var Ap=require("@stdlib/assert/is-string").isPrimitive,Tp=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kp=require("@stdlib/assert/is-collection"),Ot=require("@stdlib/assert/is-arraybuffer"),jp=require("@stdlib/assert/is-object"),Br=require("@stdlib/assert/is-function"),Ft=Rr(),kA=require("@stdlib/blas/ext/base/gfill-by"),jA=st(),_A=require("@stdlib/assert/has-iterator-symbol-support"),ke=require("@stdlib/symbol/iterator"),VA=require("@stdlib/iter/length"),vr=require("@stdlib/string/format"),_p=_A(),Vp="float64";function CA(r,e,t){var i,a,u;for(i=[],a=-1;u=r.next(),!u.done;)a+=1,i.push(e.call(t,a));return i}function OA(r,e,t){var i;for(i=0;i1)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(a=Ft(t),a===null)throw new TypeError(vr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));return new a(0)}if(e<2)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(e-=1,Br(arguments[e]))if(Br(arguments[e-1])){if(r=arguments[e],e-=1,i=arguments[e],e===0)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.")}else i=arguments[e];else if(e>=2){if(r=arguments[e],e-=1,i=arguments[e],!Br(i))throw new TypeError(vr("invalid argument. Callback argument must be a function. Value: `%s`.",i))}else throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(e-=1,e>=0&&Ap(arguments[e])?(t=arguments[e],e-=1):t=Vp,a=Ft(t),a===null)throw new TypeError(vr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(n=arguments[0],e===0){if(Tp(n)?o=n:kp(n)&&(o=n.length),o!==void 0)return jA(o,i,r);if(Ot(n))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(jp(n)){if(_p===!1)throw new TypeError(vr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",n));if(!Br(n[ke]))throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));if(n=n[ke](),!Br(n.next))throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));return CA(n,i,r)}throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n))}else if(Ot(n))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n))}if(e===0)if(n=arguments[0],kp(n))u=new a(n.length);else if(Ot(n))u=new a(n);else if(Tp(n))u=new a(n);else if(jp(n)){if(_p===!1)throw new TypeError(vr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",n));if(!Br(n[ke]))throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));if(n=n[ke](),!Br(n.next))throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));u=new a(VA(n))}else throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));else e===1?u=new a(arguments[0],arguments[1]):u=new a(arguments[0],arguments[1],arguments[2]);return u.length>0&&(/^complex/.test(t)?OA(u,i,r):kA(u.length,u,1,v)),u;function v(s,f){return i.call(r,f)}}Cp.exports=FA});var zp=l(function(IB,Fp){"use strict";var zA=Op();Fp.exports=zA});var Mp=l(function(NB,Rp){"use strict";var Lp=require("@stdlib/assert/is-function"),LA=require("@stdlib/assert/is-collection"),RA=require("@stdlib/assert/is-iterator-like"),MA=J(),BA=oe(),IA=ue(),NA=W(),zt=require("@stdlib/string/format");function PA(){var r,e,t,i,a,u,o,n,v;if(r=arguments[0],arguments.length>1)if(LA(arguments[1])){if(i=arguments[1],arguments.length>2){if(t=arguments[2],!Lp(t))throw new TypeError(zt("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[3]}}else{if(t=arguments[1],!Lp(t))throw new TypeError(zt("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[2]}if(!RA(r))throw new TypeError(zt("invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `%s`.",r));if(n=-1,i===void 0){if(i=[],t){for(;n+=1,v=r.next(),!v.done;)i.push(t.call(e,v.value,n));return i}for(;v=r.next(),!v.done;)i.push(v.value);return i}if(a=i.length,o=NA(i),MA(i)?u=BA(o):u=IA(o),t){for(;n2?t=arguments[2]:t="float64",t==="generic")return YA(e,r);if(i=GA(t),i===null)throw new TypeError(Np("invalid argument. Third argument must be a recognized data type. Value: `%s`.",t));return a=new i(r),WA(r,e,a,1),a}Pp.exports=ZA});var Ir=l(function(DB,Dp){"use strict";var KA=Up();Dp.exports=KA});var Yp=l(function(GB,Gp){"use strict";var XA=require("@stdlib/string/format"),HA=W(),JA=Ir(),$A=require("@stdlib/complex/float64"),QA=require("@stdlib/complex/float32");function rT(r,e){var t,i;if(t=HA(r),t===null)throw new TypeError(XA("invalid argument. First argument must be either an array, typed array, or complex typed array. Value: `%s`.",r));return arguments.length>2&&(t=arguments[2]),typeof e=="number"?t==="complex128"?i=new $A(e,0):t==="complex64"?i=new QA(e,0):i=e:i=e,JA(r.length,i,t)}Gp.exports=rT});var Zp=l(function(YB,Wp){"use strict";var eT=Yp();Wp.exports=eT});var Xp=l(function(WB,Kp){"use strict";var tT=require("@stdlib/math/base/special/ceil"),Lt=require("@stdlib/assert/is-number").isPrimitive,Rt=require("@stdlib/math/base/assert/is-nan"),Mt=require("@stdlib/string/format"),iT=require("@stdlib/constants/uint32/max"),aT=dt();function nT(r,e,t){var i,a;if(!Lt(r)||Rt(r))throw new TypeError(Mt("invalid argument. Start must be numeric. Value: `%s`.",r));if(!Lt(e)||Rt(e))throw new TypeError(Mt("invalid argument. Stop must be numeric. Value: `%s`.",e));if(arguments.length<3)a=1;else if(a=t,!Lt(a)||Rt(a))throw new TypeError(Mt("invalid argument. Increment must be numeric. Value: `%s`.",a));if(i=tT((e-r)/a),i>iT)throw new RangeError("invalid arguments. Generated array exceeds maximum array length.");return aT(r,e,a)}Kp.exports=nT});var Jp=l(function(ZB,Hp){"use strict";var uT=Xp();Hp.exports=uT});var Qp=l(function(KB,$p){"use strict";var oT=sr(),vT=fr(),sT=kr(),fT=Tr(),lT={float64:oT,float32:vT,complex128:sT,complex64:fT};$p.exports=lT});var eg=l(function(XB,rg){"use strict";var cT=Qp();function mT(r){return cT[r]||null}rg.exports=mT});var Bt=l(function(HB,tg){"use strict";var pT=eg();tg.exports=pT});var ag=l(function(JB,ig){"use strict";function gT(r,e,t,i){var a,u,o,n;if(t===0)return[];if(t===1)return i?[e]:[r];for(a=[r],i?u=t-1:u=t,o=(e-r)/u,n=1;n3&&(u=FT(i,arguments[3]),u))throw u;if(i.dtype==="generic")return s?CT(n,r,v,e,t,i.endpoint):VT(r,e,t,i.endpoint);if(a=kT(i.dtype),a===null)throw new TypeError(Zr('invalid option. `%s` option must be a real or complex floating-point data type or "generic". Option: `%s`.',"dtype",i.dtype));if(o=new a(t),i.dtype==="complex64")return Sg(jT(o,0),n,r,v,e,t,i.endpoint),o;if(i.dtype==="complex128")return Sg(_T(o,0),n,r,v,e,t,i.endpoint),o;if(s)throw new TypeError('invalid arguments. If either of the first two arguments are complex numbers, the output array data type must be a complex number data type or "generic".');return OT(o,r,e,t,i.endpoint)}Eg.exports=LT});var Cg=l(function(aI,Vg){"use strict";var RT=require("@stdlib/complex/float32"),MT=require("@stdlib/complex/float64"),Tg=require("@stdlib/complex/real"),kg=require("@stdlib/complex/imag"),jg=require("@stdlib/complex/realf"),_g=require("@stdlib/complex/imagf");function BT(r,e,t,i,a,u,o){var n,v,s,f,c,m,p,g,y,d,q,h,b,S;if(u===0)return r;if(v=0,e==="float64"?(s=t,c=0):e==="complex64"?(v+=1,s=jg(t),c=_g(t)):(s=Tg(t),c=kg(t)),i==="float64"?(f=a,m=0):i==="complex64"?(v+=1,f=jg(a),m=_g(a)):(f=Tg(a),m=kg(a)),v===2?n=RT:n=MT,g=r.data,p=r.accessors[1],u===1)return o?p(g,0,new n(f,m)):p(g,0,new n(s,c)),r;for(p(g,0,new n(s,c)),o?b=u-1:b=u,q=(f-s)/b,h=(m-c)/b,S=1;S3&&(a=ZT(i,arguments[3]),a))throw a;if(v=PT(t),v===null&&(v="generic"),v==="complex64")return Ig(UT(t,0),u,r,o,e,t.length,i.endpoint),t;if(v==="complex128")return Ig(DT(t,0),u,r,o,e,t.length,i.endpoint),t;if(n){if(v==="generic")return s=Bg(t),GT(s,u,r,o,e,t.length,i.endpoint),t;throw new TypeError('invalid arguments. If either of the first two arguments are complex numbers, the output array must be a complex number array or a "generic" array-like object.')}return s=Bg(t),s.accessorProtocol?(YT(s,r,e,t.length,i.endpoint),t):(WT(t,r,e,t.length,i.endpoint),t)}Ng.exports=XT});var Gg=l(function(oI,Dg){"use strict";var HT=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ug=Ag(),JT=Pg();HT(Ug,"assign",JT);Dg.exports=Ug});var Kg=l(function(vI,Zg){"use strict";var Yg=require("@stdlib/assert/is-number").isPrimitive,$T=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gt=require("@stdlib/string/format"),Wg=require("@stdlib/math/base/assert/is-nan"),QT=ht();function rk(r,e,t){if(!Yg(r)||Wg(r))throw new TypeError(Gt("invalid argument. Exponent of start value must be numeric. Value: `%s`.",r));if(!Yg(e)||Wg(e))throw new TypeError(Gt("invalid argument. Exponent of stop value must be numeric. Value: `%s`.",e));if(arguments.length<3)t=10;else if(!$T(t))throw new TypeError(Gt("invalid argument. Length must be a nonnegative integer. Value: `%s`.",t));return QT(r,e,t)}Zg.exports=rk});var Hg=l(function(sI,Xg){"use strict";var ek=Kg();Xg.exports=ek});var ty=l(function(fI,ey){"use strict";var $g=require("@stdlib/math/base/assert/is-integer"),tk=require("@stdlib/math/base/assert/is-negative-zero"),ik=require("@stdlib/assert/is-complex-like"),Qg=require("@stdlib/constants/float64/pinf"),ry=require("@stdlib/constants/float64/ninf"),je=require("@stdlib/constants/float32/smallest-subnormal"),ak=require("@stdlib/constants/float32/max-safe-integer"),nk=require("@stdlib/constants/float32/min-safe-integer"),uk=require("@stdlib/constants/int8/min"),ok=require("@stdlib/constants/int16/min"),vk=require("@stdlib/constants/int32/min"),sk=require("@stdlib/constants/uint8/max"),fk=require("@stdlib/constants/uint16/max"),lk=require("@stdlib/constants/uint32/max");function Jg(r){return r!==r||r===Qg||r===ry?"float32":$g(r)?r>=nk&&r<=ak?"float32":"float64":r>-je&&r=uk?"int8":r>=ok?"int16":r>=vk?"int32":"float64":r<=sk?"uint8":r<=fk?"uint16":r<=lk?"uint32":"float64":r>-je&&r1){if(e=arguments[1],ny.indexOf(e)===-1)throw new TypeError(dk('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',ny.join('", "'),e))}else e="float64";return e==="complex128"?t=qk:e==="complex64"?t=hk:t=NaN,yk(r,t,e)}uy.exports=xk});var sy=l(function(mI,vy){"use strict";var wk=oy();vy.exports=wk});var ly=l(function(pI,fy){"use strict";var bk=W(),Sk=Ir(),Ek=require("@stdlib/complex/float64"),Ak=require("@stdlib/complex/float32"),Yt=require("@stdlib/string/format"),Tk=new Ek(NaN,NaN),kk=new Ak(NaN,NaN),_e=["float64","float32","complex128","complex64","generic"];function jk(r){var e,t;if(e=bk(r),e===null)throw new TypeError(Yt("invalid argument. First argument must be either an array, typed array, or complex typed array. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],_e.indexOf(e)===-1)throw new TypeError(Yt('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',_e.join('", "'),e))}else if(_e.indexOf(e)===-1)throw new TypeError(Yt('invalid argument. First argument must be one of the following data types: "%s". Value: `%s`.',_e.join('", "'),e));return e==="complex128"?t=Tk:e==="complex64"?t=kk:t=NaN,Sk(r.length,t,e)}fy.exports=jk});var my=l(function(gI,cy){"use strict";var _k=ly();cy.exports=_k});var py=l(function(yI,Vk){Vk.exports={float64:-1,float32:"float64",int32:-1,int16:"int32",int8:"int16",uint32:-1,uint16:"uint32",uint8:"uint16",uint8c:"uint16",generic:-1,complex64:"complex128",complex128:-1}});var yy=l(function(dI,gy){"use strict";var Ck=require("@stdlib/utils/keys"),Ok=require("@stdlib/assert/has-own-property"),Ve=py();function Fk(){var r,e,t,i;for(t={},r=Ck(Ve),e=r.length,i=0;i1?e=arguments[1]:e="float64",e==="complex128"?t=Ik:e==="complex64"?t=Nk:t=1,Bk(r,t,e)}hy.exports=Pk});var by=l(function(xI,wy){"use strict";var Uk=xy();wy.exports=Uk});var Ey=l(function(wI,Sy){"use strict";var Dk=W(),Gk=Ir(),Yk=require("@stdlib/complex/float64"),Wk=require("@stdlib/complex/float32"),Zk=require("@stdlib/string/format"),Kk=new Yk(1,0),Xk=new Wk(1,0);function Hk(r){var e,t;if(e=Dk(r),e===null)throw new TypeError(Zk("invalid argument. First argument must be either an array, typed array, or complex typed array. Value: `%s`.",r));return arguments.length>1&&(e=arguments[1]),e==="complex128"?t=Kk:e==="complex64"?t=Xk:t=1,Gk(r.length,t,e)}Sy.exports=Hk});var Ty=l(function(bI,Ay){"use strict";var Jk=Ey();Ay.exports=Jk});var jy=l(function(SI,ky){"use strict";function $k(){return{highWaterMark:9007199254740992}}ky.exports=$k});var Cy=l(function(EI,Vy){"use strict";var Qk=require("@stdlib/assert/is-plain-object"),rj=require("@stdlib/assert/has-own-property"),ej=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_y=require("@stdlib/string/format");function tj(r,e){return Qk(e)?rj(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!ej(r.highWaterMark))?new TypeError(_y("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","highWaterMark",r.highWaterMark)):null:new TypeError(_y("invalid argument. Options argument must be an object. Value: `%s`.",e))}Vy.exports=tj});var Fy=l(function(AI,Oy){"use strict";function ij(r){var e,t;for(e=[],t=0;ti.highWaterMark?null:(p=new pj(m),e+=m,p)}function n(m,p,g){var y;return p===0?new m(0):(y=o(dj(p)*bj[g]),y===null?y:new m(y,0,p))}function v(){var m,p,g,y,d,q,h,b,S;if(m=arguments.length,m&&nj(arguments[m-1])?(m-=1,p=arguments[m]):p="float64",g=Kt(p),g===null)throw new TypeError(Wt("invalid argument. Must provide a recognized data type. Value: `%s`.",p));if(m<=0)return new g(0);if(uj(arguments[0]))return n(g,arguments[0],p);if(oj(arguments[0])){if(y=arguments[0],b=y.length,lj(y)?y=Ry(y,0):fj(y)?y=Ly(y,0):/^complex/.test(p)&&(b/=2),d=n(g,b,p),d===null)return d;if(Iy(d)||By(d))return d.set(y),d;for(h=My(mj(y)).accessors[0],q=My(p).accessors[1],S=0;S0){for(p=yj(Zt(m.byteLength)),p=qj(t.length-1,p),g=t[p],y=0;y1&&(e.length=d1(t,e,1,r,t>2)),e}q1.exports=f_});var w1=l(function(DI,x1){"use strict";var l_=h1();x1.exports=l_});var S1=l(function(GI,b1){"use strict";var c_=typeof SharedArrayBuffer=="function"?SharedArrayBuffer:null;b1.exports=c_});var A1=l(function(YI,E1){"use strict";function m_(r){throw new Error("not supported. The current environment does not support SharedArrayBuffers, and, unfortunately, SharedArrayBuffers cannot be polyfilled. For shared memory applications, upgrade your runtime environment to one which supports SharedArrayBuffers.")}E1.exports=m_});var k1=l(function(WI,T1){"use strict";var p_=require("@stdlib/assert/has-sharedarraybuffer-support"),g_=S1(),y_=A1(),Jt;p_()?Jt=g_:Jt=y_;T1.exports=Jt});var O1=l(function(ZI,C1){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),j1=require("@stdlib/assert/has-own-property"),_1=require("@stdlib/assert/is-function"),d_=require("@stdlib/assert/is-collection"),q_=require("@stdlib/assert/is-plain-object"),h_=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,x_=J(),V1=require("@stdlib/symbol/iterator"),w_=$(),b_=Q(),S_=W(),ae=require("@stdlib/string/format");function $t(r){var e,t,i,a,u,o,n,v,s,f;if(!d_(r))throw new TypeError(ae("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(a={iter:1e308,dir:1},arguments.length>1)if(q_(arguments[1])){if(t=arguments[1],arguments.length>2){if(n=arguments[2],!_1(n))throw new TypeError(ae("invalid argument. Callback argument must be a function. Value: `%s`.",n));e=arguments[3]}if(j1(t,"iter")&&(a.iter=t.iter,!h_(t.iter)))throw new TypeError(ae("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter));if(j1(t,"dir")&&(a.dir=t.dir,t.dir!==1&&t.dir!==-1))throw new TypeError(ae("invalid option. `%s` option must be either `1` or `-1`. Option: `%s`.","dir",t.dir))}else{if(n=arguments[1],!_1(n))throw new TypeError(ae("invalid argument. Second argument must be either a function or an options object. Value: `%s`.",n));e=arguments[2]}return i=0,u={},n?a.dir===1?(f=-1,Kr(u,"next",c)):(f=r.length,Kr(u,"next",m)):a.dir===1?(f=-1,Kr(u,"next",p)):(f=r.length,Kr(u,"next",g)),Kr(u,"return",y),V1&&Kr(u,V1,d),s=S_(r),x_(r)?v=w_(s):v=b_(s),u;function c(){return f=(f+1)%r.length,i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:n.call(e,v(r,f),f,i,r),done:!1}}function m(){return f-=1,f<0&&(f+=r.length),i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:n.call(e,v(r,f),f,i,r),done:!1}}function p(){return f=(f+1)%r.length,i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:v(r,f),done:!1}}function g(){return f-=1,f<0&&(f+=r.length),i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:v(r,f),done:!1}}function y(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function d(){return n?$t(r,a,n,e):$t(r,a)}}C1.exports=$t});var z1=l(function(KI,F1){"use strict";var E_=O1();F1.exports=E_});var B1=l(function(XI,M1){"use strict";var Re=require("@stdlib/utils/define-nonenumerable-read-only-property"),A_=require("@stdlib/assert/is-function"),T_=require("@stdlib/assert/is-collection"),k_=J(),L1=require("@stdlib/symbol/iterator"),j_=$(),__=Q(),V_=W(),R1=require("@stdlib/string/format");function Qt(r){var e,t,i,a,u,o,n;if(!T_(r))throw new TypeError(R1("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!A_(a))throw new TypeError(R1("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return n=-1,t={},a?Re(t,"next",v):Re(t,"next",s),Re(t,"return",f),L1&&Re(t,L1,c),o=V_(r),k_(r)?u=j_(o):u=__(o),t;function v(){return n+=1,i||n>=r.length?{done:!0}:{value:a.call(e,u(r,n),n,r),done:!1}}function s(){return n+=1,i||n>=r.length?{done:!0}:{value:u(r,n),done:!1}}function f(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function c(){return a?Qt(r,a,e):Qt(r)}}M1.exports=Qt});var N1=l(function(HI,I1){"use strict";var C_=B1();I1.exports=C_});var G1=l(function(JI,D1){"use strict";var Me=require("@stdlib/utils/define-nonenumerable-read-only-property"),O_=require("@stdlib/assert/is-function"),F_=require("@stdlib/assert/is-collection"),z_=J(),P1=require("@stdlib/symbol/iterator"),L_=$(),R_=Q(),M_=W(),U1=require("@stdlib/string/format");function ri(r){var e,t,i,a,u,o,n,v;if(!F_(r))throw new TypeError(U1("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!O_(a))throw new TypeError(U1("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return u=r.length,v=u,t={},a?Me(t,"next",s):Me(t,"next",f),Me(t,"return",c),P1&&Me(t,P1,m),n=M_(r),z_(r)?o=L_(n):o=R_(n),t;function s(){return v+=r.length-u-1,u=r.length,i||v<0?(i=!0,{done:!0}):{value:a.call(e,o(r,v),v,r),done:!1}}function f(){return v+=r.length-u-1,u=r.length,i||v<0?(i=!0,{done:!0}):{value:o(r,v),done:!1}}function c(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return a?ri(r,a,e):ri(r)}}D1.exports=ri});var W1=l(function($I,Y1){"use strict";var B_=G1();Y1.exports=B_});var K1=l(function(QI,Z1){"use strict";var I_=wr(),N_=hr(),P_=xr(),U_=qr(),D_=dr(),G_=yr(),Y_=gr(),W_=fr(),Z_=sr(),K_=Tr(),X_=kr(),H_=[[Z_,"Float64Array"],[W_,"Float32Array"],[G_,"Int32Array"],[Y_,"Uint32Array"],[U_,"Int16Array"],[D_,"Uint16Array"],[I_,"Int8Array"],[N_,"Uint8Array"],[P_,"Uint8ClampedArray"],[K_,"Complex64Array"],[X_,"Complex128Array"]];Z1.exports=H_});var H1=l(function(rN,X1){"use strict";var J_=require("@stdlib/assert/instance-of"),$_=require("@stdlib/utils/constructor-name"),Q_=require("@stdlib/utils/get-prototype-of"),Xr=K1();function rV(r){var e,t;for(t=0;t1){if(a=arguments[1],!sV(a))throw new TypeError(td("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return n=-1,t={},a?Be(t,"next",v):Be(t,"next",s),Be(t,"return",f),ed&&Be(t,ed,c),o=pV(r),lV(r)?u=cV(o):u=mV(o),t;function v(){var m;if(i)return{done:!0};for(m=r.length,n+=1;n=m?(i=!0,{done:!0}):{value:a.call(e,u(r,n),n,r),done:!1}}function s(){var m;if(i)return{done:!0};for(m=r.length,n+=1;n=m?(i=!0,{done:!0}):{value:u(r,n),done:!1}}function f(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function c(){return a?ei(r,a,e):ei(r)}}id.exports=ei});var ud=l(function(aN,nd){"use strict";var gV=ad();nd.exports=gV});var fd=l(function(nN,sd){"use strict";var Ie=require("@stdlib/utils/define-nonenumerable-read-only-property"),yV=require("@stdlib/assert/is-function"),dV=require("@stdlib/assert/is-collection"),qV=J(),od=require("@stdlib/symbol/iterator"),hV=$(),xV=Q(),wV=W(),vd=require("@stdlib/string/format");function ti(r){var e,t,i,a,u,o,n,v;if(!dV(r))throw new TypeError(vd("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!yV(a))throw new TypeError(vd("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return u=r.length,v=u,t={},a?Ie(t,"next",s):Ie(t,"next",f),Ie(t,"return",c),od&&Ie(t,od,m),n=wV(r),qV(r)?o=hV(n):o=xV(n),t;function s(){if(i)return{done:!0};for(v+=r.length-u-1,u=r.length;v>=0&&o(r,v)===void 0;)v-=1;return v<0?(i=!0,{done:!0}):{value:a.call(e,o(r,v),v,r),done:!1}}function f(){if(i)return{done:!0};for(v+=r.length-u-1,u=r.length;v>=0&&o(r,v)===void 0;)v-=1;return v<0?(i=!0,{done:!0}):{value:o(r,v),done:!1}}function c(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return a?ti(r,a,e):ti(r)}}sd.exports=ti});var cd=l(function(uN,ld){"use strict";var bV=fd();ld.exports=bV});var yd=l(function(oN,gd){"use strict";var Ne=require("@stdlib/utils/define-nonenumerable-read-only-property"),SV=require("@stdlib/assert/is-function"),EV=require("@stdlib/assert/is-collection"),md=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,AV=require("@stdlib/assert/is-integer").isPrimitive,TV=J(),pd=require("@stdlib/symbol/iterator"),kV=$(),jV=Q(),_V=W(),ne=require("@stdlib/string/format");function ii(r,e,t,i){var a,u,o,n,v,s,f,c;if(!md(r))throw new TypeError(ne("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!EV(e))throw new TypeError(ne("invalid argument. Second argument must be an array-like object. Value: `%s`.",e));if(!AV(t))throw new TypeError(ne("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(!md(i))throw new TypeError(ne("invalid argument. Fourth argument must be a nonnegative integer. Value: `%s`.",i));if(arguments.length>4){if(n=arguments[4],!SV(n))throw new TypeError(ne("invalid argument. Fifth argument must be a function. Value: `%s`.",n));a=arguments[5]}return v=i,c=-1,u={},n?Ne(u,"next",m):Ne(u,"next",p),Ne(u,"return",g),pd&&Ne(u,pd,y),f=_V(e),TV(e)?s=kV(f):s=jV(f),u;function m(){var d;return c+=1,o||c>=r?{done:!0}:(d=n.call(a,s(e,v),v,c,e),v+=t,{value:d,done:!1})}function p(){var d;return c+=1,o||c>=r?{done:!0}:(d=s(e,v),v+=t,{value:d,done:!1})}function g(d){return o=!0,arguments.length?{value:d,done:!0}:{done:!0}}function y(){return n?ii(r,e,t,i,n,a):ii(r,e,t,i)}}gd.exports=ii});var qd=l(function(vN,dd){"use strict";var VV=yd();dd.exports=VV});var bd=l(function(sN,wd){"use strict";var Pe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ue=require("@stdlib/assert/is-function"),CV=require("@stdlib/assert/is-collection"),hd=require("@stdlib/assert/is-integer").isPrimitive,OV=J(),xd=require("@stdlib/symbol/iterator"),FV=$(),zV=Q(),LV=W(),De=require("@stdlib/string/format");function ai(r){var e,t,i,a,u,o,n,v,s,f;if(!CV(r))throw new TypeError(De("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,n=r.length;else if(i===2)Ue(arguments[1])?(t=0,o=arguments[1]):t=arguments[1],n=r.length;else if(i===3)Ue(arguments[1])?(t=0,n=r.length,o=arguments[1],e=arguments[2]):Ue(arguments[2])?(t=arguments[1],n=r.length,o=arguments[2]):(t=arguments[1],n=arguments[2]);else{if(t=arguments[1],n=arguments[2],o=arguments[3],!Ue(o))throw new TypeError(De("invalid argument. Fourth argument must be a function. Value: `%s`.",o));e=arguments[4]}if(!hd(t))throw new TypeError(De("invalid argument. Second argument must be either an integer (starting index) or a function. Value: `%s`.",t));if(!hd(n))throw new TypeError(De("invalid argument. Third argument must be either an integer (ending index) or a function. Value: `%s`.",n));return n<0?(n=r.length+n,n<0&&(n=0)):n>r.length&&(n=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=t-1,a={},o?Pe(a,"next",c):Pe(a,"next",m),Pe(a,"return",p),xd&&Pe(a,xd,g),s=LV(r),OV(r)?v=FV(s):v=zV(s),a;function c(){return f+=1,u||f>=n?{done:!0}:{value:o.call(e,v(r,f),f,f-t,r),done:!1}}function m(){return f+=1,u||f>=n?{done:!0}:{value:v(r,f),done:!1}}function p(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function g(){return o?ai(r,t,n,o,e):ai(r,t,n)}}wd.exports=ai});var Ed=l(function(fN,Sd){"use strict";var RV=bd();Sd.exports=RV});var jd=l(function(lN,kd){"use strict";var Ge=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ye=require("@stdlib/assert/is-function"),MV=require("@stdlib/assert/is-collection"),Ad=require("@stdlib/assert/is-integer").isPrimitive,BV=J(),Td=require("@stdlib/symbol/iterator"),IV=$(),NV=Q(),PV=W(),We=require("@stdlib/string/format");function ni(r){var e,t,i,a,u,o,n,v,s,f;if(!MV(r))throw new TypeError(We("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,n=r.length;else if(i===2)Ye(arguments[1])?(t=0,o=arguments[1]):t=arguments[1],n=r.length;else if(i===3)Ye(arguments[1])?(t=0,n=r.length,o=arguments[1],e=arguments[2]):Ye(arguments[2])?(t=arguments[1],n=r.length,o=arguments[2]):(t=arguments[1],n=arguments[2]);else{if(t=arguments[1],n=arguments[2],o=arguments[3],!Ye(o))throw new TypeError(We("invalid argument. Fourth argument must be a function. Value: `%s`.",o));e=arguments[4]}if(!Ad(t))throw new TypeError(We("invalid argument. Second argument must be either an integer (starting view index) or a function. Value: `%s`.",t));if(!Ad(n))throw new TypeError(We("invalid argument. Third argument must be either an integer (ending view index) or a function. Value: `%s`.",n));return n<0?(n=r.length+n,n<0&&(n=0)):n>r.length&&(n=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=n,a={},o?Ge(a,"next",c):Ge(a,"next",m),Ge(a,"return",p),Td&&Ge(a,Td,g),s=PV(r),BV(r)?v=IV(s):v=NV(s),a;function c(){return f-=1,u||f1&&(e=arguments[1]),BO(r.length,e)}fh.exports=IO});var mh=l(function(vP,ch){"use strict";var NO=lh();ch.exports=NO});var k=require("@stdlib/utils/define-read-only-property"),T={};k(T,"base",l0());k(T,"ArrayBuffer",bt());k(T,"Complex64Array",Tr());k(T,"Complex128Array",kr());k(T,"convertArray",kt());k(T,"convertArraySame",_0());k(T,"arrayCtors",Rr());k(T,"DataView",L0());k(T,"datespace",U0());k(T,"arrayDataType",W());k(T,"arrayDataTypes",Z0());k(T,"aempty",Vt());k(T,"aemptyLike",yp());k(T,"filledarray",Ep());k(T,"filledarrayBy",zp());k(T,"Float32Array",fr());k(T,"Float64Array",sr());k(T,"iterator2array",Ip());k(T,"afull",Ir());k(T,"afullLike",Zp());k(T,"incrspace",Jp());k(T,"Int8Array",wr());k(T,"Int16Array",qr());k(T,"Int32Array",yr());k(T,"linspace",Gg());k(T,"logspace",Hg());k(T,"arrayMinDataType",ay());k(T,"anans",sy());k(T,"anansLike",my());k(T,"arrayNextDataType",qy());k(T,"aones",by());k(T,"aonesLike",Ty());k(T,"typedarraypool",Yy());k(T,"arrayPromotionRules",Jy());k(T,"reviveTypedArray",i1());k(T,"arraySafeCasts",s1());k(T,"arraySameKindCasts",g1());k(T,"arrayShape",w1());k(T,"SharedArrayBuffer",k1());k(T,"circarray2iterator",z1());k(T,"array2iterator",N1());k(T,"array2iteratorRight",W1());k(T,"typedarray2json",rd());k(T,"sparsearray2iterator",ud());k(T,"sparsearray2iteratorRight",cd());k(T,"stridedarray2iterator",qd());k(T,"arrayview2iterator",Ed());k(T,"arrayview2iteratorRight",Vd());k(T,"typedarray",zd());k(T,"complexarray",Dd());k(T,"complexarrayCtors",oi());k(T,"complexarrayDataTypes",Kd());k(T,"typedarrayCtors",Wr());k(T,"typedarrayDataTypes",Qd());k(T,"floatarrayCtors",Bt());k(T,"floatarrayDataTypes",aq());k(T,"intarrayCtors",fq());k(T,"intarrayDataTypes",gq());k(T,"realarray",hq());k(T,"realarrayCtors",Aq());k(T,"realarrayDataTypes",Vq());k(T,"realarrayFloatCtors",Rq());k(T,"realarrayFloatDataTypes",Pq());k(T,"intarraySignedCtors",Zq());k(T,"intarraySignedDataTypes",$q());k(T,"intarrayUnsignedCtors",ah());k(T,"intarrayUnsignedDataTypes",sh());k(T,"Uint8Array",hr());k(T,"Uint8ClampedArray",xr());k(T,"Uint16Array",dr());k(T,"Uint32Array",gr());k(T,"azeros",Ee());k(T,"azerosLike",mh());k(T,"constants",require("@stdlib/constants/array"));module.exports=T;
+"use strict";var l=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var di=l(function(XO,yi){"use strict";var gi="function";function qh(r){return typeof r.get===gi&&typeof r.set===gi}yi.exports=qh});var J=l(function(HO,qi){"use strict";var hh=di();qi.exports=hh});var wi=l(function(JO,xi){"use strict";var hi={float64:xh,float32:wh,int32:bh,int16:Sh,int8:Eh,uint32:Ah,uint16:Th,uint8:kh,uint8c:jh,generic:_h,default:Vh};function xh(r,e){return r[e]}function wh(r,e){return r[e]}function bh(r,e){return r[e]}function Sh(r,e){return r[e]}function Eh(r,e){return r[e]}function Ah(r,e){return r[e]}function Th(r,e){return r[e]}function kh(r,e){return r[e]}function jh(r,e){return r[e]}function _h(r,e){return r[e]}function Vh(r,e){return r[e]}function Ch(r){var e=hi[r];return typeof e=="function"?e:hi.default}xi.exports=Ch});var Q=l(function($O,bi){"use strict";var Oh=wi();bi.exports=Oh});var Ai=l(function(QO,Ei){"use strict";var Si={float64:Fh,float32:zh,int32:Lh,int16:Rh,int8:Mh,uint32:Bh,uint16:Ih,uint8:Nh,uint8c:Ph,generic:Uh,default:Dh};function Fh(r,e,t){r[e]=t}function zh(r,e,t){r[e]=t}function Lh(r,e,t){r[e]=t}function Rh(r,e,t){r[e]=t}function Mh(r,e,t){r[e]=t}function Bh(r,e,t){r[e]=t}function Ih(r,e,t){r[e]=t}function Nh(r,e,t){r[e]=t}function Ph(r,e,t){r[e]=t}function Uh(r,e,t){r[e]=t}function Dh(r,e,t){r[e]=t}function Gh(r){var e=Si[r];return typeof e=="function"?e:Si.default}Ei.exports=Gh});var ue=l(function(rF,Ti){"use strict";var Yh=Ai();Ti.exports=Yh});var _i=l(function(eF,ji){"use strict";var ki={complex128:Wh,complex64:Zh,default:Kh};function Wh(r,e){return r.get(e)}function Zh(r,e){return r.get(e)}function Kh(r,e){return r.get(e)}function Xh(r){var e=ki[r];return typeof e=="function"?e:ki.default}ji.exports=Xh});var $=l(function(tF,Vi){"use strict";var Hh=_i();Vi.exports=Hh});var Fi=l(function(iF,Oi){"use strict";var Ci={complex128:Jh,complex64:$h,default:Qh};function Jh(r,e,t){r.set(t,e)}function $h(r,e,t){r.set(t,e)}function Qh(r,e,t){r.set(t,e)}function r2(r){var e=Ci[r];return typeof e=="function"?e:Ci.default}Oi.exports=r2});var oe=l(function(aF,zi){"use strict";var e2=Fi();zi.exports=e2});var Ri=l(function(nF,Li){"use strict";var t2={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"};Li.exports=t2});var Bi=l(function(uF,Mi){"use strict";var i2=typeof Float64Array=="function"?Float64Array:void 0;Mi.exports=i2});var Ni=l(function(oF,Ii){"use strict";function a2(){throw new Error("not implemented")}Ii.exports=a2});var sr=l(function(vF,Pi){"use strict";var n2=require("@stdlib/assert/has-float64array-support"),u2=Bi(),o2=Ni(),Ze;n2()?Ze=u2:Ze=o2;Pi.exports=Ze});var Di=l(function(sF,Ui){"use strict";var v2=typeof Float32Array=="function"?Float32Array:void 0;Ui.exports=v2});var Yi=l(function(fF,Gi){"use strict";function s2(){throw new Error("not implemented")}Gi.exports=s2});var fr=l(function(lF,Wi){"use strict";var f2=require("@stdlib/assert/has-float32array-support"),l2=Di(),c2=Yi(),Ke;f2()?Ke=l2:Ke=c2;Wi.exports=Ke});var Ki=l(function(cF,Zi){"use strict";var m2=typeof Uint32Array=="function"?Uint32Array:void 0;Zi.exports=m2});var Hi=l(function(mF,Xi){"use strict";function p2(){throw new Error("not implemented")}Xi.exports=p2});var gr=l(function(pF,Ji){"use strict";var g2=require("@stdlib/assert/has-uint32array-support"),y2=Ki(),d2=Hi(),Xe;g2()?Xe=y2:Xe=d2;Ji.exports=Xe});var Qi=l(function(gF,$i){"use strict";var q2=typeof Int32Array=="function"?Int32Array:void 0;$i.exports=q2});var ea=l(function(yF,ra){"use strict";function h2(){throw new Error("not implemented")}ra.exports=h2});var yr=l(function(dF,ta){"use strict";var x2=require("@stdlib/assert/has-int32array-support"),w2=Qi(),b2=ea(),He;x2()?He=w2:He=b2;ta.exports=He});var aa=l(function(qF,ia){"use strict";var S2=typeof Uint16Array=="function"?Uint16Array:void 0;ia.exports=S2});var ua=l(function(hF,na){"use strict";function E2(){throw new Error("not implemented")}na.exports=E2});var dr=l(function(xF,oa){"use strict";var A2=require("@stdlib/assert/has-uint16array-support"),T2=aa(),k2=ua(),Je;A2()?Je=T2:Je=k2;oa.exports=Je});var sa=l(function(wF,va){"use strict";var j2=typeof Int16Array=="function"?Int16Array:void 0;va.exports=j2});var la=l(function(bF,fa){"use strict";function _2(){throw new Error("not implemented")}fa.exports=_2});var qr=l(function(SF,ca){"use strict";var V2=require("@stdlib/assert/has-int16array-support"),C2=sa(),O2=la(),$e;V2()?$e=C2:$e=O2;ca.exports=$e});var pa=l(function(EF,ma){"use strict";var F2=typeof Uint8Array=="function"?Uint8Array:void 0;ma.exports=F2});var ya=l(function(AF,ga){"use strict";function z2(){throw new Error("not implemented")}ga.exports=z2});var hr=l(function(TF,da){"use strict";var L2=require("@stdlib/assert/has-uint8array-support"),R2=pa(),M2=ya(),Qe;L2()?Qe=R2:Qe=M2;da.exports=Qe});var ha=l(function(kF,qa){"use strict";var B2=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;qa.exports=B2});var wa=l(function(jF,xa){"use strict";function I2(){throw new Error("not implemented")}xa.exports=I2});var xr=l(function(_F,ba){"use strict";var N2=require("@stdlib/assert/has-uint8clampedarray-support"),P2=ha(),U2=wa(),rt;N2()?rt=P2:rt=U2;ba.exports=rt});var Ea=l(function(VF,Sa){"use strict";var D2=typeof Int8Array=="function"?Int8Array:void 0;Sa.exports=D2});var Ta=l(function(CF,Aa){"use strict";function G2(){throw new Error("not implemented")}Aa.exports=G2});var wr=l(function(OF,ka){"use strict";var Y2=require("@stdlib/assert/has-int8array-support"),W2=Ea(),Z2=Ta(),et;Y2()?et=W2:et=Z2;ka.exports=et});var _a=l(function(FF,ja){"use strict";var K2=require("@stdlib/assert/is-array-like-object"),X2=require("@stdlib/assert/is-complex-like"),H2=require("@stdlib/complex/realf"),J2=require("@stdlib/complex/imagf"),$2=require("@stdlib/string/format");function Q2(r){var e,t,i;for(e=[];t=r.next(),!t.done;)if(i=t.value,K2(i)&&i.length>=2)e.push(i[0],i[1]);else if(X2(i))e.push(H2(i),J2(i));else return new TypeError($2("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));return e}ja.exports=Q2});var Ca=l(function(zF,Va){"use strict";var rx=require("@stdlib/assert/is-array-like-object"),ex=require("@stdlib/assert/is-complex-like"),tx=require("@stdlib/complex/realf"),ix=require("@stdlib/complex/imagf"),ax=require("@stdlib/string/format");function nx(r,e,t){var i,a,u,o;for(i=[],o=-1;a=r.next(),!a.done;)if(o+=1,u=e.call(t,a.value,o),rx(u)&&u.length>=2)i.push(u[0],u[1]);else if(ex(u))i.push(tx(u),ix(u));else return new TypeError(ax("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",u));return i}Va.exports=nx});var Fa=l(function(LF,Oa){"use strict";var ux=require("@stdlib/assert/is-complex-like"),ox=require("@stdlib/complex/realf"),vx=require("@stdlib/complex/imagf");function sx(r,e){var t,i,a,u;for(t=e.length,u=0,a=0;at.byteLength-r)throw new RangeError(L("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*rr));t=new ur(t,r,i*2)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(M,"BYTES_PER_ELEMENT",rr);D(M,"name","Complex64Array");D(M,"from",function(e){var t,i,a,u,o,n,v,s,f,c,m,p;if(!er(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Na(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(a=arguments[1],!er(a))throw new TypeError(L("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(K(e)){if(s=e.length,a){for(u=new this(s),o=u._buffer,p=0,m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return u}return new this(e)}if(tt(e)){if(a){for(s=e.length,e.get&&e.set?v=gx("default"):v=px("default"),m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return u}return new this(e)}if(Ra(e)&&Ia&&er(e[Pr])){if(o=e[Pr](),!er(o.next))throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a?n=yx(o,a,t):n=Ba(o),n instanceof Error)throw n;for(s=n.length/2,u=new this(s),o=u._buffer,m=0;m=this._length))return br(this._buffer,e)});se(M.prototype,"buffer",function(){return this._buffer.buffer});se(M.prototype,"byteLength",function(){return this._buffer.byteLength});se(M.prototype,"byteOffset",function(){return this._buffer.byteOffset});D(M.prototype,"BYTES_PER_ELEMENT",M.BYTES_PER_ELEMENT);D(M.prototype,"copyWithin",function(e,t){if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,t*2):this._buffer.copyWithin(e*2,t*2,arguments[2]*2),this});D(M.prototype,"entries",function(){var e,t,i,a,u,o,n;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,e=this._buffer,a=this._length,o=-1,n=-2,i={},D(i,"next",v),D(i,"return",s),Pr&&D(i,Pr,f),i;function v(){var c;return o+=1,u||o>=a?{done:!0}:(n+=2,c=new Ma(e[n],e[n+1]),{value:[o,c],done:!1})}function s(c){return u=!0,arguments.length?{value:c,done:!0}:{done:!0}}function f(){return t.entries()}});D(M.prototype,"every",function(e,t){var i,a;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=0;a--)if(u=br(i,a),e.call(t,u,a,this))return u});D(M.prototype,"findLastIndex",function(e,t){var i,a,u;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=this._length-1;a>=0;a--)if(u=br(i,a),e.call(t,u,a,this))return a;return-1});D(M.prototype,"forEach",function(e,t){var i,a,u;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=this._length))return br(this._buffer,e)});D(M.prototype,"includes",function(e,t){var i,a,u,o,n;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Er(e))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Ar(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(u=Fr(e),o=zr(e),i=this._buffer,n=t;n1){if(!Ar(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(u=Fr(e),o=zr(e),i=this._buffer,n=t;n1){if(!Ar(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(u=Fr(e),o=zr(e),i=this._buffer,n=t;n>=0;n--)if(a=2*n,u===i[a]&&o===i[a+1])return n;return-1});se(M.prototype,"length",function(){return this._length});D(M.prototype,"set",function(e){var t,i,a,u,o,n,v,s,f;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,arguments.length>1){if(i=arguments[1],!Hr(i))throw new TypeError(L("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(Er(e)){if(i>=this._length)throw new RangeError(L("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,a[i]=Fr(e),a[i+1]=zr(e);return}if(K(e)){if(n=e._length,i+n>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=a.byteOffset+i*rr,t.buffer===a.buffer&&t.byteOffsetf){for(u=new ur(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=a.byteOffset+i*rr,t.buffer===a.buffer&&t.byteOffsetf){for(u=new ur(n),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,s=0;su&&(t=u)}}return e>=u?(u=0,i=a.byteLength):e>=t?(u=0,i=a.byteOffset+e*rr):(u=t-e,i=a.byteOffset+e*rr),new this.constructor(a.buffer,i,u<0?0:u)});Pa.exports=M});var Tr=l(function(MF,Da){"use strict";var xx=Ua();Da.exports=xx});var Ya=l(function(BF,Ga){"use strict";var wx=require("@stdlib/assert/is-array-like-object"),bx=require("@stdlib/assert/is-complex-like"),Sx=require("@stdlib/string/format"),Ex=require("@stdlib/complex/real"),Ax=require("@stdlib/complex/imag");function Tx(r){var e,t,i;for(e=[];t=r.next(),!t.done;)if(i=t.value,wx(i)&&i.length>=2)e.push(i[0],i[1]);else if(bx(i))e.push(Ex(i),Ax(i));else return new TypeError(Sx("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));return e}Ga.exports=Tx});var Za=l(function(IF,Wa){"use strict";var kx=require("@stdlib/assert/is-array-like-object"),jx=require("@stdlib/assert/is-complex-like"),_x=require("@stdlib/string/format"),Vx=require("@stdlib/complex/real"),Cx=require("@stdlib/complex/imag");function Ox(r,e,t){var i,a,u,o;for(i=[],o=-1;a=r.next(),!a.done;)if(o+=1,u=e.call(t,a.value,o),kx(u)&&u.length>=2)i.push(u[0],u[1]);else if(jx(u))i.push(Vx(u),Cx(u));else return new TypeError(_x("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",u));return i}Wa.exports=Ox});var Xa=l(function(NF,Ka){"use strict";var Fx=require("@stdlib/assert/is-complex-like"),zx=require("@stdlib/complex/real"),Lx=require("@stdlib/complex/imag");function Rx(r,e){var t,i,a,u;for(t=e.length,u=0,a=0;at.byteLength-r)throw new RangeError(P("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*tr));t=new or(t,r,i*2)}}return X(this,"_buffer",t),X(this,"_length",t.length/2),this}X(G,"BYTES_PER_ELEMENT",tr);X(G,"name","Complex128Array");X(G,"from",function(e){var t,i,a,u,o,n,v,s,f,c,m,p;if(!lr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!tn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(a=arguments[1],!lr(a))throw new TypeError(P("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(cr(e)){if(s=e.length,a){for(u=new this(s),o=u._buffer,p=0,m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(P("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return u}return new this(e)}if(it(e)){if(a){for(s=e.length,e.get&&e.set?v=Ux("default"):v=Px("default"),m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(P("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return u}return new this(e)}if($a(e)&&en&&lr(e[Dr])){if(o=e[Dr](),!lr(o.next))throw new TypeError(P("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a?n=Dx(o,a,t):n=rn(o),n instanceof Error)throw n;for(s=n.length/2,u=new this(s),o=u._buffer,m=0;m=this._length))return Gr(this._buffer,e)});pe(G.prototype,"buffer",function(){return this._buffer.buffer});pe(G.prototype,"byteLength",function(){return this._buffer.byteLength});pe(G.prototype,"byteOffset",function(){return this._buffer.byteOffset});X(G.prototype,"BYTES_PER_ELEMENT",G.BYTES_PER_ELEMENT);X(G.prototype,"copyWithin",function(e,t){if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,t*2):this._buffer.copyWithin(e*2,t*2,arguments[2]*2),this});X(G.prototype,"entries",function(){var e,t,i,a,u,o,n;if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,e=this._buffer,a=this._length,o=-1,n=-2,i={},X(i,"next",v),X(i,"return",s),Dr&&X(i,Dr,f),i;function v(){var c;return o+=1,u||o>=a?{done:!0}:(n+=2,c=new Qa(e[n],e[n+1]),{value:[o,c],done:!1})}function s(c){return u=!0,arguments.length?{value:c,done:!0}:{done:!0}}function f(){return t.entries()}});X(G.prototype,"every",function(e,t){var i,a;if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!lr(e))throw new TypeError(P("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=0;a--)if(u=Gr(i,a),e.call(t,u,a,this))return u});X(G.prototype,"get",function(e){if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Jr(e))throw new TypeError(P("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return Gr(this._buffer,e)});pe(G.prototype,"length",function(){return this._length});X(G.prototype,"set",function(e){var t,i,a,u,o,n,v,s,f;if(!cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,arguments.length>1){if(i=arguments[1],!Jr(i))throw new TypeError(P("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(Ur(e)){if(i>=this._length)throw new RangeError(P("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,a[i]=ce(e),a[i+1]=me(e);return}if(cr(e)){if(n=e._length,i+n>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=a.byteOffset+i*tr,t.buffer===a.buffer&&t.byteOffsetf){for(u=new or(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=a.byteOffset+i*tr,t.buffer===a.buffer&&t.byteOffsetf){for(u=new or(n),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,s=0;s=0;s--)if(f=n-o+s,!(f<0)){if(v=e[f],a=t[s],a!==0&&a=0;s--)n=f%o,f-=n,f/=o,a[s]=n;for(i=[],s=0;s=0;u--)i.push(t[u]);e.push(i)}return e}Ls.exports=L6});var pt=l(function(rR,Ms){"use strict";var R6=Rs();Ms.exports=R6});var Is=l(function(eR,Bs){"use strict";var M6=pt();function B6(r){var e,t;for(e=[],t=0;t=0;t--)e.push(r[t]);return e}Ks.exports=W6});var dt=l(function(vR,Hs){"use strict";var Z6=Xs();Hs.exports=Z6});var $s=l(function(sR,Js){"use strict";var K6=dt();function X6(r){var e,t;for(e=[],t=0;t=0;a--)if(Se(r[a]))return a;return-1}for(a=t;a>=0;a--)if(e===r[a])return a;return-1}function gS(r,e,t,i){var a,u,o;if(a=r.data,u=r.accessors[0],i&&Se(e)){for(o=t;o>=0;o--)if(Se(u(a,o)))return o;return-1}for(o=t;o>=0;o--)if(e===u(a,o))return o;return-1}function yS(r,e,t,i){var a;if(mS(r,"lastIndexOf")&&i===!1)return r.lastIndexOf(e,t);if(t<0){if(t+=r.length,t<0)return-1}else t>r.length&&(t=r.length-1);return a=cS(r),a.accessorProtocol?gS(a,e,t,i):pS(r,e,t,i)}df.exports=yS});var xf=l(function(xR,hf){"use strict";var dS=qf();hf.exports=dS});var bf=l(function(wR,wf){"use strict";function qS(r,e,t){var i,a,u,o;if(t===0)return[];for(a=t-1,u=(e-r)/a,i=[r],o=1;o=0;m--)f=p%i[m],p-=f,p/=i[m],v[m]=f;for(o=[],m=0;m4&&(a=arguments[4]),c=r[0],m=r[1],v=0;v2){if(arguments.length===3?Np(t)?a=t:(u=t,o=!1):(a=i,u=t),u===0)return[];if(!_4(u)||u<0)throw new TypeError(Mr("invalid argument. Length must be a positive integer. Value: `%s`.",u));if(o){if(!Np(a))throw new TypeError(Mr("invalid argument. Options argument must be an object. Value: `%s`.",a));if(j4(a,"round")){if(!V4(a.round))throw new TypeError(Mr("invalid option. `%s` option must be a string. Option: `%s`.","round",a.round));if(Pp.indexOf(a.round)===-1)throw new Error(Mr('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"round",Pp.join('", "'),a.round))}}}switch(a.round){case"round":s=O4;break;case"ceil":s=F4;break;case"floor":default:s=C4;break}for(v=u-1,c=(e.getTime()-r.getTime())/v,n=new Array(u),f=r,n[0]=f,f=f.getTime(),m=1;m1?i=arguments[1]:i="float64",i==="generic")return oA(r);if(e=vA(i),e===null)throw new TypeError(u0("invalid argument. Second argument must be a supported data type. Value: `%s`.",i));return a=uA(i),n=e*r,i==="complex128"&&(n+=8),u=nA(n),t=u.byteOffset,i==="complex128"&&(n0(t/e)||(t+=8)),o=new a(u.buffer,t,r),o}o0.exports=sA});var l0=l(function(IB,f0){"use strict";var fA=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,lA=Rr(),cA=jr(),s0=require("@stdlib/string/format");function mA(r){var e,t;if(!fA(r))throw new TypeError(s0("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(arguments.length>1?e=arguments[1]:e="float64",e==="generic")return cA(r);if(t=lA(e),t===null)throw new TypeError(s0("invalid argument. Second argument must be a recognized data type. Value: `%s`.",e));return new t(r)}f0.exports=mA});var Ee=l(function(NB,c0){"use strict";var pA=l0();c0.exports=pA});var g0=l(function(PB,p0){"use strict";var m0=Ee();function gA(r){return arguments.length>1?m0(r,arguments[1]):m0(r)}p0.exports=gA});var Ct=l(function(UB,y0){"use strict";var yA=Qp(),dA=v0(),qA=g0(),Vt;yA()?Vt=dA:Vt=qA;y0.exports=Vt});var q0=l(function(DB,d0){"use strict";var hA=W(),xA=Ct(),wA=require("@stdlib/string/format");function bA(r){var e=hA(r);if(e===null)throw new TypeError(wA("invalid argument. First argument must be either an array, typed array, or complex typed array. Value: `%s`.",r));return arguments.length>1&&(e=arguments[1]),xA(r.length,e)}d0.exports=bA});var x0=l(function(GB,h0){"use strict";var SA=q0();h0.exports=SA});var T0=l(function(YB,A0){"use strict";var EA=require("@stdlib/assert/is-string").isPrimitive,w0=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,b0=require("@stdlib/assert/is-collection"),Ot=require("@stdlib/assert/is-arraybuffer"),S0=require("@stdlib/assert/is-object"),Ae=require("@stdlib/assert/is-function"),AA=Rr(),TA=require("@stdlib/blas/ext/base/gfill"),kA=mr(),jA=require("@stdlib/assert/has-iterator-symbol-support"),Te=require("@stdlib/symbol/iterator"),_A=require("@stdlib/iter/length"),Sr=require("@stdlib/string/format"),E0=jA();function VA(r,e){var t,i;for(t=[];i=r.next(),!i.done;)t.push(e);return t}function CA(r,e){var t;for(t=0;t=0&&EA(arguments[e])?(t=arguments[e],e-=1):t="float64",i=AA(t),i===null)throw new TypeError(Sr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(e<=0)return[];if(r=arguments[0],o=arguments[1],e===1){if(w0(o)?u=o:b0(o)&&(u=o.length),u!==void 0)return kA(r,u);if(Ot(o))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(S0(o)){if(E0===!1)throw new TypeError(Sr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",o));if(!Ae(o[Te]))throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));if(o=o[Te](),!Ae(o.next))throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));return VA(o,r)}throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o))}else if(Ot(o))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o))}if(e<=0)return new i(0);if(e===1)if(o=arguments[1],b0(o))a=new i(o.length);else if(Ot(o))a=new i(o);else if(w0(o))a=new i(o);else if(S0(o)){if(E0===!1)throw new TypeError(Sr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",o));if(!Ae(o[Te]))throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));if(o=o[Te](),!Ae(o.next))throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));a=new i(_A(o))}else throw new TypeError(Sr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));else e===2?a=new i(arguments[1],arguments[2]):a=new i(arguments[1],arguments[2],arguments[3]);return a.length>0&&(/^complex/.test(t)?CA(a,arguments[0]):TA(a.length,arguments[0],a,1)),a}A0.exports=OA});var j0=l(function(WB,k0){"use strict";var FA=T0();k0.exports=FA});var R0=l(function(ZB,L0){"use strict";var _0=require("@stdlib/assert/is-string").isPrimitive,V0=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,C0=require("@stdlib/assert/is-collection"),Ft=require("@stdlib/assert/is-arraybuffer"),O0=require("@stdlib/assert/is-object"),Br=require("@stdlib/assert/is-function"),zt=Rr(),zA=require("@stdlib/blas/ext/base/gfill-by"),LA=st(),RA=require("@stdlib/assert/has-iterator-symbol-support"),ke=require("@stdlib/symbol/iterator"),MA=require("@stdlib/iter/length"),vr=require("@stdlib/string/format"),F0=RA(),z0="float64";function BA(r,e,t){var i,a,u;for(i=[],a=-1;u=r.next(),!u.done;)a+=1,i.push(e.call(t,a));return i}function IA(r,e,t){var i;for(i=0;i1)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(a=zt(t),a===null)throw new TypeError(vr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));return new a(0)}if(e<2)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(e-=1,Br(arguments[e]))if(Br(arguments[e-1])){if(r=arguments[e],e-=1,i=arguments[e],e===0)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.")}else i=arguments[e];else if(e>=2){if(r=arguments[e],e-=1,i=arguments[e],!Br(i))throw new TypeError(vr("invalid argument. Callback argument must be a function. Value: `%s`.",i))}else throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(e-=1,e>=0&&_0(arguments[e])?(t=arguments[e],e-=1):t=z0,a=zt(t),a===null)throw new TypeError(vr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(n=arguments[0],e===0){if(V0(n)?o=n:C0(n)&&(o=n.length),o!==void 0)return LA(o,i,r);if(Ft(n))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(O0(n)){if(F0===!1)throw new TypeError(vr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",n));if(!Br(n[ke]))throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));if(n=n[ke](),!Br(n.next))throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));return BA(n,i,r)}throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n))}else if(Ft(n))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n))}if(e===0)if(n=arguments[0],C0(n))u=new a(n.length);else if(Ft(n))u=new a(n);else if(V0(n))u=new a(n);else if(O0(n)){if(F0===!1)throw new TypeError(vr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",n));if(!Br(n[ke]))throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));if(n=n[ke](),!Br(n.next))throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));u=new a(MA(n))}else throw new TypeError(vr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",n));else e===1?u=new a(arguments[0],arguments[1]):u=new a(arguments[0],arguments[1],arguments[2]);return u.length>0&&(/^complex/.test(t)?IA(u,i,r):zA(u.length,u,1,v)),u;function v(s,f){return i.call(r,f)}}L0.exports=NA});var B0=l(function(KB,M0){"use strict";var PA=R0();M0.exports=PA});var P0=l(function(XB,N0){"use strict";var I0=require("@stdlib/assert/is-function"),UA=require("@stdlib/assert/is-collection"),DA=require("@stdlib/assert/is-iterator-like"),GA=J(),YA=oe(),WA=ue(),ZA=W(),Lt=require("@stdlib/string/format");function KA(){var r,e,t,i,a,u,o,n,v;if(r=arguments[0],arguments.length>1)if(UA(arguments[1])){if(i=arguments[1],arguments.length>2){if(t=arguments[2],!I0(t))throw new TypeError(Lt("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[3]}}else{if(t=arguments[1],!I0(t))throw new TypeError(Lt("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[2]}if(!DA(r))throw new TypeError(Lt("invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `%s`.",r));if(n=-1,i===void 0){if(i=[],t){for(;n+=1,v=r.next(),!v.done;)i.push(t.call(e,v.value,n));return i}for(;v=r.next(),!v.done;)i.push(v.value);return i}if(a=i.length,o=ZA(i),GA(i)?u=YA(o):u=WA(o),t){for(;n2?t=arguments[2]:t="float64",t==="generic")return $A(e,r);if(i=JA(t),i===null)throw new TypeError(G0("invalid argument. Third argument must be a recognized data type. Value: `%s`.",t));return a=new i(r),QA(r,e,a,1),a}Y0.exports=rT});var Ir=l(function($B,Z0){"use strict";var eT=W0();Z0.exports=eT});var X0=l(function(QB,K0){"use strict";var tT=require("@stdlib/string/format"),iT=W(),aT=Ir(),nT=require("@stdlib/complex/float64"),uT=require("@stdlib/complex/float32");function oT(r,e){var t,i;if(t=iT(r),t===null)throw new TypeError(tT("invalid argument. First argument must be either an array, typed array, or complex typed array. Value: `%s`.",r));return arguments.length>2&&(t=arguments[2]),typeof e=="number"?t==="complex128"?i=new nT(e,0):t==="complex64"?i=new uT(e,0):i=e:i=e,aT(r.length,i,t)}K0.exports=oT});var J0=l(function(rI,H0){"use strict";var vT=X0();H0.exports=vT});var Q0=l(function(eI,$0){"use strict";var sT=require("@stdlib/math/base/special/ceil"),Rt=require("@stdlib/assert/is-number").isPrimitive,Mt=require("@stdlib/math/base/assert/is-nan"),Bt=require("@stdlib/string/format"),fT=require("@stdlib/constants/uint32/max"),lT=qt();function cT(r,e,t){var i,a;if(!Rt(r)||Mt(r))throw new TypeError(Bt("invalid argument. Start must be numeric. Value: `%s`.",r));if(!Rt(e)||Mt(e))throw new TypeError(Bt("invalid argument. Stop must be numeric. Value: `%s`.",e));if(arguments.length<3)a=1;else if(a=t,!Rt(a)||Mt(a))throw new TypeError(Bt("invalid argument. Increment must be numeric. Value: `%s`.",a));if(i=sT((e-r)/a),i>fT)throw new RangeError("invalid arguments. Generated array exceeds maximum array length.");return lT(r,e,a)}$0.exports=cT});var eg=l(function(tI,rg){"use strict";var mT=Q0();rg.exports=mT});var ig=l(function(iI,tg){"use strict";var pT=sr(),gT=fr(),yT=kr(),dT=Tr(),qT={float64:pT,float32:gT,complex128:yT,complex64:dT};tg.exports=qT});var ng=l(function(aI,ag){"use strict";var hT=ig();function xT(r){return hT[r]||null}ag.exports=xT});var It=l(function(nI,ug){"use strict";var wT=ng();ug.exports=wT});var vg=l(function(uI,og){"use strict";function bT(r,e,t,i){var a,u,o,n;if(t===0)return[];if(t===1)return i?[e]:[r];for(a=[r],i?u=t-1:u=t,o=(e-r)/u,n=1;n3&&(u=NT(i,arguments[3]),u))throw u;if(i.dtype==="generic")return s?BT(n,r,v,e,t,i.endpoint):MT(r,e,t,i.endpoint);if(a=zT(i.dtype),a===null)throw new TypeError(Zr('invalid option. `%s` option must be a real or complex floating-point data type or "generic". Option: `%s`.',"dtype",i.dtype));if(o=new a(t),i.dtype==="complex64")return kg(LT(o,0),n,r,v,e,t,i.endpoint),o;if(i.dtype==="complex128")return kg(RT(o,0),n,r,v,e,t,i.endpoint),o;if(s)throw new TypeError('invalid arguments. If either of the first two arguments are complex numbers, the output array data type must be a complex number data type or "generic".');return IT(o,r,e,t,i.endpoint)}jg.exports=UT});var Lg=l(function(mI,zg){"use strict";var DT=require("@stdlib/complex/float32"),GT=require("@stdlib/complex/float64"),Vg=require("@stdlib/complex/real"),Cg=require("@stdlib/complex/imag"),Og=require("@stdlib/complex/realf"),Fg=require("@stdlib/complex/imagf");function YT(r,e,t,i,a,u,o){var n,v,s,f,c,m,p,g,y,d,q,h,b,S;if(u===0)return r;if(v=0,e==="float64"?(s=t,c=0):e==="complex64"?(v+=1,s=Og(t),c=Fg(t)):(s=Vg(t),c=Cg(t)),i==="float64"?(f=a,m=0):i==="complex64"?(v+=1,f=Og(a),m=Fg(a)):(f=Vg(a),m=Cg(a)),v===2?n=DT:n=GT,g=r.data,p=r.accessors[1],u===1)return o?p(g,0,new n(f,m)):p(g,0,new n(s,c)),r;for(p(g,0,new n(s,c)),o?b=u-1:b=u,q=(f-s)/b,h=(m-c)/b,S=1;S3&&(a=rk(i,arguments[3]),a))throw a;if(v=KT(t),v===null&&(v="generic"),v==="complex64")return Dg(XT(t,0),u,r,o,e,t.length,i.endpoint),t;if(v==="complex128")return Dg(HT(t,0),u,r,o,e,t.length,i.endpoint),t;if(n){if(v==="generic")return s=Ug(t),JT(s,u,r,o,e,t.length,i.endpoint),t;throw new TypeError('invalid arguments. If either of the first two arguments are complex numbers, the output array must be a complex number array or a "generic" array-like object.')}return s=Ug(t),s.accessorProtocol?($T(s,r,e,t.length,i.endpoint),t):(QT(t,r,e,t.length,i.endpoint),t)}Gg.exports=tk});var Kg=l(function(yI,Zg){"use strict";var ik=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wg=_g(),ak=Yg();ik(Wg,"assign",ak);Zg.exports=Wg});var $g=l(function(dI,Jg){"use strict";var Xg=require("@stdlib/assert/is-number").isPrimitive,nk=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Yt=require("@stdlib/string/format"),Hg=require("@stdlib/math/base/assert/is-nan"),uk=xt();function ok(r,e,t){if(!Xg(r)||Hg(r))throw new TypeError(Yt("invalid argument. Exponent of start value must be numeric. Value: `%s`.",r));if(!Xg(e)||Hg(e))throw new TypeError(Yt("invalid argument. Exponent of stop value must be numeric. Value: `%s`.",e));if(arguments.length<3)t=10;else if(!nk(t))throw new TypeError(Yt("invalid argument. Length must be a nonnegative integer. Value: `%s`.",t));return uk(r,e,t)}Jg.exports=ok});var ry=l(function(qI,Qg){"use strict";var vk=$g();Qg.exports=vk});var uy=l(function(hI,ny){"use strict";var ty=require("@stdlib/math/base/assert/is-integer"),sk=require("@stdlib/math/base/assert/is-negative-zero"),fk=require("@stdlib/assert/is-complex-like"),iy=require("@stdlib/constants/float64/pinf"),ay=require("@stdlib/constants/float64/ninf"),je=require("@stdlib/constants/float32/smallest-subnormal"),lk=require("@stdlib/constants/float32/max-safe-integer"),ck=require("@stdlib/constants/float32/min-safe-integer"),mk=require("@stdlib/constants/int8/min"),pk=require("@stdlib/constants/int16/min"),gk=require("@stdlib/constants/int32/min"),yk=require("@stdlib/constants/uint8/max"),dk=require("@stdlib/constants/uint16/max"),qk=require("@stdlib/constants/uint32/max");function ey(r){return r!==r||r===iy||r===ay?"float32":ty(r)?r>=ck&&r<=lk?"float32":"float64":r>-je&&r=mk?"int8":r>=pk?"int16":r>=gk?"int32":"float64":r<=yk?"uint8":r<=dk?"uint16":r<=qk?"uint32":"float64":r>-je&&r1){if(e=arguments[1],sy.indexOf(e)===-1)throw new TypeError(Ek('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',sy.join('", "'),e))}else e="float64";return e==="complex128"?t=Ak:e==="complex64"?t=Tk:t=NaN,Sk(r,t,e)}fy.exports=kk});var my=l(function(bI,cy){"use strict";var jk=ly();cy.exports=jk});var gy=l(function(SI,py){"use strict";var _k=W(),Vk=Ir(),Ck=require("@stdlib/complex/float64"),Ok=require("@stdlib/complex/float32"),Wt=require("@stdlib/string/format"),Fk=new Ck(NaN,NaN),zk=new Ok(NaN,NaN),_e=["float64","float32","complex128","complex64","generic"];function Lk(r){var e,t;if(e=_k(r),e===null)throw new TypeError(Wt("invalid argument. First argument must be either an array, typed array, or complex typed array. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],_e.indexOf(e)===-1)throw new TypeError(Wt('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',_e.join('", "'),e))}else if(_e.indexOf(e)===-1)throw new TypeError(Wt('invalid argument. First argument must be one of the following data types: "%s". Value: `%s`.',_e.join('", "'),e));return e==="complex128"?t=Fk:e==="complex64"?t=zk:t=NaN,Vk(r.length,t,e)}py.exports=Lk});var dy=l(function(EI,yy){"use strict";var Rk=gy();yy.exports=Rk});var qy=l(function(AI,Mk){Mk.exports={float64:-1,float32:"float64",int32:-1,int16:"int32",int8:"int16",uint32:-1,uint16:"uint32",uint8:"uint16",uint8c:"uint16",generic:-1,complex64:"complex128",complex128:-1}});var xy=l(function(TI,hy){"use strict";var Bk=require("@stdlib/utils/keys"),Ik=require("@stdlib/assert/has-own-property"),Ve=qy();function Nk(){var r,e,t,i;for(t={},r=Bk(Ve),e=r.length,i=0;i1?e=arguments[1]:e="float64",e==="complex128"?t=Wk:e==="complex64"?t=Zk:t=1,Yk(r,t,e)}Sy.exports=Kk});var Ty=l(function(_I,Ay){"use strict";var Xk=Ey();Ay.exports=Xk});var jy=l(function(VI,ky){"use strict";var Hk=W(),Jk=Ir(),$k=require("@stdlib/complex/float64"),Qk=require("@stdlib/complex/float32"),rj=require("@stdlib/string/format"),ej=new $k(1,0),tj=new Qk(1,0);function ij(r){var e,t;if(e=Hk(r),e===null)throw new TypeError(rj("invalid argument. First argument must be either an array, typed array, or complex typed array. Value: `%s`.",r));return arguments.length>1&&(e=arguments[1]),e==="complex128"?t=ej:e==="complex64"?t=tj:t=1,Jk(r.length,t,e)}ky.exports=ij});var Vy=l(function(CI,_y){"use strict";var aj=jy();_y.exports=aj});var Oy=l(function(OI,Cy){"use strict";function nj(){return{highWaterMark:9007199254740992}}Cy.exports=nj});var Ly=l(function(FI,zy){"use strict";var uj=require("@stdlib/assert/is-plain-object"),oj=require("@stdlib/assert/has-own-property"),vj=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fy=require("@stdlib/string/format");function sj(r,e){return uj(e)?oj(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!vj(r.highWaterMark))?new TypeError(Fy("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","highWaterMark",r.highWaterMark)):null:new TypeError(Fy("invalid argument. Options argument must be an object. Value: `%s`.",e))}zy.exports=sj});var My=l(function(zI,Ry){"use strict";function fj(r){var e,t;for(e=[],t=0;ti.highWaterMark?null:(p=new wj(m),e+=m,p)}function n(m,p,g){var y;return p===0?new m(0):(y=o(Ej(p)*_j[g]),y===null?y:new m(y,0,p))}function v(){var m,p,g,y,d,q,h,b,S;if(m=arguments.length,m&&cj(arguments[m-1])?(m-=1,p=arguments[m]):p="float64",g=Xt(p),g===null)throw new TypeError(Zt("invalid argument. Must provide a recognized data type. Value: `%s`.",p));if(m<=0)return new g(0);if(mj(arguments[0]))return n(g,arguments[0],p);if(pj(arguments[0])){if(y=arguments[0],b=y.length,qj(y)?y=Ny(y,0):dj(y)?y=Iy(y,0):/^complex/.test(p)&&(b/=2),d=n(g,b,p),d===null)return d;if(Dy(d)||Uy(d))return d.set(y),d;for(h=Py(xj(y)).accessors[0],q=Py(p).accessors[1],S=0;S0){for(p=Sj(Kt(m.byteLength)),p=Aj(t.length-1,p),g=t[p],y=0;y1&&(e.length=w1(t,e,1,r,t>2)),e}b1.exports=d_});var A1=l(function($I,E1){"use strict";var q_=S1();E1.exports=q_});var k1=l(function(QI,T1){"use strict";var h_=typeof SharedArrayBuffer=="function"?SharedArrayBuffer:null;T1.exports=h_});var _1=l(function(rN,j1){"use strict";function x_(r){throw new Error("not supported. The current environment does not support SharedArrayBuffers, and, unfortunately, SharedArrayBuffers cannot be polyfilled. For shared memory applications, upgrade your runtime environment to one which supports SharedArrayBuffers.")}j1.exports=x_});var C1=l(function(eN,V1){"use strict";var w_=require("@stdlib/assert/has-sharedarraybuffer-support"),b_=k1(),S_=_1(),$t;w_()?$t=b_:$t=S_;V1.exports=$t});var R1=l(function(tN,L1){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),O1=require("@stdlib/assert/has-own-property"),F1=require("@stdlib/assert/is-function"),E_=require("@stdlib/assert/is-collection"),A_=require("@stdlib/assert/is-plain-object"),T_=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,k_=J(),z1=require("@stdlib/symbol/iterator"),j_=$(),__=Q(),V_=W(),ae=require("@stdlib/string/format");function Qt(r){var e,t,i,a,u,o,n,v,s,f;if(!E_(r))throw new TypeError(ae("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(a={iter:1e308,dir:1},arguments.length>1)if(A_(arguments[1])){if(t=arguments[1],arguments.length>2){if(n=arguments[2],!F1(n))throw new TypeError(ae("invalid argument. Callback argument must be a function. Value: `%s`.",n));e=arguments[3]}if(O1(t,"iter")&&(a.iter=t.iter,!T_(t.iter)))throw new TypeError(ae("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter));if(O1(t,"dir")&&(a.dir=t.dir,t.dir!==1&&t.dir!==-1))throw new TypeError(ae("invalid option. `%s` option must be either `1` or `-1`. Option: `%s`.","dir",t.dir))}else{if(n=arguments[1],!F1(n))throw new TypeError(ae("invalid argument. Second argument must be either a function or an options object. Value: `%s`.",n));e=arguments[2]}return i=0,u={},n?a.dir===1?(f=-1,Kr(u,"next",c)):(f=r.length,Kr(u,"next",m)):a.dir===1?(f=-1,Kr(u,"next",p)):(f=r.length,Kr(u,"next",g)),Kr(u,"return",y),z1&&Kr(u,z1,d),s=V_(r),k_(r)?v=j_(s):v=__(s),u;function c(){return f=(f+1)%r.length,i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:n.call(e,v(r,f),f,i,r),done:!1}}function m(){return f-=1,f<0&&(f+=r.length),i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:n.call(e,v(r,f),f,i,r),done:!1}}function p(){return f=(f+1)%r.length,i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:v(r,f),done:!1}}function g(){return f-=1,f<0&&(f+=r.length),i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:v(r,f),done:!1}}function y(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function d(){return n?Qt(r,a,n,e):Qt(r,a)}}L1.exports=Qt});var B1=l(function(iN,M1){"use strict";var C_=R1();M1.exports=C_});var U1=l(function(aN,P1){"use strict";var Re=require("@stdlib/utils/define-nonenumerable-read-only-property"),O_=require("@stdlib/assert/is-function"),F_=require("@stdlib/assert/is-collection"),z_=J(),I1=require("@stdlib/symbol/iterator"),L_=$(),R_=Q(),M_=W(),N1=require("@stdlib/string/format");function ri(r){var e,t,i,a,u,o,n;if(!F_(r))throw new TypeError(N1("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!O_(a))throw new TypeError(N1("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return n=-1,t={},a?Re(t,"next",v):Re(t,"next",s),Re(t,"return",f),I1&&Re(t,I1,c),o=M_(r),z_(r)?u=L_(o):u=R_(o),t;function v(){return n+=1,i||n>=r.length?{done:!0}:{value:a.call(e,u(r,n),n,r),done:!1}}function s(){return n+=1,i||n>=r.length?{done:!0}:{value:u(r,n),done:!1}}function f(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function c(){return a?ri(r,a,e):ri(r)}}P1.exports=ri});var G1=l(function(nN,D1){"use strict";var B_=U1();D1.exports=B_});var K1=l(function(uN,Z1){"use strict";var Me=require("@stdlib/utils/define-nonenumerable-read-only-property"),I_=require("@stdlib/assert/is-function"),N_=require("@stdlib/assert/is-collection"),P_=J(),Y1=require("@stdlib/symbol/iterator"),U_=$(),D_=Q(),G_=W(),W1=require("@stdlib/string/format");function ei(r){var e,t,i,a,u,o,n,v;if(!N_(r))throw new TypeError(W1("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!I_(a))throw new TypeError(W1("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return u=r.length,v=u,t={},a?Me(t,"next",s):Me(t,"next",f),Me(t,"return",c),Y1&&Me(t,Y1,m),n=G_(r),P_(r)?o=U_(n):o=D_(n),t;function s(){return v+=r.length-u-1,u=r.length,i||v<0?(i=!0,{done:!0}):{value:a.call(e,o(r,v),v,r),done:!1}}function f(){return v+=r.length-u-1,u=r.length,i||v<0?(i=!0,{done:!0}):{value:o(r,v),done:!1}}function c(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return a?ei(r,a,e):ei(r)}}Z1.exports=ei});var H1=l(function(oN,X1){"use strict";var Y_=K1();X1.exports=Y_});var $1=l(function(vN,J1){"use strict";var W_=wr(),Z_=hr(),K_=xr(),X_=qr(),H_=dr(),J_=yr(),$_=gr(),Q_=fr(),rV=sr(),eV=Tr(),tV=kr(),iV=[[rV,"Float64Array"],[Q_,"Float32Array"],[J_,"Int32Array"],[$_,"Uint32Array"],[X_,"Int16Array"],[H_,"Uint16Array"],[W_,"Int8Array"],[Z_,"Uint8Array"],[K_,"Uint8ClampedArray"],[eV,"Complex64Array"],[tV,"Complex128Array"]];J1.exports=iV});var rd=l(function(sN,Q1){"use strict";var aV=require("@stdlib/assert/instance-of"),nV=require("@stdlib/utils/constructor-name"),uV=require("@stdlib/utils/get-prototype-of"),Xr=$1();function oV(r){var e,t;for(t=0;t1){if(a=arguments[1],!yV(a))throw new TypeError(ud("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return n=-1,t={},a?Be(t,"next",v):Be(t,"next",s),Be(t,"return",f),nd&&Be(t,nd,c),o=wV(r),qV(r)?u=hV(o):u=xV(o),t;function v(){var m;if(i)return{done:!0};for(m=r.length,n+=1;n=m?(i=!0,{done:!0}):{value:a.call(e,u(r,n),n,r),done:!1}}function s(){var m;if(i)return{done:!0};for(m=r.length,n+=1;n=m?(i=!0,{done:!0}):{value:u(r,n),done:!1}}function f(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function c(){return a?ti(r,a,e):ti(r)}}od.exports=ti});var fd=l(function(mN,sd){"use strict";var bV=vd();sd.exports=bV});var pd=l(function(pN,md){"use strict";var Ie=require("@stdlib/utils/define-nonenumerable-read-only-property"),SV=require("@stdlib/assert/is-function"),EV=require("@stdlib/assert/is-collection"),AV=J(),ld=require("@stdlib/symbol/iterator"),TV=$(),kV=Q(),jV=W(),cd=require("@stdlib/string/format");function ii(r){var e,t,i,a,u,o,n,v;if(!EV(r))throw new TypeError(cd("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!SV(a))throw new TypeError(cd("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return u=r.length,v=u,t={},a?Ie(t,"next",s):Ie(t,"next",f),Ie(t,"return",c),ld&&Ie(t,ld,m),n=jV(r),AV(r)?o=TV(n):o=kV(n),t;function s(){if(i)return{done:!0};for(v+=r.length-u-1,u=r.length;v>=0&&o(r,v)===void 0;)v-=1;return v<0?(i=!0,{done:!0}):{value:a.call(e,o(r,v),v,r),done:!1}}function f(){if(i)return{done:!0};for(v+=r.length-u-1,u=r.length;v>=0&&o(r,v)===void 0;)v-=1;return v<0?(i=!0,{done:!0}):{value:o(r,v),done:!1}}function c(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return a?ii(r,a,e):ii(r)}}md.exports=ii});var yd=l(function(gN,gd){"use strict";var _V=pd();gd.exports=_V});var xd=l(function(yN,hd){"use strict";var Ne=require("@stdlib/utils/define-nonenumerable-read-only-property"),VV=require("@stdlib/assert/is-function"),CV=require("@stdlib/assert/is-collection"),dd=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,OV=require("@stdlib/assert/is-integer").isPrimitive,FV=J(),qd=require("@stdlib/symbol/iterator"),zV=$(),LV=Q(),RV=W(),ne=require("@stdlib/string/format");function ai(r,e,t,i){var a,u,o,n,v,s,f,c;if(!dd(r))throw new TypeError(ne("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!CV(e))throw new TypeError(ne("invalid argument. Second argument must be an array-like object. Value: `%s`.",e));if(!OV(t))throw new TypeError(ne("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(!dd(i))throw new TypeError(ne("invalid argument. Fourth argument must be a nonnegative integer. Value: `%s`.",i));if(arguments.length>4){if(n=arguments[4],!VV(n))throw new TypeError(ne("invalid argument. Fifth argument must be a function. Value: `%s`.",n));a=arguments[5]}return v=i,c=-1,u={},n?Ne(u,"next",m):Ne(u,"next",p),Ne(u,"return",g),qd&&Ne(u,qd,y),f=RV(e),FV(e)?s=zV(f):s=LV(f),u;function m(){var d;return c+=1,o||c>=r?{done:!0}:(d=n.call(a,s(e,v),v,c,e),v+=t,{value:d,done:!1})}function p(){var d;return c+=1,o||c>=r?{done:!0}:(d=s(e,v),v+=t,{value:d,done:!1})}function g(d){return o=!0,arguments.length?{value:d,done:!0}:{done:!0}}function y(){return n?ai(r,e,t,i,n,a):ai(r,e,t,i)}}hd.exports=ai});var bd=l(function(dN,wd){"use strict";var MV=xd();wd.exports=MV});var Td=l(function(qN,Ad){"use strict";var Pe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ue=require("@stdlib/assert/is-function"),BV=require("@stdlib/assert/is-collection"),Sd=require("@stdlib/assert/is-integer").isPrimitive,IV=J(),Ed=require("@stdlib/symbol/iterator"),NV=$(),PV=Q(),UV=W(),De=require("@stdlib/string/format");function ni(r){var e,t,i,a,u,o,n,v,s,f;if(!BV(r))throw new TypeError(De("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,n=r.length;else if(i===2)Ue(arguments[1])?(t=0,o=arguments[1]):t=arguments[1],n=r.length;else if(i===3)Ue(arguments[1])?(t=0,n=r.length,o=arguments[1],e=arguments[2]):Ue(arguments[2])?(t=arguments[1],n=r.length,o=arguments[2]):(t=arguments[1],n=arguments[2]);else{if(t=arguments[1],n=arguments[2],o=arguments[3],!Ue(o))throw new TypeError(De("invalid argument. Fourth argument must be a function. Value: `%s`.",o));e=arguments[4]}if(!Sd(t))throw new TypeError(De("invalid argument. Second argument must be either an integer (starting index) or a function. Value: `%s`.",t));if(!Sd(n))throw new TypeError(De("invalid argument. Third argument must be either an integer (ending index) or a function. Value: `%s`.",n));return n<0?(n=r.length+n,n<0&&(n=0)):n>r.length&&(n=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=t-1,a={},o?Pe(a,"next",c):Pe(a,"next",m),Pe(a,"return",p),Ed&&Pe(a,Ed,g),s=UV(r),IV(r)?v=NV(s):v=PV(s),a;function c(){return f+=1,u||f>=n?{done:!0}:{value:o.call(e,v(r,f),f,f-t,r),done:!1}}function m(){return f+=1,u||f>=n?{done:!0}:{value:v(r,f),done:!1}}function p(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function g(){return o?ni(r,t,n,o,e):ni(r,t,n)}}Ad.exports=ni});var jd=l(function(hN,kd){"use strict";var DV=Td();kd.exports=DV});var Od=l(function(xN,Cd){"use strict";var Ge=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ye=require("@stdlib/assert/is-function"),GV=require("@stdlib/assert/is-collection"),_d=require("@stdlib/assert/is-integer").isPrimitive,YV=J(),Vd=require("@stdlib/symbol/iterator"),WV=$(),ZV=Q(),KV=W(),We=require("@stdlib/string/format");function ui(r){var e,t,i,a,u,o,n,v,s,f;if(!GV(r))throw new TypeError(We("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,n=r.length;else if(i===2)Ye(arguments[1])?(t=0,o=arguments[1]):t=arguments[1],n=r.length;else if(i===3)Ye(arguments[1])?(t=0,n=r.length,o=arguments[1],e=arguments[2]):Ye(arguments[2])?(t=arguments[1],n=r.length,o=arguments[2]):(t=arguments[1],n=arguments[2]);else{if(t=arguments[1],n=arguments[2],o=arguments[3],!Ye(o))throw new TypeError(We("invalid argument. Fourth argument must be a function. Value: `%s`.",o));e=arguments[4]}if(!_d(t))throw new TypeError(We("invalid argument. Second argument must be either an integer (starting view index) or a function. Value: `%s`.",t));if(!_d(n))throw new TypeError(We("invalid argument. Third argument must be either an integer (ending view index) or a function. Value: `%s`.",n));return n<0?(n=r.length+n,n<0&&(n=0)):n>r.length&&(n=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=n,a={},o?Ge(a,"next",c):Ge(a,"next",m),Ge(a,"return",p),Vd&&Ge(a,Vd,g),s=KV(r),YV(r)?v=WV(s):v=ZV(s),a;function c(){return f-=1,u||f1&&(e=arguments[1]),YO(r.length,e)}ph.exports=WO});var dh=l(function(dP,yh){"use strict";var ZO=gh();yh.exports=ZO});var k=require("@stdlib/utils/define-read-only-property"),T={};k(T,"base",gp());k(T,"ArrayBuffer",St());k(T,"Complex64Array",Tr());k(T,"Complex128Array",kr());k(T,"convertArray",jt());k(T,"convertArraySame",Fp());k(T,"arrayCtors",Rr());k(T,"DataView",Ip());k(T,"datespace",Wp());k(T,"arrayDataType",W());k(T,"arrayDataTypes",Jp());k(T,"aempty",Ct());k(T,"aemptyLike",x0());k(T,"filledarray",j0());k(T,"filledarrayBy",B0());k(T,"Float32Array",fr());k(T,"Float64Array",sr());k(T,"iterator2array",D0());k(T,"afull",Ir());k(T,"afullLike",J0());k(T,"incrspace",eg());k(T,"Int8Array",wr());k(T,"Int16Array",qr());k(T,"Int32Array",yr());k(T,"linspace",Kg());k(T,"logspace",ry());k(T,"arrayMinDataType",vy());k(T,"anans",my());k(T,"anansLike",dy());k(T,"arrayNextDataType",by());k(T,"aones",Ty());k(T,"aonesLike",Vy());k(T,"typedarraypool",Xy());k(T,"arrayPromotionRules",e1());k(T,"reviveTypedArray",o1());k(T,"arraySafeCasts",m1());k(T,"arraySameKindCasts",h1());k(T,"arrayShape",A1());k(T,"SharedArrayBuffer",C1());k(T,"circarray2iterator",B1());k(T,"array2iterator",G1());k(T,"array2iteratorRight",H1());k(T,"typedarray2json",ad());k(T,"sparsearray2iterator",fd());k(T,"sparsearray2iteratorRight",yd());k(T,"stridedarray2iterator",bd());k(T,"arrayview2iterator",jd());k(T,"arrayview2iteratorRight",zd());k(T,"typedarray",Bd());k(T,"complexarray",Zd());k(T,"complexarrayCtors",vi());k(T,"complexarrayDataTypes",$d());k(T,"typedarrayCtors",Wr());k(T,"typedarrayDataTypes",iq());k(T,"floatarrayCtors",It());k(T,"floatarrayDataTypes",vq());k(T,"intarrayCtors",pq());k(T,"intarrayDataTypes",hq());k(T,"realarray",Sq());k(T,"realarrayCtors",_q());k(T,"realarrayDataTypes",zq());k(T,"realarrayFloatCtors",Nq());k(T,"realarrayFloatDataTypes",Yq());k(T,"intarraySignedCtors",Jq());k(T,"intarraySignedDataTypes",th());k(T,"intarrayUnsignedCtors",vh());k(T,"intarrayUnsignedDataTypes",mh());k(T,"Uint8Array",hr());k(T,"Uint8ClampedArray",xr());k(T,"Uint16Array",dr());k(T,"Uint32Array",gr());k(T,"azeros",Ee());k(T,"azerosLike",dh());k(T,"constants",require("@stdlib/constants/array"));module.exports=T;
/**
* @license Apache-2.0
*
diff --git a/dist/index.js.map b/dist/index.js.map
index f4d8627c..0199218e 100644
--- a/dist/index.js.map
+++ b/dist/index.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
- "sources": ["../base/assert/is-accessor-array/lib/main.js", "../base/assert/is-accessor-array/lib/index.js", "../base/getter/lib/main.js", "../base/getter/lib/index.js", "../base/setter/lib/main.js", "../base/setter/lib/index.js", "../base/accessor-getter/lib/main.js", "../base/accessor-getter/lib/index.js", "../base/accessor-setter/lib/main.js", "../base/accessor-setter/lib/index.js", "../dtype/lib/ctor2dtype.js", "../float64/lib/main.js", "../float64/lib/polyfill.js", "../float64/lib/index.js", "../float32/lib/main.js", "../float32/lib/polyfill.js", "../float32/lib/index.js", "../uint32/lib/main.js", "../uint32/lib/polyfill.js", "../uint32/lib/index.js", "../int32/lib/main.js", "../int32/lib/polyfill.js", "../int32/lib/index.js", "../uint16/lib/main.js", "../uint16/lib/polyfill.js", "../uint16/lib/index.js", "../int16/lib/main.js", "../int16/lib/polyfill.js", "../int16/lib/index.js", "../uint8/lib/main.js", "../uint8/lib/polyfill.js", "../uint8/lib/index.js", "../uint8c/lib/main.js", "../uint8c/lib/polyfill.js", "../uint8c/lib/index.js", "../int8/lib/main.js", "../int8/lib/polyfill.js", "../int8/lib/index.js", "../complex64/lib/from_iterator.js", "../complex64/lib/from_iterator_map.js", "../complex64/lib/from_array.js", "../complex64/lib/main.js", "../complex64/lib/index.js", "../complex128/lib/from_iterator.js", "../complex128/lib/from_iterator_map.js", "../complex128/lib/from_array.js", "../complex128/lib/main.js", "../complex128/lib/index.js", "../dtype/lib/ctors.js", "../dtype/lib/dtypes.js", "../dtype/lib/main.js", "../dtype/lib/index.js", "../base/accessors/lib/main.js", "../base/accessors/lib/index.js", "../base/accessor/lib/main.js", "../base/accessor/lib/index.js", "../base/arraylike2object/lib/main.js", "../base/arraylike2object/lib/index.js", "../base/assert/contains/lib/main.js", "../base/assert/contains/lib/factory.js", "../base/assert/contains/lib/index.js", "../base/assert/lib/index.js", "../base/binary2d/lib/main.js", "../base/binary2d/lib/index.js", "../base/binary3d/lib/main.js", "../base/binary3d/lib/index.js", "../base/binary4d/lib/main.js", "../base/binary4d/lib/index.js", "../base/binary5d/lib/main.js", "../base/binary5d/lib/index.js", "../base/binarynd/lib/main.js", "../base/binarynd/lib/index.js", "../base/copy-indexed/lib/main.js", "../base/copy-indexed/lib/index.js", "../base/filled/lib/main.js", "../base/filled/lib/index.js", "../base/zeros/lib/main.js", "../base/zeros/lib/index.js", "../base/broadcast-array/lib/main.js", "../base/broadcast-array/lib/index.js", "../base/broadcasted-binary2d/lib/main.js", "../base/broadcasted-binary2d/lib/index.js", "../base/broadcasted-binary3d/lib/main.js", "../base/broadcasted-binary3d/lib/index.js", "../base/broadcasted-binary4d/lib/main.js", "../base/broadcasted-binary4d/lib/index.js", "../base/broadcasted-binary5d/lib/main.js", "../base/broadcasted-binary5d/lib/index.js", "../base/broadcasted-quaternary2d/lib/main.js", "../base/broadcasted-quaternary2d/lib/index.js", "../base/broadcasted-quinary2d/lib/main.js", "../base/broadcasted-quinary2d/lib/index.js", "../base/broadcasted-ternary2d/lib/main.js", "../base/broadcasted-ternary2d/lib/index.js", "../base/broadcasted-unary2d/lib/main.js", "../base/broadcasted-unary2d/lib/index.js", "../base/broadcasted-unary3d/lib/main.js", "../base/broadcasted-unary3d/lib/index.js", "../base/broadcasted-unary4d/lib/main.js", "../base/broadcasted-unary4d/lib/index.js", "../base/broadcasted-unary5d/lib/main.js", "../base/broadcasted-unary5d/lib/index.js", "../base/cartesian-power/lib/main.js", "../base/cartesian-power/lib/index.js", "../base/cartesian-product/lib/main.js", "../base/cartesian-product/lib/index.js", "../base/cartesian-square/lib/main.js", "../base/cartesian-square/lib/index.js", "../base/resolve-getter/lib/main.js", "../base/resolve-getter/lib/index.js", "../base/copy/lib/main.js", "../base/copy/lib/index.js", "../base/filled-by/lib/main.js", "../base/filled-by/lib/index.js", "../base/filled2d/lib/main.js", "../base/filled2d/lib/index.js", "../base/filled2d-by/lib/main.js", "../base/filled2d-by/lib/index.js", "../base/filled3d/lib/main.js", "../base/filled3d/lib/index.js", "../base/filled3d-by/lib/main.js", "../base/filled3d-by/lib/index.js", "../base/filled4d/lib/main.js", "../base/filled4d/lib/index.js", "../base/filled4d-by/lib/main.js", "../base/filled4d-by/lib/index.js", "../base/filled5d/lib/main.js", "../base/filled5d/lib/index.js", "../base/filled5d-by/lib/main.js", "../base/filled5d-by/lib/index.js", "../base/fillednd/lib/main.js", "../base/fillednd/lib/index.js", "../base/fillednd-by/lib/main.js", "../base/fillednd-by/lib/index.js", "../base/first/lib/main.js", "../base/first/lib/index.js", "../base/flatten/lib/assign.js", "../base/flatten/lib/main.js", "../base/flatten/lib/index.js", "../base/flatten-by/lib/assign.js", "../base/flatten-by/lib/main.js", "../base/flatten-by/lib/index.js", "../base/flatten2d/lib/main.js", "../base/flatten2d/lib/assign.js", "../base/flatten2d/lib/index.js", "../base/flatten2d-by/lib/main.js", "../base/flatten2d-by/lib/assign.js", "../base/flatten2d-by/lib/index.js", "../base/flatten3d/lib/main.js", "../base/flatten3d/lib/assign.js", "../base/flatten3d/lib/index.js", "../base/flatten3d-by/lib/main.js", "../base/flatten3d-by/lib/assign.js", "../base/flatten3d-by/lib/index.js", "../base/flatten4d/lib/main.js", "../base/flatten4d/lib/assign.js", "../base/flatten4d/lib/index.js", "../base/flatten4d-by/lib/main.js", "../base/flatten4d-by/lib/assign.js", "../base/flatten4d-by/lib/index.js", "../base/flatten5d/lib/main.js", "../base/flatten5d/lib/assign.js", "../base/flatten5d/lib/index.js", "../base/flatten5d-by/lib/main.js", "../base/flatten5d-by/lib/assign.js", "../base/flatten5d-by/lib/index.js", "../base/fliplr2d/lib/main.js", "../base/fliplr2d/lib/index.js", "../base/fliplr3d/lib/main.js", "../base/fliplr3d/lib/index.js", "../base/fliplr4d/lib/main.js", "../base/fliplr4d/lib/index.js", "../base/fliplr5d/lib/main.js", "../base/fliplr5d/lib/index.js", "../base/flipud2d/lib/main.js", "../base/flipud2d/lib/index.js", "../base/from-strided/lib/main.js", "../base/from-strided/lib/index.js", "../base/incrspace/lib/main.js", "../base/incrspace/lib/index.js", "../base/index-of/lib/main.js", "../base/index-of/lib/index.js", "../base/last/lib/main.js", "../base/last/lib/index.js", "../base/last-index-of/lib/main.js", "../base/last-index-of/lib/index.js", "../base/linspace/lib/main.js", "../base/linspace/lib/index.js", "../base/logspace/lib/main.js", "../base/logspace/lib/index.js", "../base/map2d/lib/main.js", "../base/map2d/lib/assign.js", "../base/map2d/lib/index.js", "../base/map3d/lib/main.js", "../base/map3d/lib/assign.js", "../base/map3d/lib/index.js", "../base/map4d/lib/main.js", "../base/map4d/lib/assign.js", "../base/map4d/lib/index.js", "../base/map5d/lib/main.js", "../base/map5d/lib/assign.js", "../base/map5d/lib/index.js", "../base/mskbinary2d/lib/main.js", "../base/mskbinary2d/lib/index.js", "../base/mskunary2d/lib/main.js", "../base/mskunary2d/lib/index.js", "../base/mskunary3d/lib/main.js", "../base/mskunary3d/lib/index.js", "../base/n-cartesian-product/lib/main.js", "../base/n-cartesian-product/lib/index.js", "../base/one-to/lib/main.js", "../base/one-to/lib/index.js", "../base/ones/lib/main.js", "../base/ones/lib/index.js", "../base/ones2d/lib/main.js", "../base/ones2d/lib/index.js", "../base/ones3d/lib/main.js", "../base/ones3d/lib/index.js", "../base/ones4d/lib/main.js", "../base/ones4d/lib/index.js", "../base/ones5d/lib/main.js", "../base/ones5d/lib/index.js", "../base/onesnd/lib/main.js", "../base/onesnd/lib/index.js", "../base/quaternary2d/lib/main.js", "../base/quaternary2d/lib/index.js", "../base/quaternary3d/lib/main.js", "../base/quaternary3d/lib/index.js", "../base/quaternary4d/lib/main.js", "../base/quaternary4d/lib/index.js", "../base/quaternary5d/lib/main.js", "../base/quaternary5d/lib/index.js", "../base/quinary2d/lib/main.js", "../base/quinary2d/lib/index.js", "../base/slice/lib/main.js", "../base/slice/lib/index.js", "../base/strided2array2d/lib/main.js", "../base/strided2array2d/lib/index.js", "../base/strided2array3d/lib/main.js", "../base/strided2array3d/lib/index.js", "../base/strided2array4d/lib/main.js", "../base/strided2array4d/lib/index.js", "../base/strided2array5d/lib/main.js", "../base/strided2array5d/lib/index.js", "../base/take/lib/main.js", "../base/take/lib/index.js", "../base/take-indexed/lib/main.js", "../base/take-indexed/lib/index.js", "../base/take2d/lib/main.js", "../base/take2d/lib/index.js", "../base/take3d/lib/main.js", "../base/take3d/lib/index.js", "../base/ternary2d/lib/main.js", "../base/ternary2d/lib/index.js", "../base/ternary3d/lib/main.js", "../base/ternary3d/lib/index.js", "../base/ternary4d/lib/main.js", "../base/ternary4d/lib/index.js", "../base/ternary5d/lib/main.js", "../base/ternary5d/lib/index.js", "../base/to-accessor-array/lib/main.js", "../base/to-accessor-array/lib/index.js", "../base/unary2d/lib/main.js", "../base/unary2d/lib/index.js", "../base/unary2d-by/lib/main.js", "../base/unary2d-by/lib/index.js", "../base/unary3d/lib/main.js", "../base/unary3d/lib/index.js", "../base/unary4d/lib/main.js", "../base/unary4d/lib/index.js", "../base/unary5d/lib/main.js", "../base/unary5d/lib/index.js", "../base/unarynd/lib/main.js", "../base/unarynd/lib/index.js", "../base/unitspace/lib/main.js", "../base/unitspace/lib/index.js", "../base/zero-to/lib/main.js", "../base/zero-to/lib/index.js", "../base/zeros2d/lib/main.js", "../base/zeros2d/lib/index.js", "../base/zeros3d/lib/main.js", "../base/zeros3d/lib/index.js", "../base/zeros4d/lib/main.js", "../base/zeros4d/lib/index.js", "../base/zeros5d/lib/main.js", "../base/zeros5d/lib/index.js", "../base/zerosnd/lib/main.js", "../base/zerosnd/lib/index.js", "../base/lib/index.js", "../buffer/lib/main.js", "../buffer/lib/polyfill.js", "../buffer/lib/index.js", "../ctors/lib/ctors.js", "../ctors/lib/main.js", "../ctors/lib/index.js", "../convert/lib/main.js", "../convert/lib/index.js", "../convert-same/lib/main.js", "../convert-same/lib/index.js", "../dataview/lib/main.js", "../dataview/lib/polyfill.js", "../dataview/lib/index.js", "../datespace/lib/main.js", "../datespace/lib/index.js", "../dtypes/lib/dtypes.json", "../dtypes/lib/main.js", "../dtypes/lib/index.js", "../empty/lib/is_buffer_uint8array.js", "../typed-ctors/lib/ctors.js", "../typed-ctors/lib/main.js", "../typed-ctors/lib/index.js", "../empty/lib/main.js", "../zeros/lib/main.js", "../zeros/lib/index.js", "../empty/lib/polyfill.js", "../empty/lib/index.js", "../empty-like/lib/main.js", "../empty-like/lib/index.js", "../filled/lib/main.js", "../filled/lib/index.js", "../filled-by/lib/main.js", "../filled-by/lib/index.js", "../from-iterator/lib/main.js", "../from-iterator/lib/index.js", "../full/lib/main.js", "../full/lib/index.js", "../full-like/lib/main.js", "../full-like/lib/index.js", "../incrspace/lib/main.js", "../incrspace/lib/index.js", "../typed-float-ctors/lib/ctors.js", "../typed-float-ctors/lib/main.js", "../typed-float-ctors/lib/index.js", "../linspace/lib/generic_real.js", "../linspace/lib/generic_complex.js", "../linspace/lib/typed_real.js", "../linspace/lib/typed_complex.js", "../linspace/lib/validate.js", "../linspace/lib/defaults.json", "../linspace/lib/main.js", "../linspace/lib/accessors_complex.js", "../linspace/lib/accessors_real.js", "../linspace/lib/assign.js", "../linspace/lib/index.js", "../logspace/lib/main.js", "../logspace/lib/index.js", "../min-dtype/lib/main.js", "../min-dtype/lib/index.js", "../nans/lib/main.js", "../nans/lib/index.js", "../nans-like/lib/main.js", "../nans-like/lib/index.js", "../next-dtype/lib/next_dtypes.json", "../next-dtype/lib/main.js", "../next-dtype/lib/index.js", "../ones/lib/main.js", "../ones/lib/index.js", "../ones-like/lib/main.js", "../ones-like/lib/index.js", "../pool/lib/defaults.js", "../pool/lib/validate.js", "../pool/lib/pool.js", "../pool/lib/bytes_per_element.json", "../pool/lib/factory.js", "../pool/lib/main.js", "../pool/lib/index.js", "../promotion-rules/lib/promotion_rules.json", "../promotion-rules/lib/main.js", "../promotion-rules/lib/index.js", "../reviver/lib/ctors.js", "../reviver/lib/main.js", "../reviver/lib/index.js", "../safe-casts/lib/safe_casts.json", "../safe-casts/lib/main.js", "../safe-casts/lib/index.js", "../same-kind-casts/lib/same_kind_casts.json", "../same-kind-casts/lib/main.js", "../same-kind-casts/lib/index.js", "../shape/lib/main.js", "../shape/lib/index.js", "../shared-buffer/lib/main.js", "../shared-buffer/lib/polyfill.js", "../shared-buffer/lib/index.js", "../to-circular-iterator/lib/main.js", "../to-circular-iterator/lib/index.js", "../to-iterator/lib/main.js", "../to-iterator/lib/index.js", "../to-iterator-right/lib/main.js", "../to-iterator-right/lib/index.js", "../to-json/lib/ctors.js", "../to-json/lib/type.js", "../to-json/lib/main.js", "../to-json/lib/index.js", "../to-sparse-iterator/lib/main.js", "../to-sparse-iterator/lib/index.js", "../to-sparse-iterator-right/lib/main.js", "../to-sparse-iterator-right/lib/index.js", "../to-strided-iterator/lib/main.js", "../to-strided-iterator/lib/index.js", "../to-view-iterator/lib/main.js", "../to-view-iterator/lib/index.js", "../to-view-iterator-right/lib/main.js", "../to-view-iterator-right/lib/index.js", "../typed/lib/main.js", "../typed/lib/index.js", "../typed-complex-ctors/lib/ctors.js", "../typed-complex-ctors/lib/main.js", "../typed-complex-ctors/lib/index.js", "../typed-complex/lib/main.js", "../typed-complex/lib/index.js", "../typed-complex-dtypes/lib/dtypes.json", "../typed-complex-dtypes/lib/main.js", "../typed-complex-dtypes/lib/index.js", "../typed-dtypes/lib/dtypes.json", "../typed-dtypes/lib/main.js", "../typed-dtypes/lib/index.js", "../typed-float-dtypes/lib/dtypes.json", "../typed-float-dtypes/lib/main.js", "../typed-float-dtypes/lib/index.js", "../typed-integer-ctors/lib/ctors.js", "../typed-integer-ctors/lib/main.js", "../typed-integer-ctors/lib/index.js", "../typed-integer-dtypes/lib/dtypes.json", "../typed-integer-dtypes/lib/main.js", "../typed-integer-dtypes/lib/index.js", "../typed-real/lib/main.js", "../typed-real/lib/index.js", "../typed-real-ctors/lib/ctors.js", "../typed-real-ctors/lib/main.js", "../typed-real-ctors/lib/index.js", "../typed-real-dtypes/lib/dtypes.json", "../typed-real-dtypes/lib/main.js", "../typed-real-dtypes/lib/index.js", "../typed-real-float-ctors/lib/ctors.js", "../typed-real-float-ctors/lib/main.js", "../typed-real-float-ctors/lib/index.js", "../typed-real-float-dtypes/lib/dtypes.json", "../typed-real-float-dtypes/lib/main.js", "../typed-real-float-dtypes/lib/index.js", "../typed-signed-integer-ctors/lib/ctors.js", "../typed-signed-integer-ctors/lib/main.js", "../typed-signed-integer-ctors/lib/index.js", "../typed-signed-integer-dtypes/lib/dtypes.json", "../typed-signed-integer-dtypes/lib/main.js", "../typed-signed-integer-dtypes/lib/index.js", "../typed-unsigned-integer-ctors/lib/ctors.js", "../typed-unsigned-integer-ctors/lib/main.js", "../typed-unsigned-integer-ctors/lib/index.js", "../typed-unsigned-integer-dtypes/lib/dtypes.json", "../typed-unsigned-integer-dtypes/lib/main.js", "../typed-unsigned-integer-dtypes/lib/index.js", "../zeros-like/lib/main.js", "../zeros-like/lib/index.js", "../lib/index.js"],
- "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar TYPE = 'function';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like object supports the accessor (get/set) protocol.\n*\n* @param {Object} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn ( typeof value.get === TYPE && typeof value.set === TYPE ); // eslint-disable-line valid-typeof\n}\n\n\n// EXPORTS //\n\nmodule.exports = isAccessorArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Test if an array-like object supports the accessor (get/set) protocol.\n*\n* @module @stdlib/array/base/assert/is-accessor-array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128array' );\n* var isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isAccessorArray( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar GETTERS = {\n\t'float64': getFloat64,\n\t'float32': getFloat32,\n\t'int32': getInt32,\n\t'int16': getInt16,\n\t'int8': getInt8,\n\t'uint32': getUint32,\n\t'uint16': getUint16,\n\t'uint8': getUint8,\n\t'uint8c': getUint8c,\n\t'generic': getGeneric,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat64( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat64( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var arr = new Float32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat32( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat32( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Int32Array = require( '@stdlib/array/int32' );\n*\n* var arr = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt32( arr, 2 );\n* // returns 3\n*/\nfunction getInt32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Int16Array = require( '@stdlib/array/int16' );\n*\n* var arr = new Int16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt16( arr, 2 );\n* // returns 3\n*/\nfunction getInt16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Int8Array = require( '@stdlib/array/int8' );\n*\n* var arr = new Int8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt8( arr, 2 );\n* // returns 3\n*/\nfunction getInt8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n*\n* var arr = new Uint32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint32( arr, 2 );\n* // returns 3\n*/\nfunction getUint32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint16Array = require( '@stdlib/array/uint16' );\n*\n* var arr = new Uint16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint16( arr, 2 );\n* // returns 3\n*/\nfunction getUint16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint8Array = require( '@stdlib/array/uint8' );\n*\n* var arr = new Uint8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8( arr, 2 );\n* // returns 3\n*/\nfunction getUint8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint8ClampedArray = require( '@stdlib/array/uint8c' );\n*\n* var arr = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8c( arr, 2 );\n* // returns 3\n*/\nfunction getUint8c( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getGeneric( arr, 2 );\n* // returns 3\n*/\nfunction getGeneric( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Return an accessor function for retrieving an element from an indexed array-like object.\n*\n* @module @stdlib/array/base/getter\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n* var getter = require( '@stdlib/array/base/getter' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar SETTERS = {\n\t'float64': setFloat64,\n\t'float32': setFloat32,\n\t'int32': setInt32,\n\t'int16': setInt16,\n\t'int8': setInt8,\n\t'uint32': setUint32,\n\t'uint16': setUint16,\n\t'uint8': setUint8,\n\t'uint8c': setUint8c,\n\t'generic': setGeneric,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( 4 );\n*\n* setFloat64( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat64( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var arr = new Float32Array( 4 );\n*\n* setFloat32( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Int32Array = require( '@stdlib/array/int32' );\n*\n* var arr = new Int32Array( 4 );\n*\n* setInt32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Int16Array = require( '@stdlib/array/int16' );\n*\n* var arr = new Int16Array( 4 );\n*\n* setInt16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Int8Array = require( '@stdlib/array/int8' );\n*\n* var arr = new Int8Array( 4 );\n*\n* setInt8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n*\n* var arr = new Uint32Array( 4 );\n*\n* setUint32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint16Array = require( '@stdlib/array/uint16' );\n*\n* var arr = new Uint16Array( 4 );\n*\n* setUint16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint8Array = require( '@stdlib/array/uint8' );\n*\n* var arr = new Uint8Array( 4 );\n*\n* setUint8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint8ClampedArray = require( '@stdlib/array/uint8c' );\n*\n* var arr = new Uint8ClampedArray( 4 );\n*\n* setUint8c( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8c( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setGeneric( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setGeneric( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setArrayLike( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Return an accessor function for setting an element in an indexed array-like object.\n*\n* @module @stdlib/array/base/setter\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n* var set = require( '@stdlib/array/base/setter' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar GETTERS = {\n\t'complex128': getComplex128,\n\t'complex64': getComplex64,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex128( arr, 1 );\n* // returns \n*\n* var re = real( v );\n* // returns 3.0\n*\n* var im = imag( v );\n* // returns 4.0\n*/\nfunction getComplex128( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex64( arr, 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 3.0\n*\n* var im = imagf( v );\n* // returns 4.0\n*/\nfunction getComplex64( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 3.0\n*\n* var im = imagf( v );\n* // returns 4.0\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Return an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @module @stdlib/array/base/accessor-getter\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var dtype = require( '@stdlib/array/dtype' );\n* var getter = require( '@stdlib/array/base/accessor-getter' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 3.0\n*\n* var im = imagf( v );\n* // returns 4.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar SETTERS = {\n\t'complex128': setComplex128,\n\t'complex64': setComplex64,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var Complex128 = require( '@stdlib/complex/float64' );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex128( arr, 1, new Complex128( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = real( v );\n* // returns 10.0\n*\n* var im = imag( v );\n* // returns 11.0\n*/\nfunction setComplex128( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex64( arr, 1, new Complex64( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 11.0\n*/\nfunction setComplex64( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* setArrayLike( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 11.0\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Return an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @module @stdlib/array/base/accessor-setter\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var dtype = require( '@stdlib/array/dtype' );\n* var setter = require( '@stdlib/array/base/accessor-setter' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 11.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128'\n};\n\n\n// EXPORTS //\n\nmodule.exports = ctor2dtypes;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\nvar ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array/float64\n*\n* @example\n* var ctor = require( '@stdlib/array/float64' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\nvar ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array/float32\n*\n* @example\n* var ctor = require( '@stdlib/array/float32' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\nvar ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint32\n*\n* @example\n* var ctor = require( '@stdlib/array/uint32' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\nvar ctor = ( typeof Int32Array === 'function' ) ? Int32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int32\n*\n* @example\n* var ctor = require( '@stdlib/array/int32' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\nvar ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint16\n*\n* @example\n* var ctor = require( '@stdlib/array/uint16' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\nvar ctor = ( typeof Int16Array === 'function' ) ? Int16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int16\n*\n* @example\n* var ctor = require( '@stdlib/array/int16' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\nvar ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint8\n*\n* @example\n* var ctor = require( '@stdlib/array/uint8' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\nvar ctor = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @module @stdlib/array/uint8c\n*\n* @example\n* var ctor = require( '@stdlib/array/uint8c' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); // eslint-disable-line id-length\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ClampedArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\nvar ctor = ( typeof Int8Array === 'function' ) ? Int8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int8\n*\n* @example\n* var ctor = require( '@stdlib/array/int8' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar realf = require( '@stdlib/complex/realf' );\nvar imagf = require( '@stdlib/complex/imagf' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar realf = require( '@stdlib/complex/realf' );\nvar imagf = require( '@stdlib/complex/imagf' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar realf = require( '@stdlib/complex/realf' );\nvar imagf = require( '@stdlib/complex/imagf' );\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float32Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float32Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = realf( v );\n\t\tbuf[ j+1 ] = imagf( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromArray;\n", "/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar isEven = require( '@stdlib/math/base/assert/is-even' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar Float32Array = require( './../../float32' );\nvar Complex64 = require( '@stdlib/complex/float32' );\nvar format = require( '@stdlib/string/format' );\nvar realf = require( '@stdlib/complex/realf' );\nvar imagf = require( '@stdlib/complex/imagf' );\nvar reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\nvar reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' );\nvar getter = require( './../../base/getter' );\nvar accessorGetter = require( './../../base/accessor-getter' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\nvar fromArray = require( './from_array.js' );\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex64Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex64Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex128Array...\n\t\tvalue.name === 'Complex128Array'\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*/\nfunction isComplex64Array( value ) { // TODO: move to array/base/assert/is-complex64-array\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*/\nfunction isComplex128Array( value ) { // TODO: move to array/base/assert/is-complex128-array\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT*2\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float32Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex64} complex number\n*/\nfunction getComplex64( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); // FIXME: `buf` is what is returned from above, NOT the original value\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function clbk( v ) {\n* return new Complex64( realf(v)*2.0, imagf(v)*2.0 );\n* }\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 64-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex64Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = realf( z );\n* // returns 9.0\n*\n* im = imagf( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} modified array\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex64( 1.0, 1.0 ), 0 );\n* arr.set( new Complex64( 2.0, 2.0 ), 1 );\n* arr.set( new Complex64( 3.0, 3.0 ), 2 );\n* arr.set( new Complex64( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = [\n* new Complex64( 1.0, 1.0 ),\n* new Complex64( 2.0, 2.0 ),\n* new Complex64( 3.0, 3.0 )\n* ];\n* arr = new Complex64Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex64( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex64Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex64Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Complex64} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex64( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex64( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex64( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Complex64} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = new Complex64Array( 10 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 );\n* // returns -1\n*/\nsetReadOnly( Complex64Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Complex64} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex64( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + (begin*BYTES_PER_ELEMENT);\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n\n// EXPORTS //\n\nmodule.exports = Complex64Array;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* 64-bit complex number array.\n*\n* @module @stdlib/array/complex64\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar format = require( '@stdlib/string/format' );\nvar real = require( '@stdlib/complex/real' );\nvar imag = require( '@stdlib/complex/imag' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar format = require( '@stdlib/string/format' );\nvar real = require( '@stdlib/complex/real' );\nvar imag = require( '@stdlib/complex/imag' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar real = require( '@stdlib/complex/real' );\nvar imag = require( '@stdlib/complex/imag' );\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float64Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float64Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = real( v );\n\t\tbuf[ j+1 ] = imag( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromArray;\n", "/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar isEven = require( '@stdlib/math/base/assert/is-even' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar Float64Array = require( './../../float64' );\nvar Complex128 = require( '@stdlib/complex/float64' );\nvar real = require( '@stdlib/complex/real' );\nvar imag = require( '@stdlib/complex/imag' );\nvar reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\nvar reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' );\nvar getter = require( './../../base/getter' );\nvar accessorGetter = require( './../../base/accessor-getter' );\nvar format = require( '@stdlib/string/format' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\nvar fromArray = require( './from_array.js' );\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float64Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex128Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex128Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex64Array...\n\t\tvalue.name === 'Complex64Array'\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*/\nfunction isComplex64Array( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT/2\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*/\nfunction isComplex128Array( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float64Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex128} complex number\n*/\nfunction getComplex128( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 128-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `16`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `16`\n* @throws {TypeError} view length must be a positive multiple of `16`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex128Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex128Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex128Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex128Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex128Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex128Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex128Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float64Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float64Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float64Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float64Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float64Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var nbytes = Complex128Array.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128Array\n* @readonly\n* @type {string}\n* @default 'Complex128Array'\n*\n* @example\n* var name = Complex128Array.name;\n* // returns 'Complex128Array'\n*/\nsetReadOnly( Complex128Array, 'name', 'Complex128Array' );\n\n/**\n* Creates a new 128-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex128Array\n* @type {Function}\n* @param {(Collection|Object)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function clbk( v ) {\n* return new Complex128( real(v)*2.0, imag(v)*2.0 );\n* }\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex128Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 128-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex128Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex128Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = real( z );\n* // returns 9.0\n*\n* im = imag( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 160\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array.prototype, 'BYTES_PER_ELEMENT', Complex128Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} modified array\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex128( 1.0, 1.0 ), 0 );\n* arr.set( new Complex128( 2.0, 2.0 ), 1 );\n* arr.set( new Complex128( 3.0, 3.0 ), 2 );\n* arr.set( new Complex128( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n*\n* var arr = [\n* new Complex128( 1.0, 1.0 ),\n* new Complex128( 2.0, 2.0 ),\n* new Complex128( 3.0, 3.0 )\n* ];\n* arr = new Complex128Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex128( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n* @name set\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = real( value );\n\t\tbuf[ idx+1 ] = imag( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float64Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float64Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = real( v );\n\t\t\tbuf[ idx+1 ] = imag( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Complex128Array;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* 128-bit complex number array.\n*\n* @module @stdlib/array/complex128\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var arr = new Complex128Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var arr = new Complex128Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 Float64Array = require( './../../float64' );\nvar Float32Array = require( './../../float32' );\nvar Uint32Array = require( './../../uint32' );\nvar Int32Array = require( './../../int32' );\nvar Uint16Array = require( './../../uint16' );\nvar Int16Array = require( './../../int16' );\nvar Uint8Array = require( './../../uint8' );\nvar Uint8ClampedArray = require( './../../uint8c' );\nvar Int8Array = require( './../../int8' );\nvar Complex64Array = require( './../../complex64' );\nvar Complex128Array = require( './../../complex128' );\n\n\n// MAIN //\n\n// Note: order should match `dtypes` order\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tComplex64Array,\n\tComplex128Array\n];\n\n\n// EXPORTS //\n\nmodule.exports = CTORS;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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// MAIN //\n\n// Note: order should match `ctors` order\nvar DTYPES = [\n\t'float64',\n\t'float32',\n\t'int32',\n\t'uint32',\n\t'int16',\n\t'uint16',\n\t'int8',\n\t'uint8',\n\t'uint8c',\n\t'complex64',\n\t'complex128'\n];\n\n\n// EXPORTS //\n\nmodule.exports = DTYPES;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isBuffer = require( '@stdlib/assert/is-buffer' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar constructorName = require( '@stdlib/utils/constructor-name' );\nvar ctor2dtype = require( './ctor2dtype.js' );\nvar CTORS = require( './ctors.js' );\nvar DTYPES = require( './dtypes.js' );\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of an array.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* var dt = dtype( [ 1, 2, 3 ] );\n* // returns 'generic'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tif ( isArray( value ) ) {\n\t\treturn 'generic';\n\t}\n\tif ( isBuffer( value ) ) {\n\t\treturn null;\n\t}\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dtype;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Return the data type of an array.\n*\n* @module @stdlib/array/dtype\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = new Float64Array( 10 );\n*\n* var dt = dtype( arr );\n* // returns 'float64'\n*\n* dt = dtype( {} );\n* // returns null\n*\n* dt = dtype( 'beep' );\n* // returns null\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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 isAccessorArray = require( './../../../base/assert/is-accessor-array' );\nvar getter = require( './../../../base/getter' );\nvar setter = require( './../../../base/setter' );\nvar accessorGetter = require( './../../../base/accessor-getter' );\nvar accessorSetter = require( './../../../base/accessor-setter' );\nvar dtype = require( './../../../dtype' );\n\n\n// MAIN //\n\n/**\n* Returns element accessors for a provided array-like object.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **accessorProtocol**: `boolean` indicating whether the provided array-like object supports the get/set protocol (i.e., uses accessors for getting and setting elements).\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.\n*\n* @param {Collection} x - array-like object\n* @returns {Object} object containing accessor data\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n* var obj = accessors( x );\n* // returns {...}\n*\n* var bool = obj.accessorProtocol;\n* // returns false\n*\n* var fcns = obj.accessors;\n* // returns [ , ]\n*\n* var v = fcns[ 0 ]( x, 2 );\n* // returns 3\n*/\nfunction accessors( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn {\n\t\t\t'accessorProtocol': true,\n\t\t\t'accessors': [\n\t\t\t\taccessorGetter( dt ),\n\t\t\t\taccessorSetter( dt )\n\t\t\t]\n\t\t};\n\t}\n\treturn {\n\t\t'accessorProtocol': false,\n\t\t'accessors': [\n\t\t\tgetter( dt ),\n\t\t\tsetter( dt )\n\t\t]\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = accessors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Return element accessors for a provided array-like object.\n*\n* @module @stdlib/array/base/accessors\n*\n* @example\n* var accessors = require( '@stdlib/array/base/accessors' );\n*\n* var x = [ 1, 2, 3, 4 ];\n* var obj = accessors( x );\n* // returns {...}\n*\n* var bool = obj.accessorProtocol;\n* // returns false\n*\n* var fcns = obj.accessors;\n* // returns [ , ]\n*\n* var v = fcns[ 0 ]( x, 2 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar accessors = require( './../../../base/accessors' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// FUNCTIONS //\n\n/**\n* Sets the length of an array-like object.\n*\n* @private\n* @param {NonNegativeInteger} len - length\n*/\nfunction setLength( len ) {\n\tthis._buffer.length = len;\n}\n\n/**\n* Returns the length of an array-like object.\n*\n* @private\n* @returns {NonNegativeInteger} length\n*/\nfunction getLength() {\n\treturn this._buffer.length;\n}\n\n\n// MAIN //\n\n/**\n* Creates a minimal array-like object supporting the accessor protocol from another array-like object.\n*\n* @constructor\n* @param {Collection} arr - input array\n* @throws {TypeError} must provide an array-like object\n* @returns {AccessorArray} accessor array instance\n*\n* @example\n* var arr = new AccessorArray( [ 1, 2, 3 ] );\n* // returns \n*\n* var v = arr.get( 0 );\n* // returns 1\n*/\nfunction AccessorArray( arr ) {\n\tvar o;\n\tif ( !(this instanceof AccessorArray) ) {\n\t\treturn new AccessorArray( arr );\n\t}\n\tif ( !isCollection( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );\n\t}\n\to = accessors( arr );\n\tthis._buffer = arr;\n\tthis._getter = o.accessors[ 0 ];\n\tthis._setter = o.accessors[ 1 ];\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof AccessorArray\n* @readonly\n* @type {string}\n* @default 'AccessorArray'\n*\n* @example\n* var name = AccessorArray.name;\n* // returns 'AccessorArray'\n*/\nsetReadOnly( AccessorArray, 'name', 'AccessorArray' );\n\n/**\n* Read/write accessor for getting/setting the number of elements.\n*\n* @name length\n* @memberof AccessorArray.prototype\n* @type {NonNegativeInteger}\n*/\nsetReadWriteAccessor( AccessorArray.prototype, 'length', getLength, setLength );\n\n/**\n* Returns an element.\n*\n* @name get\n* @memberof AccessorArray.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @returns {*} element\n*\n* @example\n* var arr = new AccessorArray( [ 1, 2, 3 ] );\n* // returns \n*\n* var v = arr.get( 0 );\n* // returns 1\n*/\nsetReadOnly( AccessorArray.prototype, 'get', function get( idx ) {\n\treturn this._getter( this._buffer, idx );\n});\n\n/**\n* Sets one or more elements.\n*\n* @name set\n* @memberof AccessorArray.prototype\n* @type {Function}\n* @param {*} value - value to set\n* @param {integer} [idx] - element index\n* @returns {void}\n*\n* @example\n* var arr = new AccessorArray( [ 1, 2, 3 ] );\n* // returns \n*\n* var v = arr.get( 0 );\n* // returns 1\n*\n* arr.set( 5, 0 );\n*\n* v = arr.get( 0 );\n* // returns 5\n*/\nsetReadOnly( AccessorArray.prototype, 'set', function set( value, idx ) {\n\tif ( arguments.length < 2 ) {\n\t\tthis._setter( this._buffer, 0, value );\n\t\treturn;\n\t}\n\tthis._setter( this._buffer, idx, value );\n});\n\n\n// EXPORTS //\n\nmodule.exports = AccessorArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a minimal array-like object supporting the accessor protocol from another array-like object.\n*\n* @module @stdlib/array/base/accessor\n*\n* @example\n* var AccessorArray = require( '@stdlib/array/base/accessor' );\n*\n* var arr = new AccessorArray( [ 1, 2, 3 ] );\n* // returns \n*\n* var v = arr.get( 0 );\n* // returns 1\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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 accessors = require( './../../../base/accessors' );\n\n\n// MAIN //\n\n/**\n* Converts an array-like to an object likely to have the same \"shape\".\n*\n* ## Notes\n*\n* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different \"hidden\" classes. If a function is provided many objects having different \"shapes\", some JavaScript VMs (e.g., V8) will consider the function \"megamorphic\" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the \"shape\" of the object holding array meta data to ensure that internal functions operating on arrays are provided consistent argument \"shapes\".\n*\n* - The returned object has the following properties:\n*\n* - **data**: reference to the input array.\n* - **accessorProtocol**: `boolean` indicating whether the input array uses accessors for getting and setting elements.\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.\n*\n* @param {Collection} x - array-like object\n* @returns {Object} object containing array meta data\n*\n* @example\n* var obj = arraylike2object( [ 1, 2, 3, 4 ] );\n* // returns {...}\n*/\nfunction arraylike2object( x ) {\n\tvar o = accessors( x );\n\treturn {\n\t\t'data': x,\n\t\t'accessorProtocol': o.accessorProtocol,\n\t\t'accessors': o.accessors\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = arraylike2object;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Convert an array-like object to an object likely to have the same \"shape\".\n*\n* @module @stdlib/array/base/arraylike2object\n*\n* @example\n* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );\n*\n* var obj = arraylike2object( [ 1, 2, 3, 4 ] );\n* // returns {...}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( './../../../../base/assert/is-accessor-array' );\nvar accessorGetter = require( './../../../../base/accessor-getter' );\nvar getter = require( './../../../../base/getter' );\nvar dtype = require( './../../../../dtype' );\n\n\n// MAIN //\n\n/**\n* Tests if an array contains a provided search value.\n*\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*\n* @example\n* var out = contains( [ 1, 2, 3 ], 2 );\n* // returns true\n*/\nfunction contains( x, value ) {\n\tvar len;\n\tvar get;\n\tvar dt;\n\tvar i;\n\n\t// Resolve the input array data type:\n\tdt = dtype( x );\n\n\t// Resolve an accessor for retrieving input array elements:\n\tif ( isAccessorArray( x ) ) {\n\t\tget = accessorGetter( dt );\n\t} else {\n\t\tget = getter( dt );\n\t}\n\t// Get the number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Loop over the elements...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( get( x, i ) === value ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = contains;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isCollection = require( '@stdlib/assert/is-collection' );\nvar isAccessorArray = require( './../../../../base/assert/is-accessor-array' );\nvar accessorGetter = require( './../../../../base/accessor-getter' );\nvar dtype = require( './../../../../dtype' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function to tests if an array contains a provided search value.\n*\n* @param {Collection} x - input array\n* @throws {TypeError} must provide an array-like object\n* @returns {Function} function to test if an array contains a search value\n*\n* @example\n* var contains = factory( [ 1, 2, 3 ] );\n* // returns \n*\n* var bool = contains( 2 );\n* // returns true\n*/\nfunction factory( x ) {\n\tvar get;\n\tvar len;\n\tvar dt;\n\n\tif ( !isCollection( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', x ) );\n\t}\n\t// Resolve the input array data type:\n\tdt = dtype( x );\n\n\t// Resolve an accessor for retrieving input array elements:\n\tif ( isAccessorArray( x ) ) {\n\t\tget = accessorGetter( dt );\n\t}\n\t// Get the number of elements over which to iterate:\n\tlen = x.length;\n\n\treturn ( get === void 0 ) ? contains : accessors;\n\t/**\n\t* Tests if an array contains a provided search value.\n\t*\n\t* @private\n\t* @param {*} value - search value\n\t* @returns {boolean} boolean indicating if an array contains a search value\n\t*\n\t* @example\n\t* var out = contains( [ 1, 2, 3 ], 2 );\n\t* // returns true\n\t*/\n\tfunction contains( value ) {\n\t\tvar i;\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( x[ i ] === value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t* Tests if an array contains a provided search value.\n\t*\n\t* @private\n\t* @param {*} value - search value\n\t* @returns {boolean} boolean indicating if an array contains a search value\n\t*/\n\tfunction accessors( value ) {\n\t\tvar i;\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( get( x, i ) === value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Test if an array contains a provided search value.\n*\n* @module @stdlib/array/base/assert/contains\n*\n* @example\n* var contains = require( '@stdlib/array/base/assert/contains' );\n*\n* var out = contains( [ 1, 2, 3 ], 2 );\n* // returns true\n*/\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name contains\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/array/base/assert/contains}\n*/\nsetReadOnly( ns, 'contains', require( './../../../base/assert/contains' ) );\n\n/**\n* @name isAccessorArray\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/array/base/assert/is-accessor-array}\n*/\nsetReadOnly( ns, 'isAccessorArray', require( './../../../base/assert/is-accessor-array' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Applies a binary callback to elements in two two-dimensional nested input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = ones2d( shape );\n* var y = ones2d( shape );\n* var z = zeros2d( shape );\n*\n* binary2d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\nfunction binary2d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tS0 = shape[ 1 ];\n\tS1 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tx0 = x[ i1 ];\n\t\ty0 = y[ i1 ];\n\t\tz0 = z[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tz0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ] );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = binary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a binary callback to elements in two two-dimensional nested input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/binary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var binary2d = require( '@stdlib/array/base/binary2d' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = ones2d( shape );\n* var y = ones2d( shape );\n* var z = zeros2d( shape );\n*\n* binary2d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Applies a binary callback to elements in two three-dimensional nested input arrays and assigns results to elements in a three-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shape = [ 2, 2, 2 ];\n*\n* var x = ones3d( shape );\n* var y = ones3d( shape );\n* var z = zeros3d( shape );\n*\n* binary3d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\nfunction binary3d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar z0;\n\tvar z1;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tS0 = shape[ 2 ];\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tx1 = x[ i2 ];\n\t\ty1 = y[ i2 ];\n\t\tz1 = z[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tx0 = x1[ i1 ];\n\t\t\ty0 = y1[ i1 ];\n\t\t\tz0 = z1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tz0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ] );\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = binary3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a binary callback to elements in two three-dimensional nested input arrays and assign results to elements in a three-dimensional nested output array.\n*\n* @module @stdlib/array/base/binary3d\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var binary3d = require( '@stdlib/array/base/binary3d' );\n*\n* var shape = [ 2, 2, 2 ];\n*\n* var x = ones3d( shape );\n* var y = ones3d( shape );\n* var z = zeros3d( shape );\n*\n* binary3d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Applies a binary callback to elements in two four-dimensional nested input arrays and assigns results to elements in a four-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shape = [ 1, 2, 2, 2 ];\n*\n* var x = ones4d( shape );\n* var y = ones4d( shape );\n* var z = zeros4d( shape );\n*\n* binary4d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ]\n*/\nfunction binary4d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar z0;\n\tvar z1;\n\tvar z2;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tS0 = shape[ 3 ];\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tx2 = x[ i3 ];\n\t\ty2 = y[ i3 ];\n\t\tz2 = z[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tx1 = x2[ i2 ];\n\t\t\ty1 = y2[ i2 ];\n\t\t\tz1 = z2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tx0 = x1[ i1 ];\n\t\t\t\ty0 = y1[ i1 ];\n\t\t\t\tz0 = z1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tz0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = binary4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a binary callback to elements in two four-dimensional nested input arrays and assign results to elements in a four-dimensional nested output array.\n*\n* @module @stdlib/array/base/binary4d\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var binary4d = require( '@stdlib/array/base/binary4d' );\n*\n* var shape = [ 1, 2, 2, 2 ];\n*\n* var x = ones4d( shape );\n* var y = ones4d( shape );\n* var z = zeros4d( shape );\n*\n* binary4d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Applies a binary callback to elements in two five-dimensional nested input arrays and assigns results to elements in a five-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shape = [ 1, 1, 2, 2, 2 ];\n*\n* var x = ones5d( shape );\n* var y = ones5d( shape );\n* var z = zeros5d( shape );\n*\n* binary5d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ] ]\n*/\nfunction binary5d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar x3;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar y3;\n\tvar z0;\n\tvar z1;\n\tvar z2;\n\tvar z3;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tS0 = shape[ 4 ];\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 || S4 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tx3 = x[ i4 ];\n\t\ty3 = y[ i4 ];\n\t\tz3 = z[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tx2 = x3[ i3 ];\n\t\t\ty2 = y3[ i3 ];\n\t\t\tz2 = z3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tx1 = x2[ i2 ];\n\t\t\t\ty1 = y2[ i2 ];\n\t\t\t\tz1 = z2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tx0 = x1[ i1 ];\n\t\t\t\t\ty0 = y1[ i1 ];\n\t\t\t\t\tz0 = z1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tz0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = binary5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a binary callback to elements in two five-dimensional nested input arrays and assign results to elements in a five-dimensional nested output array.\n*\n* @module @stdlib/array/base/binary5d\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var binary5d = require( '@stdlib/array/base/binary5d' );\n*\n* var shape = [ 1, 1, 2, 2, 2 ];\n*\n* var x = ones5d( shape );\n* var y = ones5d( shape );\n* var z = zeros5d( shape );\n*\n* binary5d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// FUNCTIONS //\n\n/**\n* Recursively applies a binary callback.\n*\n* @private\n* @param {ArrayLikeObject} x - input array\n* @param {ArrayLikeObject} y - input array\n* @param {ArrayLikeObject} z - output array\n* @param {NonNegativeInteger} ndims - number of dimensions\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {NonNegativeInteger} dim - dimension index\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*/\nfunction recurse( x, y, z, ndims, shape, dim, fcn ) {\n\tvar S;\n\tvar d;\n\tvar i;\n\n\tS = shape[ dim ];\n\n\t// Check whether we've reached the innermost dimension:\n\td = dim + 1;\n\n\tif ( d === ndims ) {\n\t\t// Apply the provided callback...\n\t\tfor ( i = 0; i < S; i++ ) {\n\t\t\tz[ i ] = fcn( x[ i ], y[ i ] );\n\t\t}\n\t\treturn;\n\t}\n\t// Continue recursing into the nested arrays...\n\tfor ( i = 0; i < S; i++ ) {\n\t\trecurse( x[ i ], y[ i ], z[ i ], ndims, shape, d, fcn );\n\t}\n}\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two n-dimensional nested input arrays and assigns results to elements in an n-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add' );\n* var onesnd = require( '@stdlib/array/base/onesnd' );\n* var zerosnd = require( '@stdlib/array/base/zerosnd' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = onesnd( shape );\n* var y = onesnd( shape );\n* var z = zerosnd( shape );\n*\n* binarynd( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\nfunction binarynd( arrays, shape, fcn ) {\n\treturn recurse( arrays[ 0 ], arrays[ 1 ], arrays[ 2 ], shape.length, shape, 0, fcn ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = binarynd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a binary callback to elements in an n-dimensional nested input array and assign results to elements in an n-dimensional nested output array.\n*\n* @module @stdlib/array/base/binarynd\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add' );\n* var onesnd = require( '@stdlib/array/base/onesnd' );\n* var zerosnd = require( '@stdlib/array/base/zerosnd' );\n* var binarynd = require( '@stdlib/array/base/binarynd' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = onesnd( shape );\n* var y = onesnd( shape );\n* var z = zerosnd( shape );\n*\n* binarynd( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// MAIN //\n\n/**\n* Copies the elements of an indexed array-like object to a new \"generic\" array.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\n\tlen = x.length;\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( x[ i ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = copy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Copy the elements of an indexed array-like object to a new \"generic\" array.\n*\n* @module @stdlib/array/base/copy-indexed\n*\n* @example\n* var copy = require( '@stdlib/array/base/copy-indexed' );\n*\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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// MAIN //\n\n/**\n* Returns a filled \"generic\" array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} filled array\n*\n* @example\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\nfunction filled( value, len ) {\n\tvar arr;\n\tvar i;\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tarr.push( value );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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* Create a filled \"generic\" array.\n*\n* @module @stdlib/array/base/filled\n*\n* @example\n* var filled = require( '@stdlib/array/base/filled' );\n*\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var filled = require( '@stdlib/array/base/filled' );\n*\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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 filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled \"generic\" array.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\nfunction zeros( len ) {\n\treturn filled( 0.0, len );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zeros;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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* Create a zero-filled \"generic\" array.\n*\n* @module @stdlib/array/base/zeros\n*\n* @example\n* var zeros = require( '@stdlib/array/base/zeros' );\n*\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 copy = require( './../../../base/copy-indexed' );\nvar zeros = require( './../../../base/zeros' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Broadcasts an array to a specified shape.\n*\n* @param {Collection} x - input array\n* @param {NonNegativeIntegerArray} inShape - input array shape\n* @param {NonNegativeIntegerArray} outShape - output array shape\n* @throws {Error} input array cannot have more dimensions than the desired shape\n* @throws {Error} input array dimension sizes must be `1` or equal to the corresponding dimension in the provided output shape\n* @throws {Error} input array and desired shape must be broadcast compatible\n* @returns {Object} broadcast object\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 2 ] );\n* // returns {...}\n*\n* var shape = out.shape;\n* // returns [ 2, 2 ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1 ]\n*\n* var ref = out.ref;\n* // returns [ 1, 2 ]\n*\n* var bool = ( x === ref );\n* // returns true\n*\n* var data = out.data;\n* // returns [ [ 1, 2 ] ]\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 1, 2 ] );\n* // returns {...}\n*\n* var data = out.data;\n* // returns [ [ [ 1, 2 ] ] ]\n*\n* var strides = out.strides;\n* // returns [ 0, 0, 1 ]\n*\n* @example\n* var x = [ [ 1 ], [ 2 ] ];\n*\n* var out = broadcastArray( x, [ 2, 1 ], [ 3, 2, 2 ] );\n* // returns {...}\n*\n* var data = out.data;\n* // returns [ [ [ 1 ], [ 2 ] ] ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1, 0 ]\n*/\nfunction broadcastArray( x, inShape, outShape ) {\n\tvar data;\n\tvar dim;\n\tvar st;\n\tvar N;\n\tvar M;\n\tvar d;\n\tvar i;\n\tvar j;\n\n\tN = outShape.length;\n\tM = inShape.length;\n\tif ( N < M ) {\n\t\tthrow new Error( 'invalid argument. Cannot broadcast an array to a shape having fewer dimensions. Arrays can only be broadcasted to shapes having the same or more dimensions.' );\n\t}\n\t// Prepend additional dimensions...\n\tdata = x;\n\tfor ( i = M; i < N; i++ ) {\n\t\tdata = [ data ];\n\t}\n\n\t// Initialize a strides array:\n\tst = zeros( N );\n\n\t// Determine the output array strides...\n\tfor ( i = N-1; i >= 0; i-- ) {\n\t\tj = M - N + i;\n\t\tif ( j < 0 ) {\n\t\t\t// Prepended singleton dimension; stride is zero...\n\t\t\tcontinue;\n\t\t}\n\t\td = inShape[ j ];\n\t\tdim = outShape[ i ];\n\t\tif ( dim !== 0 && dim < d ) {\n\t\t\tthrow new Error( format( 'invalid argument. Input array cannot be broadcast to the specified shape, as the specified shape has a dimension whose size is less than the size of the corresponding dimension in the input array. Array shape: (%s). Desired shape: (%s). Dimension: %u.', copy( inShape ).join( ', ' ), copy( outShape ).join( ', ' ), i ) );\n\t\t}\n\t\tif ( d === dim ) {\n\t\t\t// As the dimension sizes are equal, the stride is one, meaning that each element in the array should be iterated over as normal...\n\t\t\tst[ i ] = 1;\n\t\t} else if ( d === 1 ) {\n\t\t\t// In order to broadcast a dimension, we set the stride for that dimension to zero...\n\t\t\tst[ i ] = 0;\n\t\t} else {\n\t\t\t// At this point, we know that `dim > d` and that `d` does not equal `1` (e.g., `dim=3` and `d=2`); in which case, the shapes are considered incompatible (even for desired shapes which are multiples of array dimensions, as might be desired when \"tiling\" an array; e.g., `dim=4` and `d=2`)...\n\t\t\tthrow new Error( format( 'invalid argument. Input array and the specified shape are broadcast incompatible. Array shape: (%s). Desired shape: (%s). Dimension: %u.', copy( inShape ).join( ', ' ), copy( outShape ).join( ', ' ), i ) );\n\t\t}\n\t}\n\t// Return broadcast results:\n\treturn {\n\t\t'ref': x, // reference to the original input array\n\t\t'data': data, // broadcasted array\n\t\t'shape': copy( outShape ), // copy in order to prevent mutation\n\t\t'strides': st\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = broadcastArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Broadcast an array to a specified shape.\n*\n* @module @stdlib/array/base/broadcast-array\n*\n* @example\n* var broadcastArray = require( '@stdlib/array/base/broadcast-array' );\n*\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 2 ] );\n* // returns {...}\n*\n* var shape = out.shape;\n* // returns [ 2, 2 ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1 ]\n*\n* var ref = out.ref;\n* // returns [ 1, 2 ]\n*\n* var bool = ( x === ref );\n* // returns true\n*\n* var data = out.data;\n* // returns [ [ 1, 2 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = zeros2d( shapes[ 2 ] );\n*\n* bbinary2d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\nfunction bbinary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar k0;\n\tvar k1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tsh = shapes[ 2 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 1 ];\n\tdy1 = st[ 0 ];\n\n\tz = arrays[ 2 ];\n\n\tj1 = 0;\n\tk1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tk0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ k1 ];\n\t\tz0 = z[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tz0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ] );\n\t\t\tj0 += dx0;\n\t\t\tk0 += dy0;\n\t\t}\n\t\tj1 += dx1;\n\t\tk1 += dy1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bbinary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-binary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var bbinary2d = require( '@stdlib/array/base/broadcasted-binary2d' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = zeros2d( shapes[ 2 ] );\n*\n* bbinary2d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a three-dimensional nested output array.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 2, 1, 1 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = zeros3d( shapes[ 2 ] );\n*\n* bbinary3d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\nfunction bbinary3d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar k0;\n\tvar k1;\n\tvar k2;\n\tvar x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar z0;\n\tvar z1;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tsh = shapes[ 2 ];\n\tS0 = sh[ 2 ];\n\tS1 = sh[ 1 ];\n\tS2 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 2 ];\n\tdx1 = st[ 1 ];\n\tdx2 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 2 ];\n\tdy1 = st[ 1 ];\n\tdy2 = st[ 0 ];\n\n\tz = arrays[ 2 ];\n\n\tj2 = 0;\n\tk2 = 0;\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tj1 = 0;\n\t\tk1 = 0;\n\t\tx1 = x[ j2 ];\n\t\ty1 = y[ k2 ];\n\t\tz1 = z[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tj0 = 0;\n\t\t\tk0 = 0;\n\t\t\tx0 = x1[ j1 ];\n\t\t\ty0 = y1[ k1 ];\n\t\t\tz0 = z1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tz0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ] );\n\t\t\t\tj0 += dx0;\n\t\t\t\tk0 += dy0;\n\t\t\t}\n\t\t\tj1 += dx1;\n\t\t\tk1 += dy1;\n\t\t}\n\t\tj2 += dx2;\n\t\tk2 += dy2;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bbinary3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a three-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-binary3d\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var bbinary3d = require( '@stdlib/array/base/broadcasted-binary3d' );\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 2, 1, 1 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = zeros3d( shapes[ 2 ] );\n*\n* bbinary3d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a four-dimensional nested output array.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shapes = [\n* [ 1, 1, 1, 2 ],\n* [ 1, 2, 1, 1 ],\n* [ 1, 2, 2, 2 ]\n* ];\n*\n* var x = ones4d( shapes[ 0 ] );\n* var y = ones4d( shapes[ 1 ] );\n* var z = zeros4d( shapes[ 2 ] );\n*\n* bbinary4d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ]\n*/\nfunction bbinary4d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar k0;\n\tvar k1;\n\tvar k2;\n\tvar k3;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar z0;\n\tvar z1;\n\tvar z2;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tsh = shapes[ 2 ];\n\tS0 = sh[ 3 ];\n\tS1 = sh[ 2 ];\n\tS2 = sh[ 1 ];\n\tS3 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 3 ];\n\tdx1 = st[ 2 ];\n\tdx2 = st[ 1 ];\n\tdx3 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 3 ];\n\tdy1 = st[ 2 ];\n\tdy2 = st[ 1 ];\n\tdy3 = st[ 0 ];\n\n\tz = arrays[ 2 ];\n\n\tj3 = 0;\n\tk3 = 0;\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tj2 = 0;\n\t\tk2 = 0;\n\t\tx2 = x[ j3 ];\n\t\ty2 = y[ k3 ];\n\t\tz2 = z[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tj1 = 0;\n\t\t\tk1 = 0;\n\t\t\tx1 = x2[ j2 ];\n\t\t\ty1 = y2[ k2 ];\n\t\t\tz1 = z2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tj0 = 0;\n\t\t\t\tk0 = 0;\n\t\t\t\tx0 = x1[ j1 ];\n\t\t\t\ty0 = y1[ k1 ];\n\t\t\t\tz0 = z1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tz0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ] );\n\t\t\t\t\tj0 += dx0;\n\t\t\t\t\tk0 += dy0;\n\t\t\t\t}\n\t\t\t\tj1 += dx1;\n\t\t\t\tk1 += dy1;\n\t\t\t}\n\t\t\tj2 += dx2;\n\t\t\tk2 += dy2;\n\t\t}\n\t\tj3 += dx3;\n\t\tk3 += dy3;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bbinary4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a four-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-binary4d\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var bbinary4d = require( '@stdlib/array/base/broadcasted-binary4d' );\n*\n* var shapes = [\n* [ 1, 1, 1, 2 ],\n* [ 1, 2, 1, 1 ],\n* [ 1, 2, 2, 2 ]\n* ];\n*\n* var x = ones4d( shapes[ 0 ] );\n* var y = ones4d( shapes[ 1 ] );\n* var z = zeros4d( shapes[ 2 ] );\n*\n* bbinary4d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a five-dimensional nested output array.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shapes = [\n* [ 1, 1, 1, 1, 2 ],\n* [ 1, 1, 2, 1, 1 ],\n* [ 1, 1, 2, 2, 2 ]\n* ];\n*\n* var x = ones5d( shapes[ 0 ] );\n* var y = ones5d( shapes[ 1 ] );\n* var z = zeros5d( shapes[ 2 ] );\n*\n* bbinary5d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ] ]\n*/\nfunction bbinary5d( arrays, shapes, fcn ) { // eslint-disable-line max-statements\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar k0;\n\tvar k1;\n\tvar k2;\n\tvar k3;\n\tvar k4;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar x3;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar y3;\n\tvar z0;\n\tvar z1;\n\tvar z2;\n\tvar z3;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tsh = shapes[ 2 ];\n\tS0 = sh[ 4 ];\n\tS1 = sh[ 3 ];\n\tS2 = sh[ 2 ];\n\tS3 = sh[ 1 ];\n\tS4 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 || S4 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 4 ];\n\tdx1 = st[ 3 ];\n\tdx2 = st[ 2 ];\n\tdx3 = st[ 1 ];\n\tdx4 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 4 ];\n\tdy1 = st[ 3 ];\n\tdy2 = st[ 2 ];\n\tdy3 = st[ 1 ];\n\tdy4 = st[ 0 ];\n\n\tz = arrays[ 2 ];\n\n\tj4 = 0;\n\tk4 = 0;\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tj3 = 0;\n\t\tk3 = 0;\n\t\tx3 = x[ j4 ];\n\t\ty3 = y[ k4 ];\n\t\tz3 = z[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tj2 = 0;\n\t\t\tk2 = 0;\n\t\t\tx2 = x3[ j3 ];\n\t\t\ty2 = y3[ k3 ];\n\t\t\tz2 = z3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tj1 = 0;\n\t\t\t\tk1 = 0;\n\t\t\t\tx1 = x2[ j2 ];\n\t\t\t\ty1 = y2[ k2 ];\n\t\t\t\tz1 = z2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tj0 = 0;\n\t\t\t\t\tk0 = 0;\n\t\t\t\t\tx0 = x1[ j1 ];\n\t\t\t\t\ty0 = y1[ k1 ];\n\t\t\t\t\tz0 = z1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tz0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ] );\n\t\t\t\t\t\tj0 += dx0;\n\t\t\t\t\t\tk0 += dy0;\n\t\t\t\t\t}\n\t\t\t\t\tj1 += dx1;\n\t\t\t\t\tk1 += dy1;\n\t\t\t\t}\n\t\t\t\tj2 += dx2;\n\t\t\t\tk2 += dy2;\n\t\t\t}\n\t\t\tj3 += dx3;\n\t\t\tk3 += dy3;\n\t\t}\n\t\tj4 += dx4;\n\t\tk4 += dy4;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bbinary5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a five-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-binary5d\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var bbinary5d = require( '@stdlib/array/base/broadcasted-binary5d' );\n*\n* var shapes = [\n* [ 1, 1, 1, 1, 2 ],\n* [ 1, 1, 2, 1, 1 ],\n* [ 1, 1, 2, 2, 2 ]\n* ];\n*\n* var x = ones5d( shapes[ 0 ] );\n* var y = ones5d( shapes[ 1 ] );\n* var z = zeros5d( shapes[ 2 ] );\n*\n* bbinary5d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a quaternary callback to elements in four broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing four input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - quaternary callback\n* @returns {void}\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add4' );\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var w = ones2d( shapes[ 3 ] );\n* var out = zeros2d( shapes[ 4 ] );\n*\n* bquaternary2d( [ x, y, z, w, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 4.0, 4.0 ], [ 4.0, 4.0 ] ]\n*/\nfunction bquaternary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar dz0;\n\tvar dz1;\n\tvar dw0;\n\tvar dw1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar k0;\n\tvar k1;\n\tvar m0;\n\tvar m1;\n\tvar n0;\n\tvar n1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar w0;\n\tvar u0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\tvar u;\n\n\tsh = shapes[ 4 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 1 ];\n\tdy1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );\n\tz = o.data;\n\tst = o.strides;\n\tdz0 = st[ 1 ];\n\tdz1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 3 ], shapes[ 3 ], sh );\n\tw = o.data;\n\tst = o.strides;\n\tdw0 = st[ 1 ];\n\tdw1 = st[ 0 ];\n\n\tu = arrays[ 4 ];\n\n\tj1 = 0;\n\tk1 = 0;\n\tm1 = 0;\n\tn1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tk0 = 0;\n\t\tm0 = 0;\n\t\tn0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ k1 ];\n\t\tz0 = z[ m1 ];\n\t\tw0 = w[ n1 ];\n\t\tu0 = u[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tu0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ], w0[ n0 ] );\n\t\t\tj0 += dx0;\n\t\t\tk0 += dy0;\n\t\t\tm0 += dz0;\n\t\t\tn0 += dw0;\n\t\t}\n\t\tj1 += dx1;\n\t\tk1 += dy1;\n\t\tm1 += dz1;\n\t\tn1 += dw1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bquaternary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a quaternary callback to elements in four broadcasted input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-quaternary2d\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add4' );\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var bquaternary2d = require( '@stdlib/array/base/broadcasted-quaternary2d' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var w = ones2d( shapes[ 3 ] );\n* var out = zeros2d( shapes[ 4 ] );\n*\n* bquaternary2d( [ x, y, z, w, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 4.0, 4.0 ], [ 4.0, 4.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a quinary callback to elements in five broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing five input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - quinary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n*\n* function add( x, y, z, w, v ) {\n* return x + y + z + w + v;\n* }\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ],\n* [ 1, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var w = ones2d( shapes[ 3 ] );\n* var v = ones2d( shapes[ 4 ] );\n* var out = zeros2d( shapes[ 5 ] );\n*\n* bquinary2d( [ x, y, z, w, v, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ]\n*/\nfunction bquinary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar dz0;\n\tvar dz1;\n\tvar dw0;\n\tvar dw1;\n\tvar du0;\n\tvar du1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar k0;\n\tvar k1;\n\tvar m0;\n\tvar m1;\n\tvar n0;\n\tvar n1;\n\tvar p0;\n\tvar p1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar w0;\n\tvar u0;\n\tvar v0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\tvar u;\n\tvar v;\n\n\tsh = shapes[ 5 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 1 ];\n\tdy1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );\n\tz = o.data;\n\tst = o.strides;\n\tdz0 = st[ 1 ];\n\tdz1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 3 ], shapes[ 3 ], sh );\n\tw = o.data;\n\tst = o.strides;\n\tdw0 = st[ 1 ];\n\tdw1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 4 ], shapes[ 4 ], sh );\n\tu = o.data;\n\tst = o.strides;\n\tdu0 = st[ 1 ];\n\tdu1 = st[ 0 ];\n\n\tv = arrays[ 5 ];\n\n\tj1 = 0;\n\tk1 = 0;\n\tm1 = 0;\n\tn1 = 0;\n\tp1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tk0 = 0;\n\t\tm0 = 0;\n\t\tn0 = 0;\n\t\tp0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ k1 ];\n\t\tz0 = z[ m1 ];\n\t\tw0 = w[ n1 ];\n\t\tu0 = u[ p1 ];\n\t\tv0 = v[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tv0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ], w0[ n0 ], u0[ p0 ] );\n\t\t\tj0 += dx0;\n\t\t\tk0 += dy0;\n\t\t\tm0 += dz0;\n\t\t\tn0 += dw0;\n\t\t\tp0 += du0;\n\t\t}\n\t\tj1 += dx1;\n\t\tk1 += dy1;\n\t\tm1 += dz1;\n\t\tn1 += dw1;\n\t\tp1 += du1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bquinary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a quinary callback to elements in five broadcasted input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-quinary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var bquinary2d = require( '@stdlib/array/base/broadcasted-quinary2d' );\n*\n* function add( x, y, z, w, v ) {\n* return x + y + z + w + v;\n* }\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ],\n* [ 1, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var w = ones2d( shapes[ 3 ] );\n* var v = ones2d( shapes[ 4 ] );\n* var out = zeros2d( shapes[ 5 ] );\n*\n* bquinary2d( [ x, y, z, w, v, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a ternary callback to elements in three broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing three input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - ternary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add3' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var out = zeros2d( shapes[ 3 ] );\n*\n* bternary2d( [ x, y, z, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ]\n*/\nfunction bternary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar dz0;\n\tvar dz1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar k0;\n\tvar k1;\n\tvar m0;\n\tvar m1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar w0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\n\tsh = shapes[ 3 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 1 ];\n\tdy1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );\n\tz = o.data;\n\tst = o.strides;\n\tdz0 = st[ 1 ];\n\tdz1 = st[ 0 ];\n\n\tw = arrays[ 3 ];\n\n\tj1 = 0;\n\tk1 = 0;\n\tm1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tk0 = 0;\n\t\tm0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ k1 ];\n\t\tz0 = z[ m1 ];\n\t\tw0 = w[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tw0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ] );\n\t\t\tj0 += dx0;\n\t\t\tk0 += dy0;\n\t\t\tm0 += dz0;\n\t\t}\n\t\tj1 += dx1;\n\t\tk1 += dy1;\n\t\tm1 += dz1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bternary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a ternary callback to elements in three broadcasted input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-ternary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add3' );\n* var bternary2d = require( '@stdlib/array/base/broadcasted-ternary2d' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var out = zeros2d( shapes[ 3 ] );\n*\n* bternary2d( [ x, y, z, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing one input nested array and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - unary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = zeros2d( shapes[ 1 ] );\n*\n* bunary2d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ]\n*/\nfunction bunary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar x0;\n\tvar y0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\n\tsh = shapes[ 1 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\ty = arrays[ 1 ];\n\n\tj1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\ty0[ i0 ] = fcn( x0[ j0 ] );\n\t\t\tj0 += dx0;\n\t\t}\n\t\tj1 += dx1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bunary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-unary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var bunary2d = require( '@stdlib/array/base/broadcasted-unary2d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = zeros2d( shapes[ 1 ] );\n*\n* bunary2d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a three-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing one input nested array and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - unary callback\n* @returns {void}\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 1, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = zeros3d( shapes[ 1 ] );\n*\n* bunary3d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ]\n*/\nfunction bunary3d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\n\tsh = shapes[ 1 ];\n\tS0 = sh[ 2 ];\n\tS1 = sh[ 1 ];\n\tS2 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 2 ];\n\tdx1 = st[ 1 ];\n\tdx2 = st[ 0 ];\n\n\ty = arrays[ 1 ];\n\tj2 = 0;\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tj1 = 0;\n\t\tx1 = x[ j2 ];\n\t\ty1 = y[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tj0 = 0;\n\t\t\tx0 = x1[ j1 ];\n\t\t\ty0 = y1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\ty0[ i0 ] = fcn( x0[ j0 ] );\n\t\t\t\tj0 += dx0;\n\t\t\t}\n\t\t\tj1 += dx1;\n\t\t}\n\t\tj2 += dx2;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bunary3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a three-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-unary3d\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var bunary3d = require( '@stdlib/array/base/broadcasted-unary3d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 1, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = zeros3d( shapes[ 1 ] );\n*\n* bunary3d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a four-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing one input nested array and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - unary callback\n* @returns {void}\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 1, 2 ],\n* [ 1, 1, 2, 2 ]\n* ];\n*\n* var x = ones4d( shapes[ 0 ] );\n* var y = zeros4d( shapes[ 1 ] );\n*\n* bunary4d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ]\n*/\nfunction bunary4d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\n\tsh = shapes[ 1 ];\n\tS0 = sh[ 3 ];\n\tS1 = sh[ 2 ];\n\tS2 = sh[ 1 ];\n\tS3 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 3 ];\n\tdx1 = st[ 2 ];\n\tdx2 = st[ 1 ];\n\tdx3 = st[ 0 ];\n\n\ty = arrays[ 1 ];\n\tj3 = 0;\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tj2 = 0;\n\t\tx2 = x[ j3 ];\n\t\ty2 = y[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tj1 = 0;\n\t\t\tx1 = x2[ j2 ];\n\t\t\ty1 = y2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tj0 = 0;\n\t\t\t\tx0 = x1[ j1 ];\n\t\t\t\ty0 = y1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\ty0[ i0 ] = fcn( x0[ j0 ] );\n\t\t\t\t\tj0 += dx0;\n\t\t\t\t}\n\t\t\t\tj1 += dx1;\n\t\t\t}\n\t\t\tj2 += dx2;\n\t\t}\n\t\tj3 += dx3;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bunary4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a four-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-unary4d\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var bunary4d = require( '@stdlib/array/base/broadcasted-unary4d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 1, 2 ],\n* [ 1, 1, 2, 2 ]\n* ];\n*\n* var x = ones4d( shapes[ 0 ] );\n* var y = zeros4d( shapes[ 1 ] );\n*\n* bunary4d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a five-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing one input nested array and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - unary callback\n* @returns {void}\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 1, 1, 2 ],\n* [ 1, 1, 1, 2, 2 ]\n* ];\n*\n* var x = ones5d( shapes[ 0 ] );\n* var y = zeros5d( shapes[ 1 ] );\n*\n* bunary5d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ] ]\n*/\nfunction bunary5d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar x3;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar y3;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\n\tsh = shapes[ 1 ];\n\tS0 = sh[ 4 ];\n\tS1 = sh[ 3 ];\n\tS2 = sh[ 2 ];\n\tS3 = sh[ 1 ];\n\tS4 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 || S4 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 4 ];\n\tdx1 = st[ 3 ];\n\tdx2 = st[ 2 ];\n\tdx3 = st[ 1 ];\n\tdx4 = st[ 0 ];\n\n\ty = arrays[ 1 ];\n\tj4 = 0;\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tj3 = 0;\n\t\tx3 = x[ j4 ];\n\t\ty3 = y[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tj2 = 0;\n\t\t\tx2 = x3[ j3 ];\n\t\t\ty2 = y3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tj1 = 0;\n\t\t\t\tx1 = x2[ j2 ];\n\t\t\t\ty1 = y2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tj0 = 0;\n\t\t\t\t\tx0 = x1[ j1 ];\n\t\t\t\t\ty0 = y1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\ty0[ i0 ] = fcn( x0[ j0 ] );\n\t\t\t\t\t\tj0 += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tj1 += dx1;\n\t\t\t\t}\n\t\t\t\tj2 += dx2;\n\t\t\t}\n\t\t\tj3 += dx3;\n\t\t}\n\t\tj4 += dx4;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bunary5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a five-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-unary5d\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var bunary5d = require( '@stdlib/array/base/broadcasted-unary5d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 1, 1, 2 ],\n* [ 1, 1, 1, 2, 2 ]\n* ];\n*\n* var x = ones5d( shapes[ 0 ] );\n* var y = zeros5d( shapes[ 1 ] );\n*\n* bunary5d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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 pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns the Cartesian power.\n*\n* ## Notes\n*\n* - The Cartesian power is an n-fold Cartesian product involving a single array. The main insight of this implementation is that the n-fold Cartesian product can be presented as an n-dimensional array stored in row-major order. As such, we can\n*\n* - Compute the total number of tuples, which is simply the size of the provided array (set) raised to the specified power `n`. For n-dimensional arrays, this is the equivalent of computing the product of array dimensions to determine the total number of elements.\n* - Initialize an array for storing indices for indexing into the provided array. For n-dimensional arrays, the index array is equivalent to an array of subscripts for indexing into each dimension.\n* - For the outermost loop, treat the loop index as a linear index into an n-dimensional array and resolve the corresponding subscripts.\n* - Continue iterating until all tuples have been generated.\n*\n* @param {ArrayLikeObject} x - input array\n* @param {NonNegativeInteger} n - power\n* @returns {Array} list of ordered tuples comprising the Cartesian product\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = cartesianPower( x, 2 );\n* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]\n*/\nfunction cartesianPower( x, n ) {\n\tvar out;\n\tvar tmp;\n\tvar idx;\n\tvar len;\n\tvar N;\n\tvar s;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tN = x.length;\n\tif ( N <= 0 || n <= 0 ) {\n\t\treturn [];\n\t}\n\t// Compute the total number of ordered tuples:\n\tlen = pow( N, n );\n\n\t// Initialize a list of indices for indexing into the array (equivalent to ndarray subscripts):\n\tidx = [];\n\tfor ( i = 0; i < n; i++ ) {\n\t\tidx.push( 0 );\n\t}\n\t// Compute the n-fold Cartesian product...\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\t// Resolve a linear index to array indices (logic is equivalent to what is found in ndarray/base/ind2sub for an ndarray stored in row-major order; see https://github.com/stdlib-js/stdlib/blob/215ca5355f3404f15996fd0ced58a98e46f22be6/lib/node_modules/%40stdlib/ndarray/base/ind2sub/lib/assign.js)...\n\t\tk = i;\n\t\tfor ( j = n-1; j >= 0; j-- ) {\n\t\t\ts = k % N;\n\t\t\tk -= s;\n\t\t\tk /= N;\n\t\t\tidx[ j ] = s;\n\t\t}\n\t\t// Generate the next ordered tuple...\n\t\ttmp = [];\n\t\tfor ( j = 0; j < n; j++ ) {\n\t\t\ttmp.push( x[ idx[ j ] ] );\n\t\t}\n\t\tout.push( tmp );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cartesianPower;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Return the Cartesian power.\n*\n* @module @stdlib/array/base/cartesian-power\n*\n* @example\n* var cartesianPower = require( '@stdlib/array/base/cartesian-power' );\n*\n* var x = [ 1, 2 ];\n*\n* var out = cartesianPower( x, 2 );\n* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]\n*/\n\n// MAIN //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// MAIN //\n\n/**\n* Returns the Cartesian product.\n*\n* @param {ArrayLikeObject} x1 - first input array\n* @param {ArrayLikeObject} x2 - second input array\n* @returns {Array} list of ordered tuples comprising the Cartesian product\n*\n* @example\n* var x1 = [ 1, 2, 3 ];\n* var x2 = [ 4, 5 ];\n*\n* var out = cartesianProduct( x1, x2 );\n* // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ]\n*/\nfunction cartesianProduct( x1, x2 ) {\n\tvar out;\n\tvar M;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tM = x1.length;\n\tN = x2.length;\n\tout = [];\n\tfor ( i = 0; i < M; i++ ) {\n\t\tv = x1[ i ];\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tout.push( [ v, x2[ j ] ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cartesianProduct;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Return the Cartesian product.\n*\n* @module @stdlib/array/base/cartesian-product\n*\n* @example\n* var cartesianProduct = require( '@stdlib/array/base/cartesian-product' );\n*\n* var x1 = [ 1, 2, 3 ];\n* var x2 = [ 4, 5 ];\n*\n* var out = cartesianProduct( x1, x2 );\n* // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ]\n*/\n\n// MAIN //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// MAIN //\n\n/**\n* Returns the Cartesian square.\n*\n* @param {ArrayLikeObject} x - input array\n* @returns {Array} list of ordered tuples comprising the Cartesian product\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = cartesianSquare( x );\n* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]\n*/\nfunction cartesianSquare( x ) {\n\tvar out;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tN = x.length;\n\tout = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ i ];\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tout.push( [ v, x[ j ] ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cartesianSquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Return the Cartesian square.\n*\n* @module @stdlib/array/base/cartesian-square\n*\n* @example\n* var cartesianSquare = require( '@stdlib/array/base/cartesian-square' );\n*\n* var x = [ 1, 2 ];\n*\n* var out = cartesianSquare( x );\n* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]\n*/\n\n// MAIN //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( './../../../base/assert/is-accessor-array' );\nvar accessorGetter = require( './../../../base/accessor-getter' );\nvar getter = require( './../../../base/getter' );\nvar dtype = require( './../../../dtype' );\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object.\n*\n* @param {Collection} x - input array\n* @returns {Function} accessor\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = resolveGetter( arr );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction resolveGetter( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn accessorGetter( dt );\n\t}\n\treturn getter( dt );\n}\n\n\n// EXPORTS //\n\nmodule.exports = resolveGetter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Return an accessor function for retrieving an element from an array-like object.\n*\n* @module @stdlib/array/base/resolve-getter\n*\n* @example\n* var resolveGetter = require( '@stdlib/array/base/resolve-getter' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = resolveGetter( arr );\n* var v = get( arr, 2 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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 resolveGetter = require( './../../../base/resolve-getter' );\n\n\n// MAIN //\n\n/**\n* Copies the elements of an array-like object to a new \"generic\" array.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x ) {\n\tvar out;\n\tvar len;\n\tvar get;\n\tvar i;\n\n\t// Resolve an accessor for retrieving input array elements:\n\tget = resolveGetter( x );\n\n\t// Get the number of elements to copy:\n\tlen = x.length;\n\n\t// Loop over the elements...\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( get( x, i ) ); // ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = copy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Copy the elements of an array-like object to a new \"generic\" array.\n*\n* @module @stdlib/array/base/copy\n*\n* @example\n* var copy = require( '@stdlib/array/base/copy' );\n*\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// MAIN //\n\n/**\n* Returns a filled \"generic\" array according to a provided callback function.\n*\n* @param {NonNegativeInteger} len - array length\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filledBy( 3, constantFunction( 'beep' ) );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\nfunction filledBy( len, clbk, thisArg ) {\n\tvar arr;\n\tvar i;\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tarr.push( clbk.call( thisArg, i ) );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filledBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Create a filled \"generic\" array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filledBy = require( '@stdlib/array/base/filled-by' );\n*\n* var out = filledBy( 3, constantFunction( 'beep' ) );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a filled two-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = filled2d( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var out = filled2d( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\nfunction filled2d( value, shape ) {\n\tvar arr;\n\tvar S0;\n\tvar S1;\n\tvar i;\n\n\tS0 = shape[ 1 ];\n\tS1 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < S1; i++ ) {\n\t\tarr.push( filled( value, S0 ) );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled two-dimensional nested array.\n*\n* @module @stdlib/array/base/filled2d\n*\n* @example\n* var filled2d = require( '@stdlib/array/base/filled2d' );\n*\n* var out = filled2d( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var filled2d = require( '@stdlib/array/base/filled2d' );\n*\n* var out = filled2d( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Returns a filled two-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filled2dBy( [ 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ 'beep', 'beep', 'beep' ] ]\n*/\nfunction filled2dBy( shape, clbk, thisArg ) {\n\tvar arr;\n\tvar a0;\n\tvar S0;\n\tvar S1;\n\tvar i;\n\tvar j;\n\n\tS0 = shape[ 1 ];\n\tS1 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < S1; i++ ) {\n\t\ta0 = [];\n\t\tfor ( j = 0; j < S0; j++ ) {\n\t\t\ta0.push( clbk.call( thisArg, [ i, j ] ) );\n\t\t}\n\t\tarr.push( a0 );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled2dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled two-dimensional nested array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled2d-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filled2dBy = require( '@stdlib/array/base/filled2d-by' );\n*\n* var out = filled2dBy( [ 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ 'beep', 'beep', 'beep' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a filled three-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = filled3d( 0.0, [ 1, 1, 3 ] );\n* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ]\n*\n* @example\n* var out = filled3d( 'beep', [ 1, 3, 1 ] );\n* // returns [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ]\n*/\nfunction filled3d( value, shape ) {\n\tvar out;\n\tvar a1;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i2;\n\tvar i1;\n\n\tS0 = shape[ 2 ];\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tout = [];\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\ta1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta1.push( filled( value, S0 ) );\n\t\t}\n\t\tout.push( a1 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled three-dimensional nested array.\n*\n* @module @stdlib/array/base/filled3d\n*\n* @example\n* var filled3d = require( '@stdlib/array/base/filled3d' );\n*\n* var out = filled3d( 0.0, [ 1, 1, 3 ] );\n* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ]\n*\n* @example\n* var filled3d = require( '@stdlib/array/base/filled3d' );\n*\n* var out = filled3d( 'beep', [ 1, 3, 1 ] );\n* // returns [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Returns a filled three-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filled3dBy( [ 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ 'beep', 'beep', 'beep' ] ] ]\n*/\nfunction filled3dBy( shape, clbk, thisArg ) {\n\tvar arr;\n\tvar a0;\n\tvar a1;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\tS0 = shape[ 2 ];\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\ta1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta0 = [];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\ta0.push( clbk.call( thisArg, [ i2, i1, i0 ] ) );\n\t\t\t}\n\t\t\ta1.push( a0 );\n\t\t}\n\t\tarr.push( a1 );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled3dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled three-dimensional nested array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled3d-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filled3dBy = require( '@stdlib/array/base/filled3d-by' );\n*\n* var out = filled3dBy( [ 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ 'beep', 'beep', 'beep' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a filled four-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = filled4d( 0.0, [ 1, 1, 1, 3 ] );\n* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ]\n*\n* @example\n* var out = filled4d( 'beep', [ 1, 1, 3, 1 ] );\n* // returns [ [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ] ]\n*/\nfunction filled4d( value, shape ) {\n\tvar out;\n\tvar a1;\n\tvar a2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\tS0 = shape[ 3 ];\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tout = [];\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\ta2 = [];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\ta1 = [];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\ta1.push( filled( value, S0 ) );\n\t\t\t}\n\t\t\ta2.push( a1 );\n\t\t}\n\t\tout.push( a2 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled four-dimensional nested array.\n*\n* @module @stdlib/array/base/filled4d\n*\n* @example\n* var filled4d = require( '@stdlib/array/base/filled4d' );\n*\n* var out = filled4d( 0.0, [ 1, 1, 1, 3 ] );\n* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ]\n*\n* @example\n* var filled4d = require( '@stdlib/array/base/filled4d' );\n*\n* var out = filled4d( 'beep', [ 1, 1, 3, 1 ] );\n* // returns [ [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Returns a filled four-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filled4dBy( [ 1, 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ]\n*/\nfunction filled4dBy( shape, clbk, thisArg ) {\n\tvar arr;\n\tvar a0;\n\tvar a1;\n\tvar a2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\tS0 = shape[ 3 ];\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\ta2 = [];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\ta1 = [];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\ta0 = [];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\ta0.push( clbk.call( thisArg, [ i3, i2, i1, i0 ] ) );\n\t\t\t\t}\n\t\t\t\ta1.push( a0 );\n\t\t\t}\n\t\t\ta2.push( a1 );\n\t\t}\n\t\tarr.push( a2 );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled4dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled four-dimensional nested array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled4d-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filled4dBy = require( '@stdlib/array/base/filled4d-by' );\n*\n* var out = filled4dBy( [ 1, 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a filled five-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = filled5d( 0.0, [ 1, 1, 1, 1, 3 ] );\n* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ]\n*\n* @example\n* var out = filled5d( 'beep', [ 1, 1, 1, 3, 1 ] );\n* // returns [ [ [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ] ] ]\n*/\nfunction filled5d( value, shape ) {\n\tvar out;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\tS0 = shape[ 4 ];\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tout = [];\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\ta3 = [];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\ta2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta1 = [];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\ta1.push( filled( value, S0 ) );\n\t\t\t\t}\n\t\t\t\ta2.push( a1 );\n\t\t\t}\n\t\t\ta3.push( a2 );\n\t\t}\n\t\tout.push( a3 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled five-dimensional nested array.\n*\n* @module @stdlib/array/base/filled5d\n*\n* @example\n* var filled5d = require( '@stdlib/array/base/filled5d' );\n*\n* var out = filled5d( 0.0, [ 1, 1, 1, 1, 3 ] );\n* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ]\n*\n* @example\n* var filled5d = require( '@stdlib/array/base/filled5d' );\n*\n* var out = filled5d( 'beep', [ 1, 1, 1, 3, 1 ] );\n* // returns [ [ [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Returns a filled five-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filled5dBy( [ 1, 1, 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ] ]\n*/\nfunction filled5dBy( shape, clbk, thisArg ) {\n\tvar arr;\n\tvar a0;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\tS0 = shape[ 4 ];\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\ta3 = [];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\ta2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta1 = [];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\ta0 = [];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\ta0.push( clbk.call( thisArg, [ i4, i3, i2, i1, i0 ] ) );\n\t\t\t\t\t}\n\t\t\t\t\ta1.push( a0 );\n\t\t\t\t}\n\t\t\t\ta2.push( a1 );\n\t\t\t}\n\t\t\ta3.push( a2 );\n\t\t}\n\t\tarr.push( a3 );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled5dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled five-dimensional nested array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled5d-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filled5dBy = require( '@stdlib/array/base/filled5d-by' );\n*\n* var out = filled5dBy( [ 1, 1, 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 filled = require( './../../../base/filled' );\n\n\n// FUNCTIONS //\n\n/**\n* Recursive fills an array.\n*\n* @private\n* @param {*} value - fill value\n* @param {NonNegativeInteger} ndims - number of dimensions\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {NonNegativeInteger} dim - dimension index\n* @param {Array} out - output array\n* @returns {Array} output array\n*/\nfunction recurse( value, ndims, shape, dim, out ) {\n\tvar S;\n\tvar d;\n\tvar i;\n\n\tS = shape[ dim ];\n\n\t// Check whether we're filling the last dimension:\n\td = dim + 1;\n\tif ( d === ndims ) {\n\t\treturn filled( value, S );\n\t}\n\n\t// Fill nested dimensions...\n\tfor ( i = 0; i < S; i++ ) {\n\t\tout.push( recurse( value, ndims, shape, d, [] ) );\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a filled two-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = fillednd( 0.0, [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = fillednd( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var out = fillednd( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\nfunction fillednd( value, shape ) {\n\treturn recurse( value, shape.length, shape, 0, [] );\n}\n\n\n// EXPORTS //\n\nmodule.exports = fillednd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled n-dimensional nested array.\n*\n* @module @stdlib/array/base/fillednd\n*\n* @example\n* var fillednd = require( '@stdlib/array/base/fillednd' );\n*\n* var out = fillednd( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var fillednd = require( '@stdlib/array/base/fillednd' );\n*\n* var out = fillednd( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// FUNCTIONS //\n\n/**\n* Recursive fills an array.\n*\n* @private\n* @param {NonNegativeInteger} ndims - number of dimensions\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {NonNegativeInteger} dim - dimension index\n* @param {NonNegativeIntegerArray} indices - outer array element indices\n* @param {Array} out - output array\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Array} output array\n*/\nfunction recurse( ndims, shape, dim, indices, out, clbk, thisArg ) {\n\tvar idx;\n\tvar FLG;\n\tvar S;\n\tvar d;\n\tvar i;\n\n\t// Check whether we're filling the last dimension:\n\td = dim + 1;\n\tFLG = ( d === ndims );\n\n\tS = shape[ dim ];\n\tfor ( i = 0; i < S; i++ ) {\n\t\tidx = indices.slice(); // we explicitly copy in order to avoid potential mutation when calling `clbk`\n\t\tidx.push( i );\n\t\tif ( FLG ) {\n\t\t\tout.push( clbk.call( thisArg, idx ) );\n\t\t} else {\n\t\t\tout.push( recurse( ndims, shape, d, idx, [], clbk, thisArg ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a filled two-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filledndBy( [ 3, 1 ], constantFunction( 'beep' ) );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\nfunction filledndBy( shape, clbk, thisArg ) {\n\treturn recurse( shape.length, shape, 0, [], [], clbk, thisArg );\n}\n\n\n// EXPORTS //\n\nmodule.exports = filledndBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a filled n-dimensional nested array according to a callback function.\n*\n* @module @stdlib/array/base/fillednd-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filledndBy = require( '@stdlib/array/base/fillednd-by' );\n*\n* var out = filledndBy( [ 3, 1 ], constantFunction( 'beep' ) );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 resolveGetter = require( './../../../base/resolve-getter' );\n\n\n// MAIN //\n\n/**\n* Returns the first element of an array-like object.\n*\n* @param {Collection} arr - input array\n* @returns {*} - first element\n*\n* @example\n* var out = first( [ 1, 2, 3 ] );\n* // returns 1\n*/\nfunction first( arr ) {\n\tvar get;\n\n\tif ( arr.length === 0 ) {\n\t\treturn;\n\t}\n\t// Resolve an accessor for retrieving input array elements:\n\tget = resolveGetter( arr );\n\n\t// Return the first element:\n\treturn get( arr, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = first;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Return the first element of an array-like object.\n*\n* @module @stdlib/array/base/first\n*\n* @example\n* var first = require( '@stdlib/array/base/first' );\n*\n* var out = first( [ 1, 2, 3 ] );\n* // returns 1\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 shape2strides = require( '@stdlib/ndarray/base/shape2strides' );\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\nvar numel = require( '@stdlib/ndarray/base/numel' );\nvar grev = require( '@stdlib/blas/ext/base/grev' );\nvar zeros = require( './../../../base/zeros' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// FUNCTIONS //\n\n/**\n* Copies a specified number of array elements to a provided array.\n*\n* @private\n* @param {Array} x - input array\n* @param {NonNegativeInteger} N - number of elements to copy\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = [ 0, 0, 0 ];\n* copy( x, 3, out, 1, 0 );\n*\n* var o = out;\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x, N, out, stride, offset ) {\n\tvar i;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tout[ offset ] = x[ i ];\n\t\toffset += stride;\n\t}\n}\n\n/**\n* Recursively flattens an array in lexicographic order.\n*\n* @private\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {NonNegativeInteger} dim - dimension index\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {NonNegativeInteger} offset for next output array element\n*/\nfunction recurseLexicographic( x, ndims, shape, dim, out, stride, offset ) {\n\tvar FLG;\n\tvar S;\n\tvar d;\n\tvar i;\n\n\t// Check whether we've reached the last dimension:\n\td = dim + 1;\n\tFLG = ( d === ndims );\n\n\tS = shape[ dim ];\n\tfor ( i = 0; i < S; i++ ) {\n\t\tif ( FLG ) {\n\t\t\tout[ offset ] = x[ i ];\n\t\t\toffset += stride;\n\t\t} else {\n\t\t\toffset = recurseLexicographic( x[ i ], ndims, shape, d, out, stride, offset ); // eslint-disable-line max-len\n\t\t}\n\t}\n\treturn offset;\n}\n\n/**\n* Flattens an array in colexicographic order.\n*\n* @private\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n*/\nfunction flattenColexicographic( x, ndims, shape, out, stride, offset ) {\n\tvar len;\n\tvar tmp;\n\tvar ord;\n\tvar sh;\n\tvar sx;\n\tvar j;\n\tvar i;\n\n\t// Note that, in contrast to lexicographic iteration, we cannot readily define a straightforward recursive definition for colexicographic iteration. Accordingly, we have to perform a workaround in which we first flatten in lexicographic order and then perform an out-of-place transposition to return an array in colexicographic order.\n\n\t// Determine how many elements will be in the output array:\n\tlen = numel( shape );\n\n\t// For input arrays having an arbitrary number of dimensions, first flatten in lexicographic order:\n\ttmp = zeros( len );\n\trecurseLexicographic( x, ndims, shape, 0, tmp, 1, 0 );\n\n\t// Define the memory layout:\n\tord = 'row-major';\n\n\t// Generate a stride array for lexicographic order:\n\tsx = shape2strides( shape, ord );\n\n\t// Reverse the dimensions and strides (i.e., define the shape and strides of the transpose):\n\tsh = zeros( ndims );\n\tcopy( shape, ndims, sh, 1, 0 );\n\tgrev( ndims, sh, 1 );\n\tgrev( ndims, sx, 1 );\n\n\t// Iterate over each element based on the linear **view** index (note: this has negative performance implications due to lack of data locality)...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = vind2bind( sh, sx, 0, ord, i, MODE );\n\t\tout[ offset ] = tmp[ j ];\n\t\toffset += stride;\n\t}\n}\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], false, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], true, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten( x, shape, colexicographic, out, stride, offset ) {\n\tvar ndims = shape.length;\n\tif ( ndims === 0 ) { // 0-dimensional array\n\t\treturn out;\n\t}\n\tif ( ndims === 1 ) { // 1-dimensional array\n\t\t// For 1-dimensional arrays, we can perform a simple copy:\n\t\tcopy( x, shape[ 0 ], out, stride, offset );\n\t\treturn out;\n\t}\n\tif ( colexicographic ) {\n\t\tflattenColexicographic( x, ndims, shape, out, stride, offset );\n\t\treturn out;\n\t}\n\trecurseLexicographic( x, ndims, shape, 0, out, stride, offset );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 numel = require( '@stdlib/ndarray/base/numel' );\nvar zeros = require( './../../../base/zeros' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @returns {Array} flattened array\n*\n* @example\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten( x, shape, colexicographic ) {\n\tvar out = zeros( numel( shape ) );\n\treturn assign( x, shape, colexicographic, out, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Flatten an n-dimensional nested array.\n*\n* @module @stdlib/array/base/flatten\n*\n* @example\n* var flatten = require( '@stdlib/array/base/flatten' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var flatten = require( '@stdlib/array/base/flatten' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten = require( '@stdlib/array/base/flatten' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten.assign( x, [ 2, 2 ], true, out, 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar shape2strides = require( '@stdlib/ndarray/base/shape2strides' );\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\nvar numel = require( '@stdlib/ndarray/base/numel' );\nvar grev = require( '@stdlib/blas/ext/base/grev' );\nvar zeros = require( './../../../base/zeros' );\nvar copy = require( './../../../base/copy-indexed' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// FUNCTIONS //\n\n/**\n* Copies a specified number of array elements to a provided array according to a callback function.\n*\n* @private\n* @param {Array} x - input array\n* @param {NonNegativeInteger} N - number of elements to copy\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = [ 0, 0, 0 ];\n* copyBy( x, 3, out, 1, 0, scale );\n*\n* var o = out;\n* // returns [ 2, 4, 6 ]\n*/\nfunction copyBy( x, N, out, stride, offset, clbk, thisArg ) {\n\tvar i;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tout[ offset ] = clbk.call( thisArg, x[ i ], [ i ], x );\n\t\toffset += stride;\n\t}\n}\n\n/**\n* Recursively flattens an array in lexicographic order.\n*\n* @private\n* @param {Array} orig - original input array\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {NonNegativeInteger} dim - dimension index\n* @param {NonNegativeIntegerArray} indices - outer array element indices\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {NonNegativeInteger} offset for next output array element\n*/\nfunction recurseLexicographic( orig, x, ndims, shape, dim, indices, out, stride, offset, clbk, thisArg ) { // eslint-disable-line max-params\n\tvar FLG;\n\tvar idx;\n\tvar S;\n\tvar d;\n\tvar i;\n\n\t// Check whether we've reached the last dimension:\n\td = dim + 1;\n\tFLG = ( d === ndims );\n\n\tS = shape[ dim ];\n\tfor ( i = 0; i < S; i++ ) {\n\t\tidx = indices.slice(); // we explicitly copy in order to avoid potential mutation when calling `clbk`\n\t\tidx.push( i );\n\t\tif ( FLG ) {\n\t\t\tout[ offset ] = clbk.call( thisArg, x[ i ], idx, orig );\n\t\t\toffset += stride;\n\t\t} else {\n\t\t\toffset = recurseLexicographic( orig, x[ i ], ndims, shape, d, idx, out, stride, offset, clbk, thisArg );\n\t\t}\n\t}\n\treturn offset;\n}\n\n/**\n* Flattens an array in colexicographic order.\n*\n* @private\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n*/\nfunction flattenColexicographic( x, ndims, shape, out, stride, offset, clbk, thisArg ) {\n\tvar len;\n\tvar tmp;\n\tvar ord;\n\tvar sh;\n\tvar sx;\n\tvar j;\n\tvar i;\n\n\t// Note that, in contrast to lexicographic iteration, we cannot readily define a straightforward recursive definition for colexicographic iteration. Accordingly, we have to perform a workaround in which we first flatten in lexicographic order and then perform an out-of-place transposition to return an array in colexicographic order.\n\n\t// Determine how many elements will be in the output array:\n\tlen = numel( shape );\n\n\t// For input arrays having an arbitrary number of dimensions, first flatten in lexicographic order:\n\ttmp = zeros( len );\n\trecurseLexicographic( x, x, ndims, shape, 0, [], tmp, 1, 0, clbk, thisArg );\n\n\t// Define the memory layout:\n\tord = 'row-major';\n\n\t// Generate a stride array for lexicographic order:\n\tsx = shape2strides( shape, ord );\n\n\t// Reverse the dimensions and strides (i.e., define the shape and strides of the transpose):\n\tsh = copy( shape );\n\tgrev( ndims, sh, 1 );\n\tgrev( ndims, sx, 1 );\n\n\t// Iterate over each element based on the linear **view** index (note: this has negative performance implications due to lack of data locality)...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = vind2bind( sh, sx, 0, ord, i, MODE );\n\t\tout[ offset ] = tmp[ j ];\n\t\toffset += stride;\n\t}\n}\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array according to a callback function and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], false, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], true, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flattenBy( x, shape, colexicographic, out, stride, offset, clbk, thisArg ) {\n\tvar ndims = shape.length;\n\tif ( ndims === 0 ) { // 0-dimensional array\n\t\treturn out;\n\t}\n\tif ( ndims === 1 ) { // 1-dimensional array\n\t\t// For 1-dimensional arrays, we can perform simple iteration:\n\t\tcopyBy( x, shape[ 0 ], out, stride, offset, clbk, thisArg );\n\t\treturn out;\n\t}\n\tif ( colexicographic ) {\n\t\tflattenColexicographic( x, ndims, shape, out, stride, offset, clbk, thisArg );\n\t\treturn out;\n\t}\n\trecurseLexicographic( x, x, ndims, shape, 0, [], out, stride, offset, clbk, thisArg );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flattenBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 numel = require( '@stdlib/ndarray/base/numel' );\nvar zeros = require( './../../../base/zeros' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array according to a callback function.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Array} flattened array\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flattenBy( x, shape, colexicographic, clbk, thisArg ) {\n\tvar out = zeros( numel( shape ) );\n\treturn assign( x, shape, colexicographic, out, 1, 0, clbk, thisArg );\n}\n\n\n// EXPORTS //\n\nmodule.exports = flattenBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Flatten an n-dimensional nested array according to a callback function.\n*\n* @module @stdlib/array/base/flatten-by\n*\n* @example\n* var flattenBy = require( '@stdlib/array/base/flatten-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var flattenBy = require( '@stdlib/array/base/flatten-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flattenBy = require( '@stdlib/array/base/flatten-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flattenBy.assign( x, [ 2, 2 ], true, out, 1, 0, scale );\n* // returns [ 2, 6, 4, 8 ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Flattens a two-dimensional nested array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @returns {Array} flattened array\n*\n* @example\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2d( x, [ 2, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2d( x, [ 2, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten2d( x, shape, colexicographic ) {\n\tvar out;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar a0;\n\n\t// Extract loop variables:\n\tS0 = shape[ 1 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 0 ];\n\n\t// Initialize an output array:\n\tout = [];\n\n\t// Iterate over the array dimensions...\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tout.push( x[ i1 ][ i0 ] ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\ta0 = x[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tout.push( a0[ i0 ] ); // equivalent to storing in row-major (C-style) order\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Flattens a two-dimensional nested array and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2d( x, [ 2, 2 ], false, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2d( x, [ 2, 2 ], true, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten2d( x, shape, colexicographic, out, stride, offset ) {\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar a0;\n\tvar io;\n\n\t// Extract loop variables:\n\tS0 = shape[ 1 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 0 ];\n\n\t// Iterate over the array dimensions...\n\tio = offset;\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tout[ io ] = x[ i1 ][ i0 ]; // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\tio += stride;\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\ta0 = x[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tout[ io ] = a0[ i0 ]; // equivalent to storing in row-major (C-style) order\n\t\t\tio += stride;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Flatten a two-dimensional nested array.\n*\n* @module @stdlib/array/base/flatten2d\n*\n* @example\n* var flatten2d = require( '@stdlib/array/base/flatten2d' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2d( x, [ 2, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var flatten2d = require( '@stdlib/array/base/flatten2d' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2d( x, [ 2, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten2d = require( '@stdlib/array/base/flatten2d' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten2d.assign( x, [ 2, 2 ], true, out, 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Flattens a two-dimensional nested array according to a callback function.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Array} flattened array\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2dBy( x, [ 2, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2dBy( x, [ 2, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flatten2dBy( x, shape, colexicographic, clbk, thisArg ) {\n\tvar out;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar a0;\n\n\t// Extract loop variables:\n\tS0 = shape[ 1 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 0 ];\n\n\t// Initialize an output array:\n\tout = [];\n\n\t// Iterate over the array dimensions...\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tout.push( clbk.call( thisArg, x[ i1 ][ i0 ], [ i1, i0 ], x ) ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\ta0 = x[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tout.push( clbk.call( thisArg, a0[ i0 ], [ i1, i0 ], x ) ); // equivalent to storing in row-major (C-style) order\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten2dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Flattens a two-dimensional nested array according to a callback function and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2dBy( x, [ 2, 2 ], false, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2dBy( x, [ 2, 2 ], true, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flatten2dBy( x, shape, colexicographic, out, stride, offset, clbk, thisArg ) { // eslint-disable-line max-len\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar a0;\n\tvar io;\n\n\t// Extract loop variables:\n\tS0 = shape[ 1 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 0 ];\n\n\t// Iterate over the array dimensions...\n\tio = offset;\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tout[ io ] = clbk.call( thisArg, x[ i1 ][ i0 ], [ i1, i0 ], x ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\tio += stride;\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\ta0 = x[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tout[ io ] = clbk.call( thisArg, a0[ i0 ], [ i1, i0 ], x ); // equivalent to storing in row-major (C-style) order\n\t\t\tio += stride;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten2dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Flatten a two-dimensional nested array according to a callback function.\n*\n* @module @stdlib/array/base/flatten2d-by\n*\n* @example\n* var flatten2dBy = require( '@stdlib/array/base/flatten2d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2dBy( x, [ 2, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var flatten2dBy = require( '@stdlib/array/base/flatten2d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten2dBy( x, [ 2, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten2dBy = require( '@stdlib/array/base/flatten2d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten2dBy( x, [ 2, 2 ], true, out, 1, 0, scale );\n* // returns [ 2, 6, 4, 8 ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Flattens a three-dimensional nested array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array>} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @returns {Array} flattened array\n*\n* @example\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3d( x, [ 2, 1, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3d( x, [ 2, 1, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten3d( x, shape, colexicographic ) {\n\tvar out;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar a0;\n\tvar a1;\n\n\t// Extract loop variables:\n\tS0 = shape[ 2 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\n\t// Initialize an output array:\n\tout = [];\n\n\t// Iterate over the array dimensions...\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tout.push( x[ i2 ][ i1 ][ i0 ] ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\ta1 = x[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta0 = a1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tout.push( a0[ i0 ] ); // equivalent to storing in row-major (C-style) order\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Flattens a three-dimensional nested array and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array>} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3d( x, [ 2, 1, 2 ], false, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3d( x, [ 2, 1, 2 ], true, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten3d( x, shape, colexicographic, out, stride, offset ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar a0;\n\tvar a1;\n\tvar io;\n\n\t// Extract loop variables:\n\tS0 = shape[ 2 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\n\t// Iterate over the array dimensions...\n\tio = offset;\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tout[ io ] = x[ i2 ][ i1 ][ i0 ]; // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\tio += stride;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\ta1 = x[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta0 = a1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tout[ io ] = a0[ i0 ]; // equivalent to storing in row-major (C-style) order\n\t\t\t\tio += stride;\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Flatten a three-dimensional nested array.\n*\n* @module @stdlib/array/base/flatten3d\n*\n* @example\n* var flatten3d = require( '@stdlib/array/base/flatten3d' );\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3d( x, [ 2, 1, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var flatten3d = require( '@stdlib/array/base/flatten3d' );\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3d( x, [ 2, 1, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten3d = require( '@stdlib/array/base/flatten3d' );\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten3d.assign( x, [ 2, 1, 2 ], true, out, 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*\n* var bool = ( y === out );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable max-len */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Flattens a three-dimensional nested array according to a callback function.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array>} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Array} flattened array\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3dBy( x, [ 2, 1, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3dBy( x, [ 2, 1, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flatten3dBy( x, shape, colexicographic, clbk, thisArg ) {\n\tvar out;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar a0;\n\tvar a1;\n\n\t// Extract loop variables:\n\tS0 = shape[ 2 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\n\t// Initialize an output array:\n\tout = [];\n\n\t// Iterate over the array dimensions...\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tout.push( clbk.call( thisArg, x[ i2 ][ i1 ][ i0 ], [ i2, i1, i0 ], x ) ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\ta1 = x[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta0 = a1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tout.push( clbk.call( thisArg, a0[ i0 ], [ i2, i1, i0 ], x ) ); // equivalent to storing in row-major (C-style) order\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten3dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable max-len */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Flattens a three-dimensional nested array according to a callback function and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array>} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3dBy( x, [ 2, 1, 2 ], false, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3dBy( x, [ 2, 1, 2 ], true, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flatten3dBy( x, shape, colexicographic, out, stride, offset, clbk, thisArg ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar a0;\n\tvar a1;\n\tvar io;\n\n\t// Extract loop variables:\n\tS0 = shape[ 2 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\n\t// Iterate over the array dimensions...\n\tio = offset;\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tout[ io ] = clbk.call( thisArg, x[ i2 ][ i1 ][ i0 ], [ i2, i1, i0 ], x ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\tio += stride;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\ta1 = x[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta0 = a1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tout[ io ] = clbk.call( thisArg, a0[ i0 ], [ i2, i1, i0 ], x ); // equivalent to storing in row-major (C-style) order\n\t\t\t\tio += stride;\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten3dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Flatten a three-dimensional nested array according to a callback function.\n*\n* @module @stdlib/array/base/flatten3d-by\n*\n* @example\n* var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3dBy( x, [ 2, 1, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = flatten3dBy( x, [ 2, 1, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten3dBy.assign( x, [ 2, 1, 2 ], true, out, 1, 0, scale );\n* // returns [ 2, 6, 4, 8 ]\n*\n* var bool = ( y === out );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Flattens a four-dimensional nested array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array>>} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @returns {Array} flattened array\n*\n* @example\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4d( x, [ 2, 1, 1, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4d( x, [ 2, 1, 1, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten4d( x, shape, colexicographic ) {\n\tvar out;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar a0;\n\tvar a1;\n\tvar a2;\n\n\t// Extract loop variables:\n\tS0 = shape[ 3 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\n\t// Initialize an output array:\n\tout = [];\n\n\t// Iterate over the array dimensions...\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tout.push( x[ i3 ][ i2 ][ i1 ][ i0 ] ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\ta2 = x[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\ta1 = a2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\ta0 = a1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tout.push( a0[ i0 ] ); // equivalent to storing in row-major (C-style) order\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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// MAIN //\n\n/**\n* Flattens a four-dimensional nested array and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array>>} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4d( x, [ 2, 1, 1, 2 ], false, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4d( x, [ 2, 1, 1, 2 ], true, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten4d( x, shape, colexicographic, out, stride, offset ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar a0;\n\tvar a1;\n\tvar a2;\n\tvar io;\n\n\t// Extract loop variables:\n\tS0 = shape[ 3 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\n\t// Iterate over the array dimensions...\n\tio = offset;\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tout[ io ] = x[ i3 ][ i2 ][ i1 ][ i0 ]; // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\t\tio += stride;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\ta2 = x[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\ta1 = a2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\ta0 = a1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tout[ io ] = a0[ i0 ]; // equivalent to storing in row-major (C-style) order\n\t\t\t\t\tio += stride;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Flatten a four-dimensional nested array.\n*\n* @module @stdlib/array/base/flatten4d\n*\n* @example\n* var flatten4d = require( '@stdlib/array/base/flatten4d' );\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4d( x, [ 2, 1, 1, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var flatten4d = require( '@stdlib/array/base/flatten4d' );\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4d( x, [ 2, 1, 1, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten4d = require( '@stdlib/array/base/flatten4d' );\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten4d.assign( x, [ 2, 1, 1, 2 ], true, out, 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable max-len */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Flattens a four-dimensional nested array according to a callback function.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array>>} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Array} flattened array\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4dBy( x, [ 2, 1, 1, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4dBy( x, [ 2, 1, 1, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flatten4dBy( x, shape, colexicographic, clbk, thisArg ) {\n\tvar out;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar a0;\n\tvar a1;\n\tvar a2;\n\n\t// Extract loop variables:\n\tS0 = shape[ 3 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\n\t// Initialize an output array:\n\tout = [];\n\n\t// Iterate over the array dimensions...\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tout.push( clbk.call( thisArg, x[ i3 ][ i2 ][ i1 ][ i0 ], [ i3, i2, i1, i0 ], x ) ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\ta2 = x[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\ta1 = a2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\ta0 = a1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tout.push( clbk.call( thisArg, a0[ i0 ], [ i3, i2, i1, i0 ], x ) ); // equivalent to storing in row-major (C-style) order\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten4dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable max-len */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Flattens a four-dimensional nested array according to a callback function and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array>>} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4dBy( x, [ 2, 1, 1, 2 ], false, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4dBy( x, [ 2, 1, 1, 2 ], true, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flatten4dBy( x, shape, colexicographic, out, stride, offset, clbk, thisArg ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar a0;\n\tvar a1;\n\tvar a2;\n\tvar io;\n\n\t// Extract loop variables:\n\tS0 = shape[ 3 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\n\t// Iterate over the array dimensions...\n\tio = offset;\n\tif ( colexicographic ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tout[ io ] = clbk.call( thisArg, x[ i3 ][ i2 ][ i1 ][ i0 ], [ i3, i2, i1, i0 ], x ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\t\tio += stride;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\ta2 = x[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\ta1 = a2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\ta0 = a1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tout[ io ] = clbk.call( thisArg, a0[ i0 ], [ i3, i2, i1, i0 ], x ); // equivalent to storing in row-major (C-style) order\n\t\t\t\t\tio += stride;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten4dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Flatten a four-dimensional nested array according to a callback function.\n*\n* @module @stdlib/array/base/flatten4d-by\n*\n* @example\n* var flatten4dBy = require( '@stdlib/array/base/flatten4d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4dBy( x, [ 2, 1, 1, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var flatten4dBy = require( '@stdlib/array/base/flatten4d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = flatten4dBy( x, [ 2, 1, 1, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten4dBy = require( '@stdlib/array/base/flatten4d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ [ 1, 2 ] ] ], [ [ [ 3, 4 ] ] ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten4dBy.assign( x, [ 2, 1, 1, 2 ], true, out, 1, 0, scale );\n* // returns