diff --git a/base/lib/index.js b/base/lib/index.js
index 0fe70203..afad1b43 100644
--- a/base/lib/index.js
+++ b/base/lib/index.js
@@ -504,6 +504,15 @@ setReadOnly( ns, 'linspace', require( './../../base/linspace' ) );
*/
setReadOnly( ns, 'logspace', require( './../../base/logspace' ) );
+/**
+* @name mskunary2d
+* @memberof ns
+* @readonly
+* @type {Function}
+* @see {@link module:@stdlib/array/base/mskunary2d}
+*/
+setReadOnly( ns, 'mskunary2d', require( './../../base/mskunary2d' ) );
+
/**
* @name nCartesianProduct
* @memberof ns
diff --git a/base/mskunary2d/README.md b/base/mskunary2d/README.md
new file mode 100644
index 00000000..2d1305a2
--- /dev/null
+++ b/base/mskunary2d/README.md
@@ -0,0 +1,124 @@
+
+
+# mskunary2d
+
+> Apply a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assign results to elements in a two-dimensional nested output array.
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var mskunary2d = require( '@stdlib/array/base/mskunary2d' );
+```
+
+#### mskunary2d( arrays, shape, fcn )
+
+Applies a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array.
+
+```javascript
+var abs = require( '@stdlib/math/base/special/abs' );
+
+var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ];
+var mask = [ [ 0, 1 ], [ 0, 0 ] ];
+
+var shape = [ 2, 2 ];
+
+// Compute the absolute values in-place:
+mskunary2d( [ x, mask, x ], shape, abs );
+// x => [ [ 1.0, -2.0 ], [ 3.0, 4.0 ] ]
+```
+
+The function accepts the following arguments:
+
+- **arrays**: array-like object containing one input nested array, an input nested mask array, and one output nested array.
+- **shape**: array shape.
+- **fcn**: unary function to apply.
+
+
+
+
+
+
+
+## Notes
+
+- The function assumes that the input and output arrays have the same shape.
+- An element in an input array is "masked" if the corresponding element in the mask array is non-zero.
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
+var bernoulli = require( '@stdlib/random/base/bernoulli' ).factory;
+var filled2dBy = require( '@stdlib/array/base/filled2d-by' );
+var zeros2d = require( '@stdlib/array/base/zeros2d' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var mskunary2d = require( '@stdlib/array/base/mskunary2d' );
+
+var shape = [ 3, 3 ];
+
+var x = filled2dBy( shape, discreteUniform( -100, 100 ) );
+console.log( x );
+
+var mask = filled2dBy( shape, bernoulli( 0.5 ) );
+console.log( mask );
+
+var y = zeros2d( shape );
+console.log( y );
+
+mskunary2d( [ x, mask, y ], shape, abs );
+console.log( y );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/base/mskunary2d/benchmark/benchmark.js b/base/mskunary2d/benchmark/benchmark.js
new file mode 100644
index 00000000..3bd3e03f
--- /dev/null
+++ b/base/mskunary2d/benchmark/benchmark.js
@@ -0,0 +1,119 @@
+/**
+* @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 bernoulli = require( '@stdlib/random/base/bernoulli' ).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 identity = require( '@stdlib/math/base/special/identity' );
+var filled2dBy = require( './../../../base/filled2d-by' );
+var zeros2d = require( './../../../base/zeros2d' );
+var numel = require( '@stdlib/ndarray/base/numel' );
+var pkg = require( './../package.json' ).name;
+var mskunary2d = require( './../lib' );
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveIntegerArray} shape - array shape
+* @returns {Function} benchmark function
+*/
+function createBenchmark( shape ) {
+ var arrays;
+ var x;
+ var m;
+ var y;
+
+ x = filled2dBy( shape, uniform( -100.0, 100.0 ) );
+ m = filled2dBy( shape, bernoulli( 0.5 ) );
+ y = zeros2d( shape );
+
+ arrays = [ x, m, y ];
+
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var i0;
+ var i1;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ mskunary2d( arrays, shape, identity );
+ i1 = i % shape[ 0 ];
+ i0 = i % shape[ 1 ];
+ if ( isnan( arrays[ 2 ][ i1 ][ i0 ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+
+ i1 = i % shape[ 0 ];
+ i0 = i % shape[ 1 ];
+ if ( isnan( arrays[ 2 ][ 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/2.0 ) );
+ sh = [ N, N ];
+ f = createBenchmark( sh );
+ bench( pkg+'::square_matrix:size='+numel( sh ), f );
+ }
+}
+
+main();
diff --git a/base/mskunary2d/docs/repl.txt b/base/mskunary2d/docs/repl.txt
new file mode 100644
index 00000000..d7522cc5
--- /dev/null
+++ b/base/mskunary2d/docs/repl.txt
@@ -0,0 +1,34 @@
+
+{{alias}}( arrays, shape, fcn )
+ Applies a unary callback to elements in a two-dimensional nested input array
+ according to elements in a two-dimensional nested mask array and assigns
+ results to elements in a two-dimensional nested output array.
+
+ An element in an input array is "masked" if the corresponding element in the
+ mask array is non-zero.
+
+ Parameters
+ ----------
+ arrays: ArrayLikeObject
+ Array-like object containing one input nested array, an input nested
+ mask array, and one output nested array.
+
+ shape: Array
+ Array shape.
+
+ fcn: Function
+ Unary callback.
+
+ Examples
+ --------
+ > var x = [ [ -1.0, -2.0 ], [ -3.0, -4.0 ] ];
+ > var m = [ [ 0, 1 ], [ 0, 0 ] ];
+ > var y = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ];
+ > var shape = [ 2, 2 ];
+ > {{alias}}( [ x, m, y ], shape, {{alias:@stdlib/math/base/special/abs}} );
+ > y
+ [ [ 1.0, 0.0 ], [ 3.0, 4.0 ] ]
+
+ See Also
+ --------
+
diff --git a/base/mskunary2d/docs/types/index.d.ts b/base/mskunary2d/docs/types/index.d.ts
new file mode 100644
index 00000000..e922ea45
--- /dev/null
+++ b/base/mskunary2d/docs/types/index.d.ts
@@ -0,0 +1,70 @@
+/*
+* @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 { Array2D } from '@stdlib/types/array';
+import { Shape2D } from '@stdlib/types/ndarray';
+
+/**
+* Unary callback.
+*
+* @param value - input value
+* @returns result
+*/
+type Unary = ( value: T ) => U;
+
+/**
+* Applies a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array.
+*
+* ## Notes
+*
+* - The function assumes that the input and output arrays have the same shape.
+*
+* @param arrays - array containing one input nested array, an input nested mask array, and one output nested array
+* @param shape - array shape
+* @param fcn - unary callback
+*
+* @example
+* var ones2d = require( `@stdlib/array/base/ones2d` );
+* var zeros2d = require( `@stdlib/array/base/zeros2d` );
+*
+* function scale( x ) {
+* return x * 10.0;
+* }
+*
+* var shape = [ 2, 2 ];
+*
+* var x = ones2d( shape );
+* var y = zeros2d( shape );
+*
+* var mask = [ [ 0, 1 ], [ 0, 0 ] ];
+*
+* mskunary2d( [ x, mask, y ], shape, scale );
+*
+* console.log( y );
+* // => [ [ 10.0, 0.0 ], [ 10.0, 10.0 ] ]
+*/
+declare function mskunary2d( arrays: [ Array2D, Array2D, Array2D ], shape: Shape2D, fcn: Unary ): void;
+
+
+// EXPORTS //
+
+export = mskunary2d;
diff --git a/base/mskunary2d/docs/types/test.ts b/base/mskunary2d/docs/types/test.ts
new file mode 100644
index 00000000..e48e4800
--- /dev/null
+++ b/base/mskunary2d/docs/types/test.ts
@@ -0,0 +1,95 @@
+/*
+* @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 mskunary2d = require( './index' );
+
+/**
+* Unary function.
+*
+* @param value - input value
+* @returns result
+*/
+function fcn( value: number ): number {
+ return value;
+}
+
+
+// TESTS //
+
+// The function returns undefined...
+{
+ const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ];
+ const m = [ [ 0, 1 ], [ 0, 0 ] ];
+ const y = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ];
+
+ mskunary2d( [ x, m, y ], [ 2, 2 ], fcn ); // $ExpectType void
+}
+
+// The compiler throws an error if the function is provided a first argument which is not an array of nested arrays...
+{
+ mskunary2d( 'abc', [ 2, 2 ], fcn ); // $ExpectError
+ mskunary2d( 3.14, [ 2, 2 ], fcn ); // $ExpectError
+ mskunary2d( true, [ 2, 2 ], fcn ); // $ExpectError
+ mskunary2d( false, [ 2, 2 ], fcn ); // $ExpectError
+ mskunary2d( null, [ 2, 2 ], fcn ); // $ExpectError
+ mskunary2d( [ '1' ], [ 2, 2 ], fcn ); // $ExpectError
+ mskunary2d( {}, [ 2, 2 ], fcn ); // $ExpectError
+ mskunary2d( ( x: number ): number => x, [ 2, 2 ], fcn ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not an array of numbers...
+{
+ const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ];
+ const m = [ [ 0, 1 ], [ 0, 0 ] ];
+ const y = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ];
+
+ mskunary2d( [ x, m, y ], 'abc', fcn ); // $ExpectError
+ mskunary2d( [ x, m, y ], 3.14, fcn ); // $ExpectError
+ mskunary2d( [ x, m, y ], true, fcn ); // $ExpectError
+ mskunary2d( [ x, m, y ], false, fcn ); // $ExpectError
+ mskunary2d( [ x, m, y ], null, fcn ); // $ExpectError
+ mskunary2d( [ x, m, y ], [ '1' ], fcn ); // $ExpectError
+ mskunary2d( [ x, m, y ], {}, fcn ); // $ExpectError
+ mskunary2d( [ x, m, y ], ( x: number ): number => x, fcn ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a third argument which is not a valid callback...
+{
+ const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ];
+ const m = [ [ 0, 1 ], [ 0, 0 ] ];
+ const y = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ];
+
+ mskunary2d( [ x, m, y ], [ 2, 2 ], 'abc' ); // $ExpectError
+ mskunary2d( [ x, m, y ], [ 2, 2 ], 3.14 ); // $ExpectError
+ mskunary2d( [ x, m, y ], [ 2, 2 ], true ); // $ExpectError
+ mskunary2d( [ x, m, y ], [ 2, 2 ], false ); // $ExpectError
+ mskunary2d( [ x, m, y ], [ 2, 2 ], null ); // $ExpectError
+ mskunary2d( [ x, m, y ], [ 2, 2 ], [ '1' ] ); // $ExpectError
+ mskunary2d( [ x, m, y ], [ 2, 2 ], {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ];
+ const m = [ [ 0, 1 ], [ 0, 0 ] ];
+ const y = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ];
+
+ mskunary2d(); // $ExpectError
+ mskunary2d( [ x, m, y ] ); // $ExpectError
+ mskunary2d( [ x, m, y ], [ 2, 2 ], fcn, {} ); // $ExpectError
+}
diff --git a/base/mskunary2d/examples/index.js b/base/mskunary2d/examples/index.js
new file mode 100644
index 00000000..d07fd623
--- /dev/null
+++ b/base/mskunary2d/examples/index.js
@@ -0,0 +1,40 @@
+/**
+* @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 bernoulli = require( '@stdlib/random/base/bernoulli' ).factory;
+var filled2dBy = require( './../../../base/filled2d-by' );
+var zeros2d = require( './../../../base/zeros2d' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var mskunary2d = require( './../lib' );
+
+var shape = [ 3, 3 ];
+
+var x = filled2dBy( shape, discreteUniform( -100, 100 ) );
+console.log( x );
+
+var mask = filled2dBy( shape, bernoulli( 0.5 ) );
+console.log( mask );
+
+var y = zeros2d( shape );
+console.log( y );
+
+mskunary2d( [ x, mask, y ], shape, abs );
+console.log( y );
diff --git a/base/mskunary2d/lib/index.js b/base/mskunary2d/lib/index.js
new file mode 100644
index 00000000..517fe6c1
--- /dev/null
+++ b/base/mskunary2d/lib/index.js
@@ -0,0 +1,55 @@
+/**
+* @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';
+
+/**
+* Apply a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assign results to elements in a two-dimensional nested output array.
+*
+* @module @stdlib/array/base/mskunary2d
+*
+* @example
+* var ones2d = require( '@stdlib/array/base/ones2d' );
+* var zeros2d = require( '@stdlib/array/base/zeros2d' );
+* var mskunary2d = require( '@stdlib/array/base/mskunary2d' );
+*
+* function scale( x ) {
+* return x * 10.0;
+* }
+*
+* var shape = [ 2, 2 ];
+*
+* var x = ones2d( shape );
+* var y = zeros2d( shape );
+*
+* var mask = [ [ 0, 1 ], [ 0, 0 ] ];
+*
+* mskunary2d( [ x, mask, y ], shape, scale );
+*
+* console.log( y );
+* // => [ [ 10.0, 0.0 ], [ 10.0, 10.0 ] ]
+*/
+
+// MODULES //
+
+var main = require( './main.js' );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/base/mskunary2d/lib/main.js b/base/mskunary2d/lib/main.js
new file mode 100644
index 00000000..d9c56b91
--- /dev/null
+++ b/base/mskunary2d/lib/main.js
@@ -0,0 +1,90 @@
+/**
+* @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';
+
+// MAIN //
+
+/**
+* Applies a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array.
+*
+* ## Notes
+*
+* - The function assumes that the input and output arrays have the same shape.
+*
+* @param {ArrayLikeObject>} arrays - array-like object containing one input nested array, an input nested mask array, and one output nested array
+* @param {NonNegativeIntegerArray} shape - array shape
+* @param {Callback} fcn - unary callback
+* @returns {void}
+*
+* @example
+* var ones2d = require( '@stdlib/array/base/ones2d' );
+* var zeros2d = require( '@stdlib/array/base/zeros2d' );
+*
+* function scale( x ) {
+* return x * 10.0;
+* }
+*
+* var shape = [ 2, 2 ];
+*
+* var x = ones2d( shape );
+* var y = zeros2d( shape );
+*
+* var mask = [ [ 0, 1 ], [ 0, 0 ] ];
+*
+* mskunary2d( [ x, mask, y ], shape, scale );
+*
+* console.log( y );
+* // => [ [ 10.0, 0.0 ], [ 10.0, 10.0 ] ]
+*/
+function mskunary2d( arrays, shape, fcn ) {
+ var S0;
+ var S1;
+ var i0;
+ var i1;
+ var x0;
+ var y0;
+ var m0;
+ var x;
+ var y;
+ var m;
+
+ S0 = shape[ 1 ];
+ S1 = shape[ 0 ];
+ if ( S0 <= 0 || S1 <= 0 ) {
+ return;
+ }
+ x = arrays[ 0 ];
+ y = arrays[ 2 ];
+ m = arrays[ 1 ];
+ for ( i1 = 0; i1 < S1; i1++ ) {
+ x0 = x[ i1 ];
+ y0 = y[ i1 ];
+ m0 = m[ i1 ];
+ for ( i0 = 0; i0 < S0; i0++ ) {
+ if ( m0[ i0 ] === 0 ) {
+ y0[ i0 ] = fcn( x0[ i0 ] );
+ }
+ }
+ }
+}
+
+
+// EXPORTS //
+
+module.exports = mskunary2d;
diff --git a/base/mskunary2d/package.json b/base/mskunary2d/package.json
new file mode 100644
index 00000000..dddd7404
--- /dev/null
+++ b/base/mskunary2d/package.json
@@ -0,0 +1,73 @@
+{
+ "name": "@stdlib/array/base/mskunary2d",
+ "version": "0.0.0",
+ "description": "Apply a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assign results to elements in a two-dimensional nested output 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",
+ "base",
+ "array",
+ "multidimensional",
+ "ndarray",
+ "matrix",
+ "2d",
+ "unary",
+ "apply",
+ "foreach",
+ "map",
+ "transform",
+ "masked",
+ "mask",
+ "skip",
+ "skipped",
+ "missing",
+ "missing values",
+ "na"
+ ],
+ "__stdlib__": {}
+}
diff --git a/base/mskunary2d/test/test.js b/base/mskunary2d/test/test.js
new file mode 100644
index 00000000..16c57114
--- /dev/null
+++ b/base/mskunary2d/test/test.js
@@ -0,0 +1,144 @@
+/**
+* @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 abs = require( '@stdlib/math/base/special/abs' );
+var zeros2d = require( './../../../base/zeros2d' );
+var mskunary2d = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof mskunary2d, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function applies a provided callback to a nested input array and assigns results to a nested output array', function test( t ) {
+ var expected;
+ var shape;
+ var x;
+ var y;
+ var m;
+
+ shape = [ 2, 2 ];
+ x = [
+ [ -1.0, -2.0 ],
+ [ -3.0, -4.0 ]
+ ];
+ m = [
+ [ 0, 1 ],
+ [ 0, 0 ]
+ ];
+
+ expected = [
+ [ 1.0, 0.0 ],
+ [ 3.0, 4.0 ]
+ ];
+
+ y = zeros2d( shape );
+ mskunary2d( [ x, m, y ], shape, abs );
+
+ t.deepEqual( y, expected, 'returns expected value' );
+
+ shape = [ 2, 2 ];
+ x = [
+ [ -1.0, -2.0 ],
+ [ -3.0, -4.0 ]
+ ];
+ m = [
+ [ 1, 0 ],
+ [ 1, 0 ]
+ ];
+
+ expected = [
+ [ 0.0, 2.0 ],
+ [ 0.0, 4.0 ]
+ ];
+
+ y = zeros2d( shape );
+ mskunary2d( [ x, m, y ], shape, abs );
+
+ t.deepEqual( y, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function does not invoke a provided callback if provided a shape having a first element equal to zero', function test( t ) {
+ var expected;
+ var shape;
+ var x;
+ var y;
+ var m;
+
+ shape = [ 2, 2 ];
+ x = [
+ [ -1.0, -2.0 ],
+ [ -3.0, -4.0 ]
+ ];
+ m = [
+ [ 0, 1 ],
+ [ 0, 0 ]
+ ];
+
+ expected = zeros2d( shape );
+
+ y = zeros2d( shape );
+ mskunary2d( [ x, m, y ], [ 0, 2 ], clbk );
+
+ t.deepEqual( y, expected, 'returns expected value' );
+ t.end();
+
+ function clbk() {
+ t.ok( false, 'should not invoke callback' );
+ }
+});
+
+tape( 'the function does not invoke a provided callback if provided a shape having a second element equal to zero', function test( t ) {
+ var expected;
+ var shape;
+ var x;
+ var y;
+ var m;
+
+ shape = [ 2, 2 ];
+ x = [
+ [ -1.0, -2.0 ],
+ [ -3.0, -4.0 ]
+ ];
+ m = [
+ [ 0, 1 ],
+ [ 0, 0 ]
+ ];
+
+ expected = zeros2d( shape );
+
+ y = zeros2d( shape );
+ mskunary2d( [ x, m, y ], [ 2, 0 ], clbk );
+
+ t.deepEqual( y, expected, 'returns expected value' );
+ t.end();
+
+ function clbk() {
+ t.ok( false, 'should not invoke callback' );
+ }
+});
diff --git a/dist/index.js b/dist/index.js
index 291c13d3..ae8ab578 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 ai=l(function(CC,ii){"use strict";var ti="function";function i1(r){return typeof r.get===ti&&typeof r.set===ti}ii.exports=i1});var U=l(function(jC,ni){"use strict";var a1=ai();ni.exports=a1});var si=l(function(kC,oi){"use strict";var ui={float64:n1,float32:u1,int32:o1,int16:s1,int8:v1,uint32:l1,uint16:f1,uint8:c1,uint8c:m1,generic:p1,default:g1};function n1(r,e){return r[e]}function u1(r,e){return r[e]}function o1(r,e){return r[e]}function s1(r,e){return r[e]}function v1(r,e){return r[e]}function l1(r,e){return r[e]}function f1(r,e){return r[e]}function c1(r,e){return r[e]}function m1(r,e){return r[e]}function p1(r,e){return r[e]}function g1(r,e){return r[e]}function y1(r){var e=ui[r];return typeof e=="function"?e:ui.default}oi.exports=y1});var Y=l(function(VC,vi){"use strict";var d1=si();vi.exports=d1});var ci=l(function(_C,fi){"use strict";var li={float64:q1,float32:h1,int32:x1,int16:w1,int8:b1,uint32:A1,uint16:E1,uint8:T1,uint8c:S1,generic:C1,default:j1};function q1(r,e,t){r[e]=t}function h1(r,e,t){r[e]=t}function x1(r,e,t){r[e]=t}function w1(r,e,t){r[e]=t}function b1(r,e,t){r[e]=t}function A1(r,e,t){r[e]=t}function E1(r,e,t){r[e]=t}function T1(r,e,t){r[e]=t}function S1(r,e,t){r[e]=t}function C1(r,e,t){r[e]=t}function j1(r,e,t){r[e]=t}function k1(r){var e=li[r];return typeof e=="function"?e:li.default}fi.exports=k1});var $r=l(function(IC,mi){"use strict";var V1=ci();mi.exports=V1});var yi=l(function(LC,gi){"use strict";var pi={complex128:_1,complex64:I1,default:L1};function _1(r,e){return r.get(e)}function I1(r,e){return r.get(e)}function L1(r,e){return r.get(e)}function O1(r){var e=pi[r];return typeof e=="function"?e:pi.default}gi.exports=O1});var z=l(function(OC,di){"use strict";var F1=yi();di.exports=F1});var xi=l(function(FC,hi){"use strict";var qi={complex128:R1,complex64:B1,default:N1};function R1(r,e,t){r.set(t,e)}function B1(r,e,t){r.set(t,e)}function N1(r,e,t){r.set(t,e)}function M1(r){var e=qi[r];return typeof e=="function"?e:qi.default}hi.exports=M1});var Qr=l(function(RC,wi){"use strict";var P1=xi();wi.exports=P1});var Ai=l(function(BC,bi){"use strict";var U1={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"};bi.exports=U1});var Ti=l(function(NC,Ei){"use strict";var z1=typeof Float64Array=="function"?Float64Array:void 0;Ei.exports=z1});var Ci=l(function(MC,Si){"use strict";function D1(){throw new Error("not implemented")}Si.exports=D1});var er=l(function(PC,ji){"use strict";var Y1=require("@stdlib/assert/has-float64array-support"),G1=Ti(),W1=Ci(),Be;Y1()?Be=G1:Be=W1;ji.exports=Be});var Vi=l(function(UC,ki){"use strict";var Z1=typeof Float32Array=="function"?Float32Array:void 0;ki.exports=Z1});var Ii=l(function(zC,_i){"use strict";function K1(){throw new Error("not implemented")}_i.exports=K1});var tr=l(function(DC,Li){"use strict";var X1=require("@stdlib/assert/has-float32array-support"),H1=Vi(),J1=Ii(),Ne;X1()?Ne=H1:Ne=J1;Li.exports=Ne});var Fi=l(function(YC,Oi){"use strict";var $1=typeof Uint32Array=="function"?Uint32Array:void 0;Oi.exports=$1});var Bi=l(function(GC,Ri){"use strict";function Q1(){throw new Error("not implemented")}Ri.exports=Q1});var nr=l(function(WC,Ni){"use strict";var rd=require("@stdlib/assert/has-uint32array-support"),ed=Fi(),td=Bi(),Me;rd()?Me=ed:Me=td;Ni.exports=Me});var Pi=l(function(ZC,Mi){"use strict";var id=typeof Int32Array=="function"?Int32Array:void 0;Mi.exports=id});var zi=l(function(KC,Ui){"use strict";function ad(){throw new Error("not implemented")}Ui.exports=ad});var ur=l(function(XC,Di){"use strict";var nd=require("@stdlib/assert/has-int32array-support"),ud=Pi(),od=zi(),Pe;nd()?Pe=ud:Pe=od;Di.exports=Pe});var Gi=l(function(HC,Yi){"use strict";var sd=typeof Uint16Array=="function"?Uint16Array:void 0;Yi.exports=sd});var Zi=l(function(JC,Wi){"use strict";function vd(){throw new Error("not implemented")}Wi.exports=vd});var or=l(function($C,Ki){"use strict";var ld=require("@stdlib/assert/has-uint16array-support"),fd=Gi(),cd=Zi(),Ue;ld()?Ue=fd:Ue=cd;Ki.exports=Ue});var Hi=l(function(QC,Xi){"use strict";var md=typeof Int16Array=="function"?Int16Array:void 0;Xi.exports=md});var $i=l(function(rj,Ji){"use strict";function pd(){throw new Error("not implemented")}Ji.exports=pd});var sr=l(function(ej,Qi){"use strict";var gd=require("@stdlib/assert/has-int16array-support"),yd=Hi(),dd=$i(),ze;gd()?ze=yd:ze=dd;Qi.exports=ze});var ea=l(function(tj,ra){"use strict";var qd=typeof Uint8Array=="function"?Uint8Array:void 0;ra.exports=qd});var ia=l(function(ij,ta){"use strict";function hd(){throw new Error("not implemented")}ta.exports=hd});var vr=l(function(aj,aa){"use strict";var xd=require("@stdlib/assert/has-uint8array-support"),wd=ea(),bd=ia(),De;xd()?De=wd:De=bd;aa.exports=De});var ua=l(function(nj,na){"use strict";var Ad=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;na.exports=Ad});var sa=l(function(uj,oa){"use strict";function Ed(){throw new Error("not implemented")}oa.exports=Ed});var lr=l(function(oj,va){"use strict";var Td=require("@stdlib/assert/has-uint8clampedarray-support"),Sd=ua(),Cd=sa(),Ye;Td()?Ye=Sd:Ye=Cd;va.exports=Ye});var fa=l(function(sj,la){"use strict";var jd=typeof Int8Array=="function"?Int8Array:void 0;la.exports=jd});var ma=l(function(vj,ca){"use strict";function kd(){throw new Error("not implemented")}ca.exports=kd});var fr=l(function(lj,pa){"use strict";var Vd=require("@stdlib/assert/has-int8array-support"),_d=fa(),Id=ma(),Ge;Vd()?Ge=_d:Ge=Id;pa.exports=Ge});var ya=l(function(fj,ga){"use strict";var Ld=require("@stdlib/assert/is-array-like-object"),Od=require("@stdlib/assert/is-complex-like"),Fd=require("@stdlib/complex/realf"),Rd=require("@stdlib/complex/imagf"),Bd=require("@stdlib/string/format");function Nd(r){var e,t,i;for(e=[];t=r.next(),!t.done;)if(i=t.value,Ld(i)&&i.length>=2)e.push(i[0],i[1]);else if(Od(i))e.push(Fd(i),Rd(i));else return new TypeError(Bd("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=Nd});var qa=l(function(cj,da){"use strict";var Md=require("@stdlib/assert/is-array-like-object"),Pd=require("@stdlib/assert/is-complex-like"),Ud=require("@stdlib/complex/realf"),zd=require("@stdlib/complex/imagf"),Dd=require("@stdlib/string/format");function Yd(r,e,t){var i,n,o,u;for(i=[],u=-1;n=r.next(),!n.done;)if(u+=1,o=e.call(t,n.value,u),Md(o)&&o.length>=2)i.push(o[0],o[1]);else if(Pd(o))i.push(Ud(o),zd(o));else return new TypeError(Dd("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return i}da.exports=Yd});var xa=l(function(mj,ha){"use strict";var Gd=require("@stdlib/assert/is-complex-like"),Wd=require("@stdlib/complex/realf"),Zd=require("@stdlib/complex/imagf");function Kd(r,e){var t,i,n,o;for(t=e.length,o=0,n=0;nt.byteLength-r)throw new RangeError(V("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*K));t=new $(t,r,i*2)}}return G(this,"_buffer",t),G(this,"_length",t.length/2),this}G(F,"BYTES_PER_ELEMENT",K);G(F,"name","Complex64Array");G(F,"from",function(e){var t,i,n,o,u,a,s,v,f,m,c,p;if(!br(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ca(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(n=arguments[1],!br(n))throw new TypeError(V("invalid argument. Second argument must be a function. Value: `%s`.",n));i>2&&(t=arguments[2])}if(Ir(e)){if(v=e.length,n){for(o=new this(v),u=o._buffer,p=0,c=0;c=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return o}return new this(e)}if(Ze(e)){if(n){for(v=e.length,e.get&&e.set?s=rq("default"):s=Qd("default"),c=0;c=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return o}return new this(e)}if(Aa(e)&&Sa&&br(e[_r])){if(u=e[_r](),!br(u.next))throw new TypeError(V("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(n?a=eq(u,n,t):a=Ta(u),a instanceof Error)throw a;for(v=a.length/2,o=new this(v),u=o._buffer,c=0;c=n?{done:!0}:(a+=2,m=new Ea(e[a],e[a+1]),{value:[u,m],done:!1})}function v(m){return o=!0,arguments.length?{value:m,done:!0}:{done:!0}}function f(){return t.entries()}});G(F.prototype,"get",function(e){var t;if(!Ir(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Dr(e))throw new TypeError(V("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return t=this._buffer,e*=2,new Ea(t[e],t[e+1])});ie(F.prototype,"length",function(){return this._length});G(F.prototype,"set",function(e){var t,i,n,o,u,a,s,v,f;if(!Ir(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(i=arguments[1],!Dr(i))throw new TypeError(V("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(Vr(e)){if(i>=this._length)throw new RangeError(V("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,n[i]=ee(e),n[i+1]=te(e);return}if(Ir(e)){if(a=e._length,i+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=n.byteOffset+i*K,t.buffer===n.buffer&&t.byteOffsetf){for(o=new $(t.length),v=0;vthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=n.byteOffset+i*K,t.buffer===n.buffer&&t.byteOffsetf){for(o=new $(a),v=0;vthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,v=0;v=2)e.push(i[0],i[1]);else if(oq(i))e.push(vq(i),lq(i));else return new TypeError(sq("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}_a.exports=fq});var Oa=l(function(dj,La){"use strict";var cq=require("@stdlib/assert/is-array-like-object"),mq=require("@stdlib/assert/is-complex-like"),pq=require("@stdlib/string/format"),gq=require("@stdlib/complex/real"),yq=require("@stdlib/complex/imag");function dq(r,e,t){var i,n,o,u;for(i=[],u=-1;n=r.next(),!n.done;)if(u+=1,o=e.call(t,n.value,u),cq(o)&&o.length>=2)i.push(o[0],o[1]);else if(mq(o))i.push(gq(o),yq(o));else return new TypeError(pq("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return i}La.exports=dq});var Ra=l(function(qj,Fa){"use strict";var qq=require("@stdlib/assert/is-complex-like"),hq=require("@stdlib/complex/real"),xq=require("@stdlib/complex/imag");function wq(r,e){var t,i,n,o;for(t=e.length,o=0,n=0;nt.byteLength-r)throw new RangeError(_("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*X));t=new Q(t,r,i*2)}}return W(this,"_buffer",t),W(this,"_length",t.length/2),this}W(R,"BYTES_PER_ELEMENT",X);W(R,"name","Complex128Array");W(R,"from",function(e){var t,i,n,o,u,a,s,v,f,m,c,p;if(!Ar(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(n=arguments[1],!Ar(n))throw new TypeError(_("invalid argument. Second argument must be a function. Value: `%s`.",n));i>2&&(t=arguments[2])}if(Fr(e)){if(v=e.length,n){for(o=new this(v),u=o._buffer,p=0,c=0;c=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(_("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return o}return new this(e)}if(Xe(e)){if(n){for(v=e.length,e.get&&e.set?s=Cq("default"):s=Sq("default"),c=0;c=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(_("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return o}return new this(e)}if(Ma(e)&&za&&Ar(e[Or])){if(u=e[Or](),!Ar(u.next))throw new TypeError(_("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(n?a=jq(u,n,t):a=Ua(u),a instanceof Error)throw a;for(v=a.length/2,o=new this(v),u=o._buffer,c=0;c=n?{done:!0}:(a+=2,m=new Pa(e[a],e[a+1]),{value:[u,m],done:!1})}function v(m){return o=!0,arguments.length?{value:m,done:!0}:{done:!0}}function f(){return t.entries()}});W(R.prototype,"get",function(e){var t;if(!Fr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(_("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return t=this._buffer,e*=2,new Pa(t[e],t[e+1])});oe(R.prototype,"length",function(){return this._length});W(R.prototype,"set",function(e){var t,i,n,o,u,a,s,v,f;if(!Fr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(i=arguments[1],!Yr(i))throw new TypeError(_("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(Lr(e)){if(i>=this._length)throw new RangeError(_("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,n[i]=ne(e),n[i+1]=ue(e);return}if(Fr(e)){if(a=e._length,i+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=n.byteOffset+i*X,t.buffer===n.buffer&&t.byteOffsetf){for(o=new Q(t.length),v=0;vthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=n.byteOffset+i*X,t.buffer===n.buffer&&t.byteOffsetf){for(o=new Q(a),v=0;vthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,v=0;v=0;v--)if(f=a-u+v,!(f<0)){if(s=e[f],n=t[v],n!==0&&n=0;v--)a=f%u,f-=a,f/=u,n[v]=a;for(i=[],v=0;v=0;c--)f=p%i[c],p-=f,p/=i[c],s[c]=f;for(u=[],c=0;c2){if(arguments.length===3?Tf(t)?n=t:(o=t,u=!1):(n=i,o=t),o===0)return[];if(!o6(o)||o<0)throw new TypeError(Sr("invalid argument. Length must be a positive integer. Value: `%s`.",o));if(u){if(!Tf(n))throw new TypeError(Sr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(u6(n,"round")){if(!s6(n.round))throw new TypeError(Sr("invalid option. `%s` option must be a string. Option: `%s`.","round",n.round));if(Sf.indexOf(n.round)===-1)throw new Error(Sr('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"round",Sf.join('", "'),n.round))}}}switch(n.round){case"round":v=l6;break;case"ceil":v=f6;break;case"floor":default:v=v6;break}for(s=o-1,m=(e.getTime()-r.getTime())/s,a=new Array(o),f=r,a[0]=f,f=f.getTime(),c=1;c1?i=arguments[1]:i="float64",i==="generic")return M6(r);if(e=P6(i),e===null)throw new TypeError(Gf("invalid argument. Second argument must be a supported data type. Value: `%s`.",i));return n=N6(i),a=e*r,i==="complex128"&&(a+=8),o=B6(a),t=o.byteOffset,i==="complex128"&&(Yf(t/e)||(t+=8)),u=new n(o.buffer,t,r),u}Wf.exports=U6});var Hf=l(function(D_,Xf){"use strict";var z6=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,D6=Tr(),Y6=qr(),Kf=require("@stdlib/string/format");function G6(r){var e,t;if(!z6(r))throw new TypeError(Kf("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(arguments.length>1?e=arguments[1]:e="float64",e==="generic")return Y6(r);if(t=D6(e),t===null)throw new TypeError(Kf("invalid argument. Second argument must be a recognized data type. Value: `%s`.",e));return new t(r)}Xf.exports=G6});var pe=l(function(Y_,Jf){"use strict";var W6=Hf();Jf.exports=W6});var rc=l(function(G_,Qf){"use strict";var $f=pe();function Z6(r){return arguments.length>1?$f(r,arguments[1]):$f(r)}Qf.exports=Z6});var qt=l(function(W_,ec){"use strict";var K6=Nf(),X6=Zf(),H6=rc(),dt;K6()?dt=X6:dt=H6;ec.exports=dt});var ic=l(function(Z_,tc){"use strict";var J6=k(),$6=qt(),Q6=require("@stdlib/string/format");function r3(r){var e=J6(r);if(e===null)throw new TypeError(Q6("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]),$6(r.length,e)}tc.exports=r3});var nc=l(function(K_,ac){"use strict";var e3=ic();ac.exports=e3});var fc=l(function(X_,lc){"use strict";var t3=require("@stdlib/assert/is-string").isPrimitive,uc=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,oc=require("@stdlib/assert/is-collection"),ht=require("@stdlib/assert/is-arraybuffer"),sc=require("@stdlib/assert/is-object"),ge=require("@stdlib/assert/is-function"),i3=Tr(),a3=require("@stdlib/blas/ext/base/gfill"),n3=ir(),u3=require("@stdlib/assert/has-iterator-symbol-support"),ye=require("@stdlib/symbol/iterator"),o3=require("@stdlib/iter/length"),mr=require("@stdlib/string/format"),vc=u3();function s3(r,e){var t,i;for(t=[];i=r.next(),!i.done;)t.push(e);return t}function v3(r,e){var t;for(t=0;t=0&&t3(arguments[e])?(t=arguments[e],e-=1):t="float64",i=i3(t),i===null)throw new TypeError(mr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(e<=0)return[];if(r=arguments[0],u=arguments[1],e===1){if(uc(u)?o=u:oc(u)&&(o=u.length),o!==void 0)return n3(r,o);if(ht(u))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(sc(u)){if(vc===!1)throw new TypeError(mr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",u));if(!ge(u[ye]))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));if(u=u[ye](),!ge(u.next))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));return s3(u,r)}throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u))}else if(ht(u))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u))}if(e<=0)return new i(0);if(e===1)if(u=arguments[1],oc(u))n=new i(u.length);else if(ht(u))n=new i(u);else if(uc(u))n=new i(u);else if(sc(u)){if(vc===!1)throw new TypeError(mr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",u));if(!ge(u[ye]))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));if(u=u[ye](),!ge(u.next))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));n=new i(o3(u))}else throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));else e===2?n=new i(arguments[1],arguments[2]):n=new i(arguments[1],arguments[2],arguments[3]);return n.length>0&&(/^complex/.test(t)?v3(n,arguments[0]):a3(n.length,arguments[0],n,1)),n}lc.exports=l3});var mc=l(function(H_,cc){"use strict";var f3=fc();cc.exports=f3});var wc=l(function(J_,xc){"use strict";var pc=require("@stdlib/assert/is-string").isPrimitive,gc=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yc=require("@stdlib/assert/is-collection"),xt=require("@stdlib/assert/is-arraybuffer"),dc=require("@stdlib/assert/is-object"),Cr=require("@stdlib/assert/is-function"),wt=Tr(),c3=require("@stdlib/blas/ext/base/gfill-by"),m3=et(),p3=require("@stdlib/assert/has-iterator-symbol-support"),de=require("@stdlib/symbol/iterator"),g3=require("@stdlib/iter/length"),rr=require("@stdlib/string/format"),qc=p3(),hc="float64";function y3(r,e,t){var i,n,o;for(i=[],n=-1;o=r.next(),!o.done;)n+=1,i.push(e.call(t,n));return i}function d3(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(n=wt(t),n===null)throw new TypeError(rr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));return new n(0)}if(e<2)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(e-=1,Cr(arguments[e]))if(Cr(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],!Cr(i))throw new TypeError(rr("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&&pc(arguments[e])?(t=arguments[e],e-=1):t=hc,n=wt(t),n===null)throw new TypeError(rr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(a=arguments[0],e===0){if(gc(a)?u=a:yc(a)&&(u=a.length),u!==void 0)return m3(u,i,r);if(xt(a))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(dc(a)){if(qc===!1)throw new TypeError(rr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",a));if(!Cr(a[de]))throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));if(a=a[de](),!Cr(a.next))throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));return y3(a,i,r)}throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a))}else if(xt(a))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a))}if(e===0)if(a=arguments[0],yc(a))o=new n(a.length);else if(xt(a))o=new n(a);else if(gc(a))o=new n(a);else if(dc(a)){if(qc===!1)throw new TypeError(rr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",a));if(!Cr(a[de]))throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));if(a=a[de](),!Cr(a.next))throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));o=new n(g3(a))}else throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));else e===1?o=new n(arguments[0],arguments[1]):o=new n(arguments[0],arguments[1],arguments[2]);return o.length>0&&(/^complex/.test(t)?d3(o,i,r):c3(o.length,o,1,s)),o;function s(v,f){return i.call(r,f)}}xc.exports=q3});var Ac=l(function($_,bc){"use strict";var h3=wc();bc.exports=h3});var Sc=l(function(Q_,Tc){"use strict";var Ec=require("@stdlib/assert/is-function"),x3=require("@stdlib/assert/is-collection"),w3=require("@stdlib/assert/is-iterator-like"),b3=U(),A3=Qr(),E3=$r(),T3=k(),bt=require("@stdlib/string/format");function S3(){var r,e,t,i,n,o,u,a,s;if(r=arguments[0],arguments.length>1)if(x3(arguments[1])){if(i=arguments[1],arguments.length>2){if(t=arguments[2],!Ec(t))throw new TypeError(bt("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[3]}}else{if(t=arguments[1],!Ec(t))throw new TypeError(bt("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[2]}if(!w3(r))throw new TypeError(bt("invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `%s`.",r));if(a=-1,i===void 0){if(i=[],t){for(;a+=1,s=r.next(),!s.done;)i.push(t.call(e,s.value,a));return i}for(;s=r.next(),!s.done;)i.push(s.value);return i}if(n=i.length,u=T3(i),b3(i)?o=A3(u):o=E3(u),t){for(;a2?t=arguments[2]:t="float64",t==="generic")return V3(e,r);if(i=k3(t),i===null)throw new TypeError(kc("invalid argument. Third argument must be a recognized data type. Value: `%s`.",t));return n=new i(r),_3(r,e,n,1),n}Vc.exports=I3});var jr=l(function(tI,Ic){"use strict";var L3=_c();Ic.exports=L3});var Oc=l(function(iI,Lc){"use strict";var O3=require("@stdlib/string/format"),F3=k(),R3=jr(),B3=require("@stdlib/complex/float64"),N3=require("@stdlib/complex/float32");function M3(r,e){var t,i;if(t=F3(r),t===null)throw new TypeError(O3("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 B3(e,0):t==="complex64"?i=new N3(e,0):i=e:i=e,R3(r.length,i,t)}Lc.exports=M3});var Rc=l(function(aI,Fc){"use strict";var P3=Oc();Fc.exports=P3});var Nc=l(function(nI,Bc){"use strict";var U3=require("@stdlib/math/base/special/ceil"),At=require("@stdlib/assert/is-number").isPrimitive,Et=require("@stdlib/math/base/assert/is-nan"),Tt=require("@stdlib/string/format"),z3=require("@stdlib/constants/uint32/max"),D3=ut();function Y3(r,e,t){var i,n;if(!At(r)||Et(r))throw new TypeError(Tt("invalid argument. Start must be numeric. Value: `%s`.",r));if(!At(e)||Et(e))throw new TypeError(Tt("invalid argument. Stop must be numeric. Value: `%s`.",e));if(arguments.length<3)n=1;else if(n=t,!At(n)||Et(n))throw new TypeError(Tt("invalid argument. Increment must be numeric. Value: `%s`.",n));if(i=U3((e-r)/n),i>z3)throw new RangeError("invalid arguments. Generated array exceeds maximum array length.");return D3(r,e,n)}Bc.exports=Y3});var Pc=l(function(uI,Mc){"use strict";var G3=Nc();Mc.exports=G3});var zc=l(function(oI,Uc){"use strict";var W3=er(),Z3=tr(),K3=dr(),X3=yr(),H3={float64:W3,float32:Z3,complex128:K3,complex64:X3};Uc.exports=H3});var Yc=l(function(sI,Dc){"use strict";var J3=zc();function $3(r){return J3[r]||null}Dc.exports=$3});var St=l(function(vI,Gc){"use strict";var Q3=Yc();Gc.exports=Q3});var Zc=l(function(lI,Wc){"use strict";function r8(r,e,t,i){var n,o,u,a;if(t===0)return[];if(t===1)return i?[e]:[r];for(n=[r],i?o=t-1:o=t,u=(e-r)/o,a=1;a3&&(o=q8(i,arguments[3]),o))throw o;if(i.dtype==="generic")return v?y8(a,r,s,e,t,i.endpoint):g8(r,e,t,i.endpoint);if(n=c8(i.dtype),n===null)throw new TypeError(Br('invalid option. `%s` option must be a real or complex floating-point data type or "generic". Option: `%s`.',"dtype",i.dtype));if(u=new n(t),i.dtype==="complex64")return cm(m8(u,0),a,r,s,e,t,i.endpoint),u;if(i.dtype==="complex128")return cm(p8(u,0),a,r,s,e,t,i.endpoint),u;if(v)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 d8(u,r,e,t,i.endpoint)}mm.exports=x8});var xm=l(function(dI,hm){"use strict";var w8=require("@stdlib/complex/float32"),b8=require("@stdlib/complex/float64"),gm=require("@stdlib/complex/real"),ym=require("@stdlib/complex/imag"),dm=require("@stdlib/complex/realf"),qm=require("@stdlib/complex/imagf");function A8(r,e,t,i,n,o,u){var a,s,v,f,m,c,p,g,y,d,q,E,A,T;if(o===0)return r;if(s=0,e==="float64"?(v=t,m=0):e==="complex64"?(s+=1,v=dm(t),m=qm(t)):(v=gm(t),m=ym(t)),i==="float64"?(f=n,c=0):i==="complex64"?(s+=1,f=dm(n),c=qm(n)):(f=gm(n),c=ym(n)),s===2?a=w8:a=b8,g=r.data,p=r.accessors[1],o===1)return u?p(g,0,new a(f,c)):p(g,0,new a(v,m)),r;for(p(g,0,new a(v,m)),u?A=o-1:A=o,q=(f-v)/A,E=(c-m)/A,T=1;T3&&(n=I8(i,arguments[3]),n))throw n;if(s=S8(t),s===null&&(s="generic"),s==="complex64")return jm(C8(t,0),o,r,u,e,t.length,i.endpoint),t;if(s==="complex128")return jm(j8(t,0),o,r,u,e,t.length,i.endpoint),t;if(a){if(s==="generic")return v=Cm(t),k8(v,o,r,u,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 v=Cm(t),v.accessorProtocol?(V8(v,r,e,t.length,i.endpoint),t):(_8(t,r,e,t.length,i.endpoint),t)}km.exports=O8});var Lm=l(function(xI,Im){"use strict";var F8=require("@stdlib/utils/define-nonenumerable-read-only-property"),_m=pm(),R8=Vm();F8(_m,"assign",R8);Im.exports=_m});var Bm=l(function(wI,Rm){"use strict";var Om=require("@stdlib/assert/is-number").isPrimitive,B8=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,It=require("@stdlib/string/format"),Fm=require("@stdlib/math/base/assert/is-nan"),N8=st();function M8(r,e,t){if(!Om(r)||Fm(r))throw new TypeError(It("invalid argument. Exponent of start value must be numeric. Value: `%s`.",r));if(!Om(e)||Fm(e))throw new TypeError(It("invalid argument. Exponent of stop value must be numeric. Value: `%s`.",e));if(arguments.length<3)t=10;else if(!B8(t))throw new TypeError(It("invalid argument. Length must be a nonnegative integer. Value: `%s`.",t));return N8(r,e,t)}Rm.exports=M8});var Mm=l(function(bI,Nm){"use strict";var P8=Bm();Nm.exports=P8});var Gm=l(function(AI,Ym){"use strict";var Um=require("@stdlib/math/base/assert/is-integer"),U8=require("@stdlib/math/base/assert/is-negative-zero"),z8=require("@stdlib/assert/is-complex-like"),zm=require("@stdlib/constants/float64/pinf"),Dm=require("@stdlib/constants/float64/ninf"),qe=require("@stdlib/constants/float32/smallest-subnormal"),D8=require("@stdlib/constants/float32/max-safe-integer"),Y8=require("@stdlib/constants/float32/min-safe-integer"),G8=require("@stdlib/constants/int8/min"),W8=require("@stdlib/constants/int16/min"),Z8=require("@stdlib/constants/int32/min"),K8=require("@stdlib/constants/uint8/max"),X8=require("@stdlib/constants/uint16/max"),H8=require("@stdlib/constants/uint32/max");function Pm(r){return r!==r||r===zm||r===Dm?"float32":Um(r)?r>=Y8&&r<=D8?"float32":"float64":r>-qe&&r=G8?"int8":r>=W8?"int16":r>=Z8?"int32":"float64":r<=K8?"uint8":r<=X8?"uint16":r<=H8?"uint32":"float64":r>-qe&&r1){if(e=arguments[1],Km.indexOf(e)===-1)throw new TypeError(tA('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',Km.join('", "'),e))}else e="float64";return e==="complex128"?t=iA:e==="complex64"?t=aA:t=NaN,eA(r,t,e)}Xm.exports=nA});var $m=l(function(SI,Jm){"use strict";var uA=Hm();Jm.exports=uA});var rp=l(function(CI,Qm){"use strict";var oA=k(),sA=jr(),vA=require("@stdlib/complex/float64"),lA=require("@stdlib/complex/float32"),Lt=require("@stdlib/string/format"),fA=new vA(NaN,NaN),cA=new lA(NaN,NaN),he=["float64","float32","complex128","complex64","generic"];function mA(r){var e,t;if(e=oA(r),e===null)throw new TypeError(Lt("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],he.indexOf(e)===-1)throw new TypeError(Lt('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',he.join('", "'),e))}else if(he.indexOf(e)===-1)throw new TypeError(Lt('invalid argument. First argument must be one of the following data types: "%s". Value: `%s`.',he.join('", "'),e));return e==="complex128"?t=fA:e==="complex64"?t=cA:t=NaN,sA(r.length,t,e)}Qm.exports=mA});var tp=l(function(jI,ep){"use strict";var pA=rp();ep.exports=pA});var ip=l(function(kI,gA){gA.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 np=l(function(VI,ap){"use strict";var yA=require("@stdlib/utils/keys"),dA=require("@stdlib/assert/has-own-property"),xe=ip();function qA(){var r,e,t,i;for(t={},r=yA(xe),e=r.length,i=0;i1?e=arguments[1]:e="float64",e==="complex128"?t=EA:e==="complex64"?t=TA:t=1,AA(r,t,e)}sp.exports=SA});var fp=l(function(LI,lp){"use strict";var CA=vp();lp.exports=CA});var mp=l(function(OI,cp){"use strict";var jA=k(),kA=jr(),VA=require("@stdlib/complex/float64"),_A=require("@stdlib/complex/float32"),IA=require("@stdlib/string/format"),LA=new VA(1,0),OA=new _A(1,0);function FA(r){var e,t;if(e=jA(r),e===null)throw new TypeError(IA("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=LA:e==="complex64"?t=OA:t=1,kA(r.length,t,e)}cp.exports=FA});var gp=l(function(FI,pp){"use strict";var RA=mp();pp.exports=RA});var dp=l(function(RI,yp){"use strict";function BA(){return{highWaterMark:9007199254740992}}yp.exports=BA});var xp=l(function(BI,hp){"use strict";var NA=require("@stdlib/assert/is-plain-object"),MA=require("@stdlib/assert/has-own-property"),PA=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qp=require("@stdlib/string/format");function UA(r,e){return NA(e)?MA(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!PA(r.highWaterMark))?new TypeError(qp("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","highWaterMark",r.highWaterMark)):null:new TypeError(qp("invalid argument. Options argument must be an object. Value: `%s`.",e))}hp.exports=UA});var bp=l(function(NI,wp){"use strict";function zA(r){var e,t;for(e=[],t=0;ti.highWaterMark?null:(p=new QA(c),e+=c,p)}function a(c,p,g){var y;return p===0?new c(0):(y=u(tE(p)*oE[g]),y===null?y:new c(y,0,p))}function s(){var c,p,g,y,d,q,E,A,T;if(c=arguments.length,c&&YA(arguments[c-1])?(c-=1,p=arguments[c]):p="float64",g=Rt(p),g===null)throw new TypeError(Ot("invalid argument. Must provide a recognized data type. Value: `%s`.",p));if(c<=0)return new g(0);if(GA(arguments[0]))return a(g,arguments[0],p);if(WA(arguments[0])){if(y=arguments[0],A=y.length,HA(y)?y=Tp(y,0):XA(y)?y=Ep(y,0):/^complex/.test(p)&&(A/=2),d=a(g,A,p),d===null)return d;if(jp(d)||Cp(d))return d.set(y),d;for(E=Sp($A(y)).accessors[0],q=Sp(p).accessors[1],T=0;T0){for(p=eE(Ft(c.byteLength)),p=iE(t.length-1,p),g=t[p],y=0;y1&&(e.length=ug(t,e,1,r,t>2)),e}og.exports=XE});var lg=l(function(tL,vg){"use strict";var HE=sg();vg.exports=HE});var cg=l(function(iL,fg){"use strict";var JE=typeof SharedArrayBuffer=="function"?SharedArrayBuffer:null;fg.exports=JE});var pg=l(function(aL,mg){"use strict";function $E(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.")}mg.exports=$E});var yg=l(function(nL,gg){"use strict";var QE=require("@stdlib/assert/has-sharedarraybuffer-support"),r4=cg(),e4=pg(),Mt;QE()?Mt=r4:Mt=e4;gg.exports=Mt});var wg=l(function(uL,xg){"use strict";var Nr=require("@stdlib/utils/define-nonenumerable-read-only-property"),dg=require("@stdlib/assert/has-own-property"),qg=require("@stdlib/assert/is-function"),t4=require("@stdlib/assert/is-collection"),i4=require("@stdlib/assert/is-plain-object"),a4=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,n4=U(),hg=require("@stdlib/symbol/iterator"),u4=z(),o4=Y(),s4=k(),Hr=require("@stdlib/string/format");function Pt(r){var e,t,i,n,o,u,a,s,v,f;if(!t4(r))throw new TypeError(Hr("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(n={iter:1e308,dir:1},arguments.length>1)if(i4(arguments[1])){if(t=arguments[1],arguments.length>2){if(a=arguments[2],!qg(a))throw new TypeError(Hr("invalid argument. Callback argument must be a function. Value: `%s`.",a));e=arguments[3]}if(dg(t,"iter")&&(n.iter=t.iter,!a4(t.iter)))throw new TypeError(Hr("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter));if(dg(t,"dir")&&(n.dir=t.dir,t.dir!==1&&t.dir!==-1))throw new TypeError(Hr("invalid option. `%s` option must be either `1` or `-1`. Option: `%s`.","dir",t.dir))}else{if(a=arguments[1],!qg(a))throw new TypeError(Hr("invalid argument. Second argument must be either a function or an options object. Value: `%s`.",a));e=arguments[2]}return i=0,o={},a?n.dir===1?(f=-1,Nr(o,"next",m)):(f=r.length,Nr(o,"next",c)):n.dir===1?(f=-1,Nr(o,"next",p)):(f=r.length,Nr(o,"next",g)),Nr(o,"return",y),hg&&Nr(o,hg,d),v=s4(r),n4(r)?s=u4(v):s=o4(v),o;function m(){return f=(f+1)%r.length,i+=1,u||i>n.iter||r.length===0?{done:!0}:{value:a.call(e,s(r,f),f,i,r),done:!1}}function c(){return f-=1,f<0&&(f+=r.length),i+=1,u||i>n.iter||r.length===0?{done:!0}:{value:a.call(e,s(r,f),f,i,r),done:!1}}function p(){return f=(f+1)%r.length,i+=1,u||i>n.iter||r.length===0?{done:!0}:{value:s(r,f),done:!1}}function g(){return f-=1,f<0&&(f+=r.length),i+=1,u||i>n.iter||r.length===0?{done:!0}:{value:s(r,f),done:!1}}function y(q){return u=!0,arguments.length?{value:q,done:!0}:{done:!0}}function d(){return a?Pt(r,n,a,e):Pt(r,n)}}xg.exports=Pt});var Ag=l(function(oL,bg){"use strict";var v4=wg();bg.exports=v4});var Cg=l(function(sL,Sg){"use strict";var Se=require("@stdlib/utils/define-nonenumerable-read-only-property"),l4=require("@stdlib/assert/is-function"),f4=require("@stdlib/assert/is-collection"),c4=U(),Eg=require("@stdlib/symbol/iterator"),m4=z(),p4=Y(),g4=k(),Tg=require("@stdlib/string/format");function Ut(r){var e,t,i,n,o,u,a;if(!f4(r))throw new TypeError(Tg("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(n=arguments[1],!l4(n))throw new TypeError(Tg("invalid argument. Second argument must be a function. Value: `%s`.",n));e=arguments[2]}return a=-1,t={},n?Se(t,"next",s):Se(t,"next",v),Se(t,"return",f),Eg&&Se(t,Eg,m),u=g4(r),c4(r)?o=m4(u):o=p4(u),t;function s(){return a+=1,i||a>=r.length?{done:!0}:{value:n.call(e,o(r,a),a,r),done:!1}}function v(){return a+=1,i||a>=r.length?{done:!0}:{value:o(r,a),done:!1}}function f(c){return i=!0,arguments.length?{value:c,done:!0}:{done:!0}}function m(){return n?Ut(r,n,e):Ut(r)}}Sg.exports=Ut});var kg=l(function(vL,jg){"use strict";var y4=Cg();jg.exports=y4});var Lg=l(function(lL,Ig){"use strict";var Ce=require("@stdlib/utils/define-nonenumerable-read-only-property"),d4=require("@stdlib/assert/is-function"),q4=require("@stdlib/assert/is-collection"),h4=U(),Vg=require("@stdlib/symbol/iterator"),x4=z(),w4=Y(),b4=k(),_g=require("@stdlib/string/format");function zt(r){var e,t,i,n,o,u,a,s;if(!q4(r))throw new TypeError(_g("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(n=arguments[1],!d4(n))throw new TypeError(_g("invalid argument. Second argument must be a function. Value: `%s`.",n));e=arguments[2]}return o=r.length,s=o,t={},n?Ce(t,"next",v):Ce(t,"next",f),Ce(t,"return",m),Vg&&Ce(t,Vg,c),a=b4(r),h4(r)?u=x4(a):u=w4(a),t;function v(){return s+=r.length-o-1,o=r.length,i||s<0?(i=!0,{done:!0}):{value:n.call(e,u(r,s),s,r),done:!1}}function f(){return s+=r.length-o-1,o=r.length,i||s<0?(i=!0,{done:!0}):{value:u(r,s),done:!1}}function m(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function c(){return n?zt(r,n,e):zt(r)}}Ig.exports=zt});var Fg=l(function(fL,Og){"use strict";var A4=Lg();Og.exports=A4});var Bg=l(function(cL,Rg){"use strict";var E4=fr(),T4=vr(),S4=lr(),C4=sr(),j4=or(),k4=ur(),V4=nr(),_4=tr(),I4=er(),L4=yr(),O4=dr(),F4=[[I4,"Float64Array"],[_4,"Float32Array"],[k4,"Int32Array"],[V4,"Uint32Array"],[C4,"Int16Array"],[j4,"Uint16Array"],[E4,"Int8Array"],[T4,"Uint8Array"],[S4,"Uint8ClampedArray"],[L4,"Complex64Array"],[O4,"Complex128Array"]];Rg.exports=F4});var Mg=l(function(mL,Ng){"use strict";var R4=require("@stdlib/assert/instance-of"),B4=require("@stdlib/utils/constructor-name"),N4=require("@stdlib/utils/get-prototype-of"),Mr=Bg();function M4(r){var e,t;for(t=0;t1){if(n=arguments[1],!K4(n))throw new TypeError(Gg("invalid argument. Second argument must be a function. Value: `%s`.",n));e=arguments[2]}return a=-1,t={},n?je(t,"next",s):je(t,"next",v),je(t,"return",f),Yg&&je(t,Yg,m),u=Q4(r),H4(r)?o=J4(u):o=$4(u),t;function s(){var c;if(i)return{done:!0};for(c=r.length,a+=1;a=c?(i=!0,{done:!0}):{value:n.call(e,o(r,a),a,r),done:!1}}function v(){var c;if(i)return{done:!0};for(c=r.length,a+=1;a=c?(i=!0,{done:!0}):{value:o(r,a),done:!1}}function f(c){return i=!0,arguments.length?{value:c,done:!0}:{done:!0}}function m(){return n?Dt(r,n,e):Dt(r)}}Wg.exports=Dt});var Xg=l(function(dL,Kg){"use strict";var rT=Zg();Kg.exports=rT});var Qg=l(function(qL,$g){"use strict";var ke=require("@stdlib/utils/define-nonenumerable-read-only-property"),eT=require("@stdlib/assert/is-function"),tT=require("@stdlib/assert/is-collection"),iT=U(),Hg=require("@stdlib/symbol/iterator"),aT=z(),nT=Y(),uT=k(),Jg=require("@stdlib/string/format");function Yt(r){var e,t,i,n,o,u,a,s;if(!tT(r))throw new TypeError(Jg("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(n=arguments[1],!eT(n))throw new TypeError(Jg("invalid argument. Second argument must be a function. Value: `%s`.",n));e=arguments[2]}return o=r.length,s=o,t={},n?ke(t,"next",v):ke(t,"next",f),ke(t,"return",m),Hg&&ke(t,Hg,c),a=uT(r),iT(r)?u=aT(a):u=nT(a),t;function v(){if(i)return{done:!0};for(s+=r.length-o-1,o=r.length;s>=0&&u(r,s)===void 0;)s-=1;return s<0?(i=!0,{done:!0}):{value:n.call(e,u(r,s),s,r),done:!1}}function f(){if(i)return{done:!0};for(s+=r.length-o-1,o=r.length;s>=0&&u(r,s)===void 0;)s-=1;return s<0?(i=!0,{done:!0}):{value:u(r,s),done:!1}}function m(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function c(){return n?Yt(r,n,e):Yt(r)}}$g.exports=Yt});var ey=l(function(hL,ry){"use strict";var oT=Qg();ry.exports=oT});var ny=l(function(xL,ay){"use strict";var Ve=require("@stdlib/utils/define-nonenumerable-read-only-property"),sT=require("@stdlib/assert/is-function"),vT=require("@stdlib/assert/is-collection"),ty=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,lT=require("@stdlib/assert/is-integer").isPrimitive,fT=U(),iy=require("@stdlib/symbol/iterator"),cT=z(),mT=Y(),pT=k(),Jr=require("@stdlib/string/format");function Gt(r,e,t,i){var n,o,u,a,s,v,f,m;if(!ty(r))throw new TypeError(Jr("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!vT(e))throw new TypeError(Jr("invalid argument. Second argument must be an array-like object. Value: `%s`.",e));if(!lT(t))throw new TypeError(Jr("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(!ty(i))throw new TypeError(Jr("invalid argument. Fourth argument must be a nonnegative integer. Value: `%s`.",i));if(arguments.length>4){if(a=arguments[4],!sT(a))throw new TypeError(Jr("invalid argument. Fifth argument must be a function. Value: `%s`.",a));n=arguments[5]}return s=i,m=-1,o={},a?Ve(o,"next",c):Ve(o,"next",p),Ve(o,"return",g),iy&&Ve(o,iy,y),f=pT(e),fT(e)?v=cT(f):v=mT(f),o;function c(){var d;return m+=1,u||m>=r?{done:!0}:(d=a.call(n,v(e,s),s,m,e),s+=t,{value:d,done:!1})}function p(){var d;return m+=1,u||m>=r?{done:!0}:(d=v(e,s),s+=t,{value:d,done:!1})}function g(d){return u=!0,arguments.length?{value:d,done:!0}:{done:!0}}function y(){return a?Gt(r,e,t,i,a,n):Gt(r,e,t,i)}}ay.exports=Gt});var oy=l(function(wL,uy){"use strict";var gT=ny();uy.exports=gT});var fy=l(function(bL,ly){"use strict";var _e=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ie=require("@stdlib/assert/is-function"),yT=require("@stdlib/assert/is-collection"),sy=require("@stdlib/assert/is-integer").isPrimitive,dT=U(),vy=require("@stdlib/symbol/iterator"),qT=z(),hT=Y(),xT=k(),Le=require("@stdlib/string/format");function Wt(r){var e,t,i,n,o,u,a,s,v,f;if(!yT(r))throw new TypeError(Le("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,a=r.length;else if(i===2)Ie(arguments[1])?(t=0,u=arguments[1]):t=arguments[1],a=r.length;else if(i===3)Ie(arguments[1])?(t=0,a=r.length,u=arguments[1],e=arguments[2]):Ie(arguments[2])?(t=arguments[1],a=r.length,u=arguments[2]):(t=arguments[1],a=arguments[2]);else{if(t=arguments[1],a=arguments[2],u=arguments[3],!Ie(u))throw new TypeError(Le("invalid argument. Fourth argument must be a function. Value: `%s`.",u));e=arguments[4]}if(!sy(t))throw new TypeError(Le("invalid argument. Second argument must be either an integer (starting index) or a function. Value: `%s`.",t));if(!sy(a))throw new TypeError(Le("invalid argument. Third argument must be either an integer (ending index) or a function. Value: `%s`.",a));return a<0?(a=r.length+a,a<0&&(a=0)):a>r.length&&(a=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=t-1,n={},u?_e(n,"next",m):_e(n,"next",c),_e(n,"return",p),vy&&_e(n,vy,g),v=xT(r),dT(r)?s=qT(v):s=hT(v),n;function m(){return f+=1,o||f>=a?{done:!0}:{value:u.call(e,s(r,f),f,f-t,r),done:!1}}function c(){return f+=1,o||f>=a?{done:!0}:{value:s(r,f),done:!1}}function p(y){return o=!0,arguments.length?{value:y,done:!0}:{done:!0}}function g(){return u?Wt(r,t,a,u,e):Wt(r,t,a)}}ly.exports=Wt});var my=l(function(AL,cy){"use strict";var wT=fy();cy.exports=wT});var dy=l(function(EL,yy){"use strict";var Oe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fe=require("@stdlib/assert/is-function"),bT=require("@stdlib/assert/is-collection"),py=require("@stdlib/assert/is-integer").isPrimitive,AT=U(),gy=require("@stdlib/symbol/iterator"),ET=z(),TT=Y(),ST=k(),Re=require("@stdlib/string/format");function Zt(r){var e,t,i,n,o,u,a,s,v,f;if(!bT(r))throw new TypeError(Re("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,a=r.length;else if(i===2)Fe(arguments[1])?(t=0,u=arguments[1]):t=arguments[1],a=r.length;else if(i===3)Fe(arguments[1])?(t=0,a=r.length,u=arguments[1],e=arguments[2]):Fe(arguments[2])?(t=arguments[1],a=r.length,u=arguments[2]):(t=arguments[1],a=arguments[2]);else{if(t=arguments[1],a=arguments[2],u=arguments[3],!Fe(u))throw new TypeError(Re("invalid argument. Fourth argument must be a function. Value: `%s`.",u));e=arguments[4]}if(!py(t))throw new TypeError(Re("invalid argument. Second argument must be either an integer (starting view index) or a function. Value: `%s`.",t));if(!py(a))throw new TypeError(Re("invalid argument. Third argument must be either an integer (ending view index) or a function. Value: `%s`.",a));return a<0?(a=r.length+a,a<0&&(a=0)):a>r.length&&(a=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=a,n={},u?Oe(n,"next",m):Oe(n,"next",c),Oe(n,"return",p),gy&&Oe(n,gy,g),v=ST(r),AT(r)?s=ET(v):s=TT(v),n;function m(){return f-=1,o||f1&&(e=arguments[1]),AC(r.length,e)}Q0.exports=EC});var t1=l(function(wO,e1){"use strict";var TC=r1();e1.exports=TC});var b=require("@stdlib/utils/define-read-only-property"),w={};b(w,"base",Ql());b(w,"ArrayBuffer",lt());b(w,"Complex64Array",yr());b(w,"Complex128Array",dr());b(w,"convertArray",gt());b(w,"convertArraySame",qf());b(w,"arrayCtors",Tr());b(w,"DataView",Ef());b(w,"datespace",_f());b(w,"arrayDataType",k());b(w,"arrayDataTypes",Rf());b(w,"aempty",qt());b(w,"aemptyLike",nc());b(w,"filledarray",mc());b(w,"filledarrayBy",Ac());b(w,"Float32Array",tr());b(w,"Float64Array",er());b(w,"iterator2array",jc());b(w,"afull",jr());b(w,"afullLike",Rc());b(w,"incrspace",Pc());b(w,"Int8Array",fr());b(w,"Int16Array",sr());b(w,"Int32Array",ur());b(w,"linspace",Lm());b(w,"logspace",Mm());b(w,"arrayMinDataType",Zm());b(w,"anans",$m());b(w,"anansLike",tp());b(w,"arrayNextDataType",op());b(w,"aones",fp());b(w,"aonesLike",gp());b(w,"typedarraypool",Op());b(w,"arrayPromotionRules",Pp());b(w,"reviveTypedArray",Wp());b(w,"arraySafeCasts",$p());b(w,"arraySameKindCasts",ag());b(w,"arrayShape",lg());b(w,"SharedArrayBuffer",yg());b(w,"circarray2iterator",Ag());b(w,"array2iterator",kg());b(w,"array2iteratorRight",Fg());b(w,"typedarray2json",Dg());b(w,"sparsearray2iterator",Xg());b(w,"sparsearray2iteratorRight",ey());b(w,"stridedarray2iterator",oy());b(w,"arrayview2iterator",my());b(w,"arrayview2iteratorRight",hy());b(w,"typedarray",Ay());b(w,"complexarray",Iy());b(w,"complexarrayCtors",Xt());b(w,"complexarrayDataTypes",By());b(w,"typedarrayCtors",Rr());b(w,"typedarrayDataTypes",zy());b(w,"floatarrayCtors",St());b(w,"floatarrayDataTypes",Zy());b(w,"intarrayCtors",Qy());b(w,"intarrayDataTypes",a0());b(w,"realarray",s0());b(w,"realarrayCtors",p0());b(w,"realarrayDataTypes",h0());b(w,"realarrayFloatCtors",T0());b(w,"realarrayFloatDataTypes",V0());b(w,"intarraySignedCtors",R0());b(w,"intarraySignedDataTypes",U0());b(w,"intarrayUnsignedCtors",Z0());b(w,"intarrayUnsignedDataTypes",$0());b(w,"Uint8Array",vr());b(w,"Uint8ClampedArray",lr());b(w,"Uint16Array",or());b(w,"Uint32Array",nr());b(w,"azeros",pe());b(w,"azerosLike",t1());b(w,"constants",require("@stdlib/constants/array"));module.exports=w;
+"use strict";var l=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var ai=l(function(LC,ii){"use strict";var ti="function";function o1(r){return typeof r.get===ti&&typeof r.set===ti}ii.exports=o1});var U=l(function(OC,ni){"use strict";var s1=ai();ni.exports=s1});var si=l(function(FC,oi){"use strict";var ui={float64:v1,float32:l1,int32:f1,int16:c1,int8:m1,uint32:p1,uint16:g1,uint8:y1,uint8c:d1,generic:q1,default:h1};function v1(r,e){return r[e]}function l1(r,e){return r[e]}function f1(r,e){return r[e]}function c1(r,e){return r[e]}function m1(r,e){return r[e]}function p1(r,e){return r[e]}function g1(r,e){return r[e]}function y1(r,e){return r[e]}function d1(r,e){return r[e]}function q1(r,e){return r[e]}function h1(r,e){return r[e]}function x1(r){var e=ui[r];return typeof e=="function"?e:ui.default}oi.exports=x1});var Y=l(function(RC,vi){"use strict";var w1=si();vi.exports=w1});var ci=l(function(BC,fi){"use strict";var li={float64:b1,float32:A1,int32:E1,int16:T1,int8:S1,uint32:C1,uint16:j1,uint8:k1,uint8c:V1,generic:_1,default:I1};function b1(r,e,t){r[e]=t}function A1(r,e,t){r[e]=t}function E1(r,e,t){r[e]=t}function T1(r,e,t){r[e]=t}function S1(r,e,t){r[e]=t}function C1(r,e,t){r[e]=t}function j1(r,e,t){r[e]=t}function k1(r,e,t){r[e]=t}function V1(r,e,t){r[e]=t}function _1(r,e,t){r[e]=t}function I1(r,e,t){r[e]=t}function L1(r){var e=li[r];return typeof e=="function"?e:li.default}fi.exports=L1});var $r=l(function(NC,mi){"use strict";var O1=ci();mi.exports=O1});var yi=l(function(MC,gi){"use strict";var pi={complex128:F1,complex64:R1,default:B1};function F1(r,e){return r.get(e)}function R1(r,e){return r.get(e)}function B1(r,e){return r.get(e)}function N1(r){var e=pi[r];return typeof e=="function"?e:pi.default}gi.exports=N1});var z=l(function(PC,di){"use strict";var M1=yi();di.exports=M1});var xi=l(function(UC,hi){"use strict";var qi={complex128:P1,complex64:U1,default:z1};function P1(r,e,t){r.set(t,e)}function U1(r,e,t){r.set(t,e)}function z1(r,e,t){r.set(t,e)}function D1(r){var e=qi[r];return typeof e=="function"?e:qi.default}hi.exports=D1});var Qr=l(function(zC,wi){"use strict";var Y1=xi();wi.exports=Y1});var Ai=l(function(DC,bi){"use strict";var G1={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"};bi.exports=G1});var Ti=l(function(YC,Ei){"use strict";var W1=typeof Float64Array=="function"?Float64Array:void 0;Ei.exports=W1});var Ci=l(function(GC,Si){"use strict";function Z1(){throw new Error("not implemented")}Si.exports=Z1});var er=l(function(WC,ji){"use strict";var K1=require("@stdlib/assert/has-float64array-support"),X1=Ti(),H1=Ci(),Be;K1()?Be=X1:Be=H1;ji.exports=Be});var Vi=l(function(ZC,ki){"use strict";var J1=typeof Float32Array=="function"?Float32Array:void 0;ki.exports=J1});var Ii=l(function(KC,_i){"use strict";function $1(){throw new Error("not implemented")}_i.exports=$1});var tr=l(function(XC,Li){"use strict";var Q1=require("@stdlib/assert/has-float32array-support"),rd=Vi(),ed=Ii(),Ne;Q1()?Ne=rd:Ne=ed;Li.exports=Ne});var Fi=l(function(HC,Oi){"use strict";var td=typeof Uint32Array=="function"?Uint32Array:void 0;Oi.exports=td});var Bi=l(function(JC,Ri){"use strict";function id(){throw new Error("not implemented")}Ri.exports=id});var nr=l(function($C,Ni){"use strict";var ad=require("@stdlib/assert/has-uint32array-support"),nd=Fi(),ud=Bi(),Me;ad()?Me=nd:Me=ud;Ni.exports=Me});var Pi=l(function(QC,Mi){"use strict";var od=typeof Int32Array=="function"?Int32Array:void 0;Mi.exports=od});var zi=l(function(rj,Ui){"use strict";function sd(){throw new Error("not implemented")}Ui.exports=sd});var ur=l(function(ej,Di){"use strict";var vd=require("@stdlib/assert/has-int32array-support"),ld=Pi(),fd=zi(),Pe;vd()?Pe=ld:Pe=fd;Di.exports=Pe});var Gi=l(function(tj,Yi){"use strict";var cd=typeof Uint16Array=="function"?Uint16Array:void 0;Yi.exports=cd});var Zi=l(function(ij,Wi){"use strict";function md(){throw new Error("not implemented")}Wi.exports=md});var or=l(function(aj,Ki){"use strict";var pd=require("@stdlib/assert/has-uint16array-support"),gd=Gi(),yd=Zi(),Ue;pd()?Ue=gd:Ue=yd;Ki.exports=Ue});var Hi=l(function(nj,Xi){"use strict";var dd=typeof Int16Array=="function"?Int16Array:void 0;Xi.exports=dd});var $i=l(function(uj,Ji){"use strict";function qd(){throw new Error("not implemented")}Ji.exports=qd});var sr=l(function(oj,Qi){"use strict";var hd=require("@stdlib/assert/has-int16array-support"),xd=Hi(),wd=$i(),ze;hd()?ze=xd:ze=wd;Qi.exports=ze});var ea=l(function(sj,ra){"use strict";var bd=typeof Uint8Array=="function"?Uint8Array:void 0;ra.exports=bd});var ia=l(function(vj,ta){"use strict";function Ad(){throw new Error("not implemented")}ta.exports=Ad});var vr=l(function(lj,aa){"use strict";var Ed=require("@stdlib/assert/has-uint8array-support"),Td=ea(),Sd=ia(),De;Ed()?De=Td:De=Sd;aa.exports=De});var ua=l(function(fj,na){"use strict";var Cd=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;na.exports=Cd});var sa=l(function(cj,oa){"use strict";function jd(){throw new Error("not implemented")}oa.exports=jd});var lr=l(function(mj,va){"use strict";var kd=require("@stdlib/assert/has-uint8clampedarray-support"),Vd=ua(),_d=sa(),Ye;kd()?Ye=Vd:Ye=_d;va.exports=Ye});var fa=l(function(pj,la){"use strict";var Id=typeof Int8Array=="function"?Int8Array:void 0;la.exports=Id});var ma=l(function(gj,ca){"use strict";function Ld(){throw new Error("not implemented")}ca.exports=Ld});var fr=l(function(yj,pa){"use strict";var Od=require("@stdlib/assert/has-int8array-support"),Fd=fa(),Rd=ma(),Ge;Od()?Ge=Fd:Ge=Rd;pa.exports=Ge});var ya=l(function(dj,ga){"use strict";var Bd=require("@stdlib/assert/is-array-like-object"),Nd=require("@stdlib/assert/is-complex-like"),Md=require("@stdlib/complex/realf"),Pd=require("@stdlib/complex/imagf"),Ud=require("@stdlib/string/format");function zd(r){var e,t,i;for(e=[];t=r.next(),!t.done;)if(i=t.value,Bd(i)&&i.length>=2)e.push(i[0],i[1]);else if(Nd(i))e.push(Md(i),Pd(i));else return new TypeError(Ud("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=zd});var qa=l(function(qj,da){"use strict";var Dd=require("@stdlib/assert/is-array-like-object"),Yd=require("@stdlib/assert/is-complex-like"),Gd=require("@stdlib/complex/realf"),Wd=require("@stdlib/complex/imagf"),Zd=require("@stdlib/string/format");function Kd(r,e,t){var i,n,o,u;for(i=[],u=-1;n=r.next(),!n.done;)if(u+=1,o=e.call(t,n.value,u),Dd(o)&&o.length>=2)i.push(o[0],o[1]);else if(Yd(o))i.push(Gd(o),Wd(o));else return new TypeError(Zd("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return i}da.exports=Kd});var xa=l(function(hj,ha){"use strict";var Xd=require("@stdlib/assert/is-complex-like"),Hd=require("@stdlib/complex/realf"),Jd=require("@stdlib/complex/imagf");function $d(r,e){var t,i,n,o;for(t=e.length,o=0,n=0;nt.byteLength-r)throw new RangeError(V("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*K));t=new $(t,r,i*2)}}return G(this,"_buffer",t),G(this,"_length",t.length/2),this}G(F,"BYTES_PER_ELEMENT",K);G(F,"name","Complex64Array");G(F,"from",function(e){var t,i,n,o,u,a,s,v,f,m,c,p;if(!br(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ca(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(n=arguments[1],!br(n))throw new TypeError(V("invalid argument. Second argument must be a function. Value: `%s`.",n));i>2&&(t=arguments[2])}if(Ir(e)){if(v=e.length,n){for(o=new this(v),u=o._buffer,p=0,c=0;c=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return o}return new this(e)}if(Ze(e)){if(n){for(v=e.length,e.get&&e.set?s=aq("default"):s=iq("default"),c=0;c=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return o}return new this(e)}if(Aa(e)&&Sa&&br(e[_r])){if(u=e[_r](),!br(u.next))throw new TypeError(V("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(n?a=nq(u,n,t):a=Ta(u),a instanceof Error)throw a;for(v=a.length/2,o=new this(v),u=o._buffer,c=0;c=n?{done:!0}:(a+=2,m=new Ea(e[a],e[a+1]),{value:[u,m],done:!1})}function v(m){return o=!0,arguments.length?{value:m,done:!0}:{done:!0}}function f(){return t.entries()}});G(F.prototype,"get",function(e){var t;if(!Ir(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Dr(e))throw new TypeError(V("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return t=this._buffer,e*=2,new Ea(t[e],t[e+1])});ie(F.prototype,"length",function(){return this._length});G(F.prototype,"set",function(e){var t,i,n,o,u,a,s,v,f;if(!Ir(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(i=arguments[1],!Dr(i))throw new TypeError(V("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(Vr(e)){if(i>=this._length)throw new RangeError(V("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,n[i]=ee(e),n[i+1]=te(e);return}if(Ir(e)){if(a=e._length,i+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=n.byteOffset+i*K,t.buffer===n.buffer&&t.byteOffsetf){for(o=new $(t.length),v=0;vthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=n.byteOffset+i*K,t.buffer===n.buffer&&t.byteOffsetf){for(o=new $(a),v=0;vthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,v=0;v=2)e.push(i[0],i[1]);else if(fq(i))e.push(mq(i),pq(i));else return new TypeError(cq("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}_a.exports=gq});var Oa=l(function(Aj,La){"use strict";var yq=require("@stdlib/assert/is-array-like-object"),dq=require("@stdlib/assert/is-complex-like"),qq=require("@stdlib/string/format"),hq=require("@stdlib/complex/real"),xq=require("@stdlib/complex/imag");function wq(r,e,t){var i,n,o,u;for(i=[],u=-1;n=r.next(),!n.done;)if(u+=1,o=e.call(t,n.value,u),yq(o)&&o.length>=2)i.push(o[0],o[1]);else if(dq(o))i.push(hq(o),xq(o));else return new TypeError(qq("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return i}La.exports=wq});var Ra=l(function(Ej,Fa){"use strict";var bq=require("@stdlib/assert/is-complex-like"),Aq=require("@stdlib/complex/real"),Eq=require("@stdlib/complex/imag");function Tq(r,e){var t,i,n,o;for(t=e.length,o=0,n=0;nt.byteLength-r)throw new RangeError(_("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*X));t=new Q(t,r,i*2)}}return W(this,"_buffer",t),W(this,"_length",t.length/2),this}W(R,"BYTES_PER_ELEMENT",X);W(R,"name","Complex128Array");W(R,"from",function(e){var t,i,n,o,u,a,s,v,f,m,c,p;if(!Ar(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Da(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(n=arguments[1],!Ar(n))throw new TypeError(_("invalid argument. Second argument must be a function. Value: `%s`.",n));i>2&&(t=arguments[2])}if(Fr(e)){if(v=e.length,n){for(o=new this(v),u=o._buffer,p=0,c=0;c=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(_("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return o}return new this(e)}if(Xe(e)){if(n){for(v=e.length,e.get&&e.set?s=_q("default"):s=Vq("default"),c=0;c=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(_("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return o}return new this(e)}if(Ma(e)&&za&&Ar(e[Or])){if(u=e[Or](),!Ar(u.next))throw new TypeError(_("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(n?a=Iq(u,n,t):a=Ua(u),a instanceof Error)throw a;for(v=a.length/2,o=new this(v),u=o._buffer,c=0;c=n?{done:!0}:(a+=2,m=new Pa(e[a],e[a+1]),{value:[u,m],done:!1})}function v(m){return o=!0,arguments.length?{value:m,done:!0}:{done:!0}}function f(){return t.entries()}});W(R.prototype,"get",function(e){var t;if(!Fr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(_("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return t=this._buffer,e*=2,new Pa(t[e],t[e+1])});oe(R.prototype,"length",function(){return this._length});W(R.prototype,"set",function(e){var t,i,n,o,u,a,s,v,f;if(!Fr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(i=arguments[1],!Yr(i))throw new TypeError(_("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(Lr(e)){if(i>=this._length)throw new RangeError(_("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,n[i]=ne(e),n[i+1]=ue(e);return}if(Fr(e)){if(a=e._length,i+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=n.byteOffset+i*X,t.buffer===n.buffer&&t.byteOffsetf){for(o=new Q(t.length),v=0;vthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=n.byteOffset+i*X,t.buffer===n.buffer&&t.byteOffsetf){for(o=new Q(a),v=0;vthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,v=0;v=0;v--)if(f=a-u+v,!(f<0)){if(s=e[f],n=t[v],n!==0&&n=0;v--)a=f%u,f-=a,f/=u,n[v]=a;for(i=[],v=0;v=0;c--)f=p%i[c],p-=f,p/=i[c],s[c]=f;for(u=[],c=0;c2){if(arguments.length===3?kf(t)?n=t:(o=t,u=!1):(n=i,o=t),o===0)return[];if(!m6(o)||o<0)throw new TypeError(Sr("invalid argument. Length must be a positive integer. Value: `%s`.",o));if(u){if(!kf(n))throw new TypeError(Sr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(c6(n,"round")){if(!p6(n.round))throw new TypeError(Sr("invalid option. `%s` option must be a string. Option: `%s`.","round",n.round));if(Vf.indexOf(n.round)===-1)throw new Error(Sr('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"round",Vf.join('", "'),n.round))}}}switch(n.round){case"round":v=y6;break;case"ceil":v=d6;break;case"floor":default:v=g6;break}for(s=o-1,m=(e.getTime()-r.getTime())/s,a=new Array(o),f=r,a[0]=f,f=f.getTime(),c=1;c1?i=arguments[1]:i="float64",i==="generic")return G6(r);if(e=W6(i),e===null)throw new TypeError(Xf("invalid argument. Second argument must be a supported data type. Value: `%s`.",i));return n=Y6(i),a=e*r,i==="complex128"&&(a+=8),o=D6(a),t=o.byteOffset,i==="complex128"&&(Kf(t/e)||(t+=8)),u=new n(o.buffer,t,r),u}Hf.exports=Z6});var rc=l(function(J_,Qf){"use strict";var K6=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,X6=Tr(),H6=qr(),$f=require("@stdlib/string/format");function J6(r){var e,t;if(!K6(r))throw new TypeError($f("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(arguments.length>1?e=arguments[1]:e="float64",e==="generic")return H6(r);if(t=X6(e),t===null)throw new TypeError($f("invalid argument. Second argument must be a recognized data type. Value: `%s`.",e));return new t(r)}Qf.exports=J6});var pe=l(function($_,ec){"use strict";var $6=rc();ec.exports=$6});var ac=l(function(Q_,ic){"use strict";var tc=pe();function Q6(r){return arguments.length>1?tc(r,arguments[1]):tc(r)}ic.exports=Q6});var qt=l(function(rI,nc){"use strict";var r3=zf(),e3=Jf(),t3=ac(),dt;r3()?dt=e3:dt=t3;nc.exports=dt});var oc=l(function(eI,uc){"use strict";var i3=k(),a3=qt(),n3=require("@stdlib/string/format");function u3(r){var e=i3(r);if(e===null)throw new TypeError(n3("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]),a3(r.length,e)}uc.exports=u3});var vc=l(function(tI,sc){"use strict";var o3=oc();sc.exports=o3});var gc=l(function(iI,pc){"use strict";var s3=require("@stdlib/assert/is-string").isPrimitive,lc=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fc=require("@stdlib/assert/is-collection"),ht=require("@stdlib/assert/is-arraybuffer"),cc=require("@stdlib/assert/is-object"),ge=require("@stdlib/assert/is-function"),v3=Tr(),l3=require("@stdlib/blas/ext/base/gfill"),f3=ir(),c3=require("@stdlib/assert/has-iterator-symbol-support"),ye=require("@stdlib/symbol/iterator"),m3=require("@stdlib/iter/length"),mr=require("@stdlib/string/format"),mc=c3();function p3(r,e){var t,i;for(t=[];i=r.next(),!i.done;)t.push(e);return t}function g3(r,e){var t;for(t=0;t=0&&s3(arguments[e])?(t=arguments[e],e-=1):t="float64",i=v3(t),i===null)throw new TypeError(mr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(e<=0)return[];if(r=arguments[0],u=arguments[1],e===1){if(lc(u)?o=u:fc(u)&&(o=u.length),o!==void 0)return f3(r,o);if(ht(u))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(cc(u)){if(mc===!1)throw new TypeError(mr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",u));if(!ge(u[ye]))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));if(u=u[ye](),!ge(u.next))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));return p3(u,r)}throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u))}else if(ht(u))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u))}if(e<=0)return new i(0);if(e===1)if(u=arguments[1],fc(u))n=new i(u.length);else if(ht(u))n=new i(u);else if(lc(u))n=new i(u);else if(cc(u)){if(mc===!1)throw new TypeError(mr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",u));if(!ge(u[ye]))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));if(u=u[ye](),!ge(u.next))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));n=new i(m3(u))}else throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));else e===2?n=new i(arguments[1],arguments[2]):n=new i(arguments[1],arguments[2],arguments[3]);return n.length>0&&(/^complex/.test(t)?g3(n,arguments[0]):l3(n.length,arguments[0],n,1)),n}pc.exports=y3});var dc=l(function(aI,yc){"use strict";var d3=gc();yc.exports=d3});var Tc=l(function(nI,Ec){"use strict";var qc=require("@stdlib/assert/is-string").isPrimitive,hc=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xc=require("@stdlib/assert/is-collection"),xt=require("@stdlib/assert/is-arraybuffer"),wc=require("@stdlib/assert/is-object"),Cr=require("@stdlib/assert/is-function"),wt=Tr(),q3=require("@stdlib/blas/ext/base/gfill-by"),h3=et(),x3=require("@stdlib/assert/has-iterator-symbol-support"),de=require("@stdlib/symbol/iterator"),w3=require("@stdlib/iter/length"),rr=require("@stdlib/string/format"),bc=x3(),Ac="float64";function b3(r,e,t){var i,n,o;for(i=[],n=-1;o=r.next(),!o.done;)n+=1,i.push(e.call(t,n));return i}function A3(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(n=wt(t),n===null)throw new TypeError(rr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));return new n(0)}if(e<2)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(e-=1,Cr(arguments[e]))if(Cr(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],!Cr(i))throw new TypeError(rr("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&&qc(arguments[e])?(t=arguments[e],e-=1):t=Ac,n=wt(t),n===null)throw new TypeError(rr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(a=arguments[0],e===0){if(hc(a)?u=a:xc(a)&&(u=a.length),u!==void 0)return h3(u,i,r);if(xt(a))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(wc(a)){if(bc===!1)throw new TypeError(rr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",a));if(!Cr(a[de]))throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));if(a=a[de](),!Cr(a.next))throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));return b3(a,i,r)}throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a))}else if(xt(a))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a))}if(e===0)if(a=arguments[0],xc(a))o=new n(a.length);else if(xt(a))o=new n(a);else if(hc(a))o=new n(a);else if(wc(a)){if(bc===!1)throw new TypeError(rr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",a));if(!Cr(a[de]))throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));if(a=a[de](),!Cr(a.next))throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));o=new n(w3(a))}else throw new TypeError(rr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",a));else e===1?o=new n(arguments[0],arguments[1]):o=new n(arguments[0],arguments[1],arguments[2]);return o.length>0&&(/^complex/.test(t)?A3(o,i,r):q3(o.length,o,1,s)),o;function s(v,f){return i.call(r,f)}}Ec.exports=E3});var Cc=l(function(uI,Sc){"use strict";var T3=Tc();Sc.exports=T3});var Vc=l(function(oI,kc){"use strict";var jc=require("@stdlib/assert/is-function"),S3=require("@stdlib/assert/is-collection"),C3=require("@stdlib/assert/is-iterator-like"),j3=U(),k3=Qr(),V3=$r(),_3=k(),bt=require("@stdlib/string/format");function I3(){var r,e,t,i,n,o,u,a,s;if(r=arguments[0],arguments.length>1)if(S3(arguments[1])){if(i=arguments[1],arguments.length>2){if(t=arguments[2],!jc(t))throw new TypeError(bt("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[3]}}else{if(t=arguments[1],!jc(t))throw new TypeError(bt("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[2]}if(!C3(r))throw new TypeError(bt("invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `%s`.",r));if(a=-1,i===void 0){if(i=[],t){for(;a+=1,s=r.next(),!s.done;)i.push(t.call(e,s.value,a));return i}for(;s=r.next(),!s.done;)i.push(s.value);return i}if(n=i.length,u=_3(i),j3(i)?o=k3(u):o=V3(u),t){for(;a2?t=arguments[2]:t="float64",t==="generic")return R3(e,r);if(i=F3(t),i===null)throw new TypeError(Lc("invalid argument. Third argument must be a recognized data type. Value: `%s`.",t));return n=new i(r),B3(r,e,n,1),n}Oc.exports=N3});var jr=l(function(lI,Rc){"use strict";var M3=Fc();Rc.exports=M3});var Nc=l(function(fI,Bc){"use strict";var P3=require("@stdlib/string/format"),U3=k(),z3=jr(),D3=require("@stdlib/complex/float64"),Y3=require("@stdlib/complex/float32");function G3(r,e){var t,i;if(t=U3(r),t===null)throw new TypeError(P3("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 D3(e,0):t==="complex64"?i=new Y3(e,0):i=e:i=e,z3(r.length,i,t)}Bc.exports=G3});var Pc=l(function(cI,Mc){"use strict";var W3=Nc();Mc.exports=W3});var zc=l(function(mI,Uc){"use strict";var Z3=require("@stdlib/math/base/special/ceil"),At=require("@stdlib/assert/is-number").isPrimitive,Et=require("@stdlib/math/base/assert/is-nan"),Tt=require("@stdlib/string/format"),K3=require("@stdlib/constants/uint32/max"),X3=ut();function H3(r,e,t){var i,n;if(!At(r)||Et(r))throw new TypeError(Tt("invalid argument. Start must be numeric. Value: `%s`.",r));if(!At(e)||Et(e))throw new TypeError(Tt("invalid argument. Stop must be numeric. Value: `%s`.",e));if(arguments.length<3)n=1;else if(n=t,!At(n)||Et(n))throw new TypeError(Tt("invalid argument. Increment must be numeric. Value: `%s`.",n));if(i=Z3((e-r)/n),i>K3)throw new RangeError("invalid arguments. Generated array exceeds maximum array length.");return X3(r,e,n)}Uc.exports=H3});var Yc=l(function(pI,Dc){"use strict";var J3=zc();Dc.exports=J3});var Wc=l(function(gI,Gc){"use strict";var $3=er(),Q3=tr(),r8=dr(),e8=yr(),t8={float64:$3,float32:Q3,complex128:r8,complex64:e8};Gc.exports=t8});var Kc=l(function(yI,Zc){"use strict";var i8=Wc();function a8(r){return i8[r]||null}Zc.exports=a8});var St=l(function(dI,Xc){"use strict";var n8=Kc();Xc.exports=n8});var Jc=l(function(qI,Hc){"use strict";function u8(r,e,t,i){var n,o,u,a;if(t===0)return[];if(t===1)return i?[e]:[r];for(n=[r],i?o=t-1:o=t,u=(e-r)/o,a=1;a3&&(o=E8(i,arguments[3]),o))throw o;if(i.dtype==="generic")return v?b8(a,r,s,e,t,i.endpoint):w8(r,e,t,i.endpoint);if(n=q8(i.dtype),n===null)throw new TypeError(Br('invalid option. `%s` option must be a real or complex floating-point data type or "generic". Option: `%s`.',"dtype",i.dtype));if(u=new n(t),i.dtype==="complex64")return ym(h8(u,0),a,r,s,e,t,i.endpoint),u;if(i.dtype==="complex128")return ym(x8(u,0),a,r,s,e,t,i.endpoint),u;if(v)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 A8(u,r,e,t,i.endpoint)}dm.exports=S8});var Em=l(function(TI,Am){"use strict";var C8=require("@stdlib/complex/float32"),j8=require("@stdlib/complex/float64"),hm=require("@stdlib/complex/real"),xm=require("@stdlib/complex/imag"),wm=require("@stdlib/complex/realf"),bm=require("@stdlib/complex/imagf");function k8(r,e,t,i,n,o,u){var a,s,v,f,m,c,p,g,y,d,q,E,A,T;if(o===0)return r;if(s=0,e==="float64"?(v=t,m=0):e==="complex64"?(s+=1,v=wm(t),m=bm(t)):(v=hm(t),m=xm(t)),i==="float64"?(f=n,c=0):i==="complex64"?(s+=1,f=wm(n),c=bm(n)):(f=hm(n),c=xm(n)),s===2?a=C8:a=j8,g=r.data,p=r.accessors[1],o===1)return u?p(g,0,new a(f,c)):p(g,0,new a(v,m)),r;for(p(g,0,new a(v,m)),u?A=o-1:A=o,q=(f-v)/A,E=(c-m)/A,T=1;T3&&(n=N8(i,arguments[3]),n))throw n;if(s=I8(t),s===null&&(s="generic"),s==="complex64")return Im(L8(t,0),o,r,u,e,t.length,i.endpoint),t;if(s==="complex128")return Im(O8(t,0),o,r,u,e,t.length,i.endpoint),t;if(a){if(s==="generic")return v=_m(t),F8(v,o,r,u,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 v=_m(t),v.accessorProtocol?(R8(v,r,e,t.length,i.endpoint),t):(B8(t,r,e,t.length,i.endpoint),t)}Lm.exports=P8});var Bm=l(function(jI,Rm){"use strict";var U8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fm=qm(),z8=Om();U8(Fm,"assign",z8);Rm.exports=Fm});var Um=l(function(kI,Pm){"use strict";var Nm=require("@stdlib/assert/is-number").isPrimitive,D8=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,It=require("@stdlib/string/format"),Mm=require("@stdlib/math/base/assert/is-nan"),Y8=st();function G8(r,e,t){if(!Nm(r)||Mm(r))throw new TypeError(It("invalid argument. Exponent of start value must be numeric. Value: `%s`.",r));if(!Nm(e)||Mm(e))throw new TypeError(It("invalid argument. Exponent of stop value must be numeric. Value: `%s`.",e));if(arguments.length<3)t=10;else if(!D8(t))throw new TypeError(It("invalid argument. Length must be a nonnegative integer. Value: `%s`.",t));return Y8(r,e,t)}Pm.exports=G8});var Dm=l(function(VI,zm){"use strict";var W8=Um();zm.exports=W8});var Xm=l(function(_I,Km){"use strict";var Gm=require("@stdlib/math/base/assert/is-integer"),Z8=require("@stdlib/math/base/assert/is-negative-zero"),K8=require("@stdlib/assert/is-complex-like"),Wm=require("@stdlib/constants/float64/pinf"),Zm=require("@stdlib/constants/float64/ninf"),qe=require("@stdlib/constants/float32/smallest-subnormal"),X8=require("@stdlib/constants/float32/max-safe-integer"),H8=require("@stdlib/constants/float32/min-safe-integer"),J8=require("@stdlib/constants/int8/min"),$8=require("@stdlib/constants/int16/min"),Q8=require("@stdlib/constants/int32/min"),rA=require("@stdlib/constants/uint8/max"),eA=require("@stdlib/constants/uint16/max"),tA=require("@stdlib/constants/uint32/max");function Ym(r){return r!==r||r===Wm||r===Zm?"float32":Gm(r)?r>=H8&&r<=X8?"float32":"float64":r>-qe&&r=J8?"int8":r>=$8?"int16":r>=Q8?"int32":"float64":r<=rA?"uint8":r<=eA?"uint16":r<=tA?"uint32":"float64":r>-qe&&r1){if(e=arguments[1],$m.indexOf(e)===-1)throw new TypeError(sA('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',$m.join('", "'),e))}else e="float64";return e==="complex128"?t=vA:e==="complex64"?t=lA:t=NaN,oA(r,t,e)}Qm.exports=fA});var tp=l(function(OI,ep){"use strict";var cA=rp();ep.exports=cA});var ap=l(function(FI,ip){"use strict";var mA=k(),pA=jr(),gA=require("@stdlib/complex/float64"),yA=require("@stdlib/complex/float32"),Lt=require("@stdlib/string/format"),dA=new gA(NaN,NaN),qA=new yA(NaN,NaN),he=["float64","float32","complex128","complex64","generic"];function hA(r){var e,t;if(e=mA(r),e===null)throw new TypeError(Lt("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],he.indexOf(e)===-1)throw new TypeError(Lt('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',he.join('", "'),e))}else if(he.indexOf(e)===-1)throw new TypeError(Lt('invalid argument. First argument must be one of the following data types: "%s". Value: `%s`.',he.join('", "'),e));return e==="complex128"?t=dA:e==="complex64"?t=qA:t=NaN,pA(r.length,t,e)}ip.exports=hA});var up=l(function(RI,np){"use strict";var xA=ap();np.exports=xA});var op=l(function(BI,wA){wA.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 vp=l(function(NI,sp){"use strict";var bA=require("@stdlib/utils/keys"),AA=require("@stdlib/assert/has-own-property"),xe=op();function EA(){var r,e,t,i;for(t={},r=bA(xe),e=r.length,i=0;i1?e=arguments[1]:e="float64",e==="complex128"?t=VA:e==="complex64"?t=_A:t=1,kA(r,t,e)}cp.exports=IA});var gp=l(function(UI,pp){"use strict";var LA=mp();pp.exports=LA});var dp=l(function(zI,yp){"use strict";var OA=k(),FA=jr(),RA=require("@stdlib/complex/float64"),BA=require("@stdlib/complex/float32"),NA=require("@stdlib/string/format"),MA=new RA(1,0),PA=new BA(1,0);function UA(r){var e,t;if(e=OA(r),e===null)throw new TypeError(NA("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=MA:e==="complex64"?t=PA:t=1,FA(r.length,t,e)}yp.exports=UA});var hp=l(function(DI,qp){"use strict";var zA=dp();qp.exports=zA});var wp=l(function(YI,xp){"use strict";function DA(){return{highWaterMark:9007199254740992}}xp.exports=DA});var Ep=l(function(GI,Ap){"use strict";var YA=require("@stdlib/assert/is-plain-object"),GA=require("@stdlib/assert/has-own-property"),WA=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bp=require("@stdlib/string/format");function ZA(r,e){return YA(e)?GA(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!WA(r.highWaterMark))?new TypeError(bp("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","highWaterMark",r.highWaterMark)):null:new TypeError(bp("invalid argument. Options argument must be an object. Value: `%s`.",e))}Ap.exports=ZA});var Sp=l(function(WI,Tp){"use strict";function KA(r){var e,t;for(e=[],t=0;ti.highWaterMark?null:(p=new nE(c),e+=c,p)}function a(c,p,g){var y;return p===0?new c(0):(y=u(sE(p)*mE[g]),y===null?y:new c(y,0,p))}function s(){var c,p,g,y,d,q,E,A,T;if(c=arguments.length,c&&HA(arguments[c-1])?(c-=1,p=arguments[c]):p="float64",g=Rt(p),g===null)throw new TypeError(Ot("invalid argument. Must provide a recognized data type. Value: `%s`.",p));if(c<=0)return new g(0);if(JA(arguments[0]))return a(g,arguments[0],p);if($A(arguments[0])){if(y=arguments[0],A=y.length,tE(y)?y=kp(y,0):eE(y)?y=jp(y,0):/^complex/.test(p)&&(A/=2),d=a(g,A,p),d===null)return d;if(Ip(d)||_p(d))return d.set(y),d;for(E=Vp(aE(y)).accessors[0],q=Vp(p).accessors[1],T=0;T0){for(p=oE(Ft(c.byteLength)),p=vE(t.length-1,p),g=t[p],y=0;y1&&(e.length=lg(t,e,1,r,t>2)),e}fg.exports=e4});var pg=l(function(lL,mg){"use strict";var t4=cg();mg.exports=t4});var yg=l(function(fL,gg){"use strict";var i4=typeof SharedArrayBuffer=="function"?SharedArrayBuffer:null;gg.exports=i4});var qg=l(function(cL,dg){"use strict";function a4(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.")}dg.exports=a4});var xg=l(function(mL,hg){"use strict";var n4=require("@stdlib/assert/has-sharedarraybuffer-support"),u4=yg(),o4=qg(),Mt;n4()?Mt=u4:Mt=o4;hg.exports=Mt});var Tg=l(function(pL,Eg){"use strict";var Nr=require("@stdlib/utils/define-nonenumerable-read-only-property"),wg=require("@stdlib/assert/has-own-property"),bg=require("@stdlib/assert/is-function"),s4=require("@stdlib/assert/is-collection"),v4=require("@stdlib/assert/is-plain-object"),l4=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,f4=U(),Ag=require("@stdlib/symbol/iterator"),c4=z(),m4=Y(),p4=k(),Hr=require("@stdlib/string/format");function Pt(r){var e,t,i,n,o,u,a,s,v,f;if(!s4(r))throw new TypeError(Hr("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(n={iter:1e308,dir:1},arguments.length>1)if(v4(arguments[1])){if(t=arguments[1],arguments.length>2){if(a=arguments[2],!bg(a))throw new TypeError(Hr("invalid argument. Callback argument must be a function. Value: `%s`.",a));e=arguments[3]}if(wg(t,"iter")&&(n.iter=t.iter,!l4(t.iter)))throw new TypeError(Hr("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter));if(wg(t,"dir")&&(n.dir=t.dir,t.dir!==1&&t.dir!==-1))throw new TypeError(Hr("invalid option. `%s` option must be either `1` or `-1`. Option: `%s`.","dir",t.dir))}else{if(a=arguments[1],!bg(a))throw new TypeError(Hr("invalid argument. Second argument must be either a function or an options object. Value: `%s`.",a));e=arguments[2]}return i=0,o={},a?n.dir===1?(f=-1,Nr(o,"next",m)):(f=r.length,Nr(o,"next",c)):n.dir===1?(f=-1,Nr(o,"next",p)):(f=r.length,Nr(o,"next",g)),Nr(o,"return",y),Ag&&Nr(o,Ag,d),v=p4(r),f4(r)?s=c4(v):s=m4(v),o;function m(){return f=(f+1)%r.length,i+=1,u||i>n.iter||r.length===0?{done:!0}:{value:a.call(e,s(r,f),f,i,r),done:!1}}function c(){return f-=1,f<0&&(f+=r.length),i+=1,u||i>n.iter||r.length===0?{done:!0}:{value:a.call(e,s(r,f),f,i,r),done:!1}}function p(){return f=(f+1)%r.length,i+=1,u||i>n.iter||r.length===0?{done:!0}:{value:s(r,f),done:!1}}function g(){return f-=1,f<0&&(f+=r.length),i+=1,u||i>n.iter||r.length===0?{done:!0}:{value:s(r,f),done:!1}}function y(q){return u=!0,arguments.length?{value:q,done:!0}:{done:!0}}function d(){return a?Pt(r,n,a,e):Pt(r,n)}}Eg.exports=Pt});var Cg=l(function(gL,Sg){"use strict";var g4=Tg();Sg.exports=g4});var _g=l(function(yL,Vg){"use strict";var Se=require("@stdlib/utils/define-nonenumerable-read-only-property"),y4=require("@stdlib/assert/is-function"),d4=require("@stdlib/assert/is-collection"),q4=U(),jg=require("@stdlib/symbol/iterator"),h4=z(),x4=Y(),w4=k(),kg=require("@stdlib/string/format");function Ut(r){var e,t,i,n,o,u,a;if(!d4(r))throw new TypeError(kg("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(n=arguments[1],!y4(n))throw new TypeError(kg("invalid argument. Second argument must be a function. Value: `%s`.",n));e=arguments[2]}return a=-1,t={},n?Se(t,"next",s):Se(t,"next",v),Se(t,"return",f),jg&&Se(t,jg,m),u=w4(r),q4(r)?o=h4(u):o=x4(u),t;function s(){return a+=1,i||a>=r.length?{done:!0}:{value:n.call(e,o(r,a),a,r),done:!1}}function v(){return a+=1,i||a>=r.length?{done:!0}:{value:o(r,a),done:!1}}function f(c){return i=!0,arguments.length?{value:c,done:!0}:{done:!0}}function m(){return n?Ut(r,n,e):Ut(r)}}Vg.exports=Ut});var Lg=l(function(dL,Ig){"use strict";var b4=_g();Ig.exports=b4});var Bg=l(function(qL,Rg){"use strict";var Ce=require("@stdlib/utils/define-nonenumerable-read-only-property"),A4=require("@stdlib/assert/is-function"),E4=require("@stdlib/assert/is-collection"),T4=U(),Og=require("@stdlib/symbol/iterator"),S4=z(),C4=Y(),j4=k(),Fg=require("@stdlib/string/format");function zt(r){var e,t,i,n,o,u,a,s;if(!E4(r))throw new TypeError(Fg("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(n=arguments[1],!A4(n))throw new TypeError(Fg("invalid argument. Second argument must be a function. Value: `%s`.",n));e=arguments[2]}return o=r.length,s=o,t={},n?Ce(t,"next",v):Ce(t,"next",f),Ce(t,"return",m),Og&&Ce(t,Og,c),a=j4(r),T4(r)?u=S4(a):u=C4(a),t;function v(){return s+=r.length-o-1,o=r.length,i||s<0?(i=!0,{done:!0}):{value:n.call(e,u(r,s),s,r),done:!1}}function f(){return s+=r.length-o-1,o=r.length,i||s<0?(i=!0,{done:!0}):{value:u(r,s),done:!1}}function m(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function c(){return n?zt(r,n,e):zt(r)}}Rg.exports=zt});var Mg=l(function(hL,Ng){"use strict";var k4=Bg();Ng.exports=k4});var Ug=l(function(xL,Pg){"use strict";var V4=fr(),_4=vr(),I4=lr(),L4=sr(),O4=or(),F4=ur(),R4=nr(),B4=tr(),N4=er(),M4=yr(),P4=dr(),U4=[[N4,"Float64Array"],[B4,"Float32Array"],[F4,"Int32Array"],[R4,"Uint32Array"],[L4,"Int16Array"],[O4,"Uint16Array"],[V4,"Int8Array"],[_4,"Uint8Array"],[I4,"Uint8ClampedArray"],[M4,"Complex64Array"],[P4,"Complex128Array"]];Pg.exports=U4});var Dg=l(function(wL,zg){"use strict";var z4=require("@stdlib/assert/instance-of"),D4=require("@stdlib/utils/constructor-name"),Y4=require("@stdlib/utils/get-prototype-of"),Mr=Ug();function G4(r){var e,t;for(t=0;t1){if(n=arguments[1],!rT(n))throw new TypeError(Xg("invalid argument. Second argument must be a function. Value: `%s`.",n));e=arguments[2]}return a=-1,t={},n?je(t,"next",s):je(t,"next",v),je(t,"return",f),Kg&&je(t,Kg,m),u=nT(r),tT(r)?o=iT(u):o=aT(u),t;function s(){var c;if(i)return{done:!0};for(c=r.length,a+=1;a=c?(i=!0,{done:!0}):{value:n.call(e,o(r,a),a,r),done:!1}}function v(){var c;if(i)return{done:!0};for(c=r.length,a+=1;a=c?(i=!0,{done:!0}):{value:o(r,a),done:!1}}function f(c){return i=!0,arguments.length?{value:c,done:!0}:{done:!0}}function m(){return n?Dt(r,n,e):Dt(r)}}Hg.exports=Dt});var Qg=l(function(TL,$g){"use strict";var uT=Jg();$g.exports=uT});var iy=l(function(SL,ty){"use strict";var ke=require("@stdlib/utils/define-nonenumerable-read-only-property"),oT=require("@stdlib/assert/is-function"),sT=require("@stdlib/assert/is-collection"),vT=U(),ry=require("@stdlib/symbol/iterator"),lT=z(),fT=Y(),cT=k(),ey=require("@stdlib/string/format");function Yt(r){var e,t,i,n,o,u,a,s;if(!sT(r))throw new TypeError(ey("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(n=arguments[1],!oT(n))throw new TypeError(ey("invalid argument. Second argument must be a function. Value: `%s`.",n));e=arguments[2]}return o=r.length,s=o,t={},n?ke(t,"next",v):ke(t,"next",f),ke(t,"return",m),ry&&ke(t,ry,c),a=cT(r),vT(r)?u=lT(a):u=fT(a),t;function v(){if(i)return{done:!0};for(s+=r.length-o-1,o=r.length;s>=0&&u(r,s)===void 0;)s-=1;return s<0?(i=!0,{done:!0}):{value:n.call(e,u(r,s),s,r),done:!1}}function f(){if(i)return{done:!0};for(s+=r.length-o-1,o=r.length;s>=0&&u(r,s)===void 0;)s-=1;return s<0?(i=!0,{done:!0}):{value:u(r,s),done:!1}}function m(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function c(){return n?Yt(r,n,e):Yt(r)}}ty.exports=Yt});var ny=l(function(CL,ay){"use strict";var mT=iy();ay.exports=mT});var vy=l(function(jL,sy){"use strict";var Ve=require("@stdlib/utils/define-nonenumerable-read-only-property"),pT=require("@stdlib/assert/is-function"),gT=require("@stdlib/assert/is-collection"),uy=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yT=require("@stdlib/assert/is-integer").isPrimitive,dT=U(),oy=require("@stdlib/symbol/iterator"),qT=z(),hT=Y(),xT=k(),Jr=require("@stdlib/string/format");function Gt(r,e,t,i){var n,o,u,a,s,v,f,m;if(!uy(r))throw new TypeError(Jr("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!gT(e))throw new TypeError(Jr("invalid argument. Second argument must be an array-like object. Value: `%s`.",e));if(!yT(t))throw new TypeError(Jr("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(!uy(i))throw new TypeError(Jr("invalid argument. Fourth argument must be a nonnegative integer. Value: `%s`.",i));if(arguments.length>4){if(a=arguments[4],!pT(a))throw new TypeError(Jr("invalid argument. Fifth argument must be a function. Value: `%s`.",a));n=arguments[5]}return s=i,m=-1,o={},a?Ve(o,"next",c):Ve(o,"next",p),Ve(o,"return",g),oy&&Ve(o,oy,y),f=xT(e),dT(e)?v=qT(f):v=hT(f),o;function c(){var d;return m+=1,u||m>=r?{done:!0}:(d=a.call(n,v(e,s),s,m,e),s+=t,{value:d,done:!1})}function p(){var d;return m+=1,u||m>=r?{done:!0}:(d=v(e,s),s+=t,{value:d,done:!1})}function g(d){return u=!0,arguments.length?{value:d,done:!0}:{done:!0}}function y(){return a?Gt(r,e,t,i,a,n):Gt(r,e,t,i)}}sy.exports=Gt});var fy=l(function(kL,ly){"use strict";var wT=vy();ly.exports=wT});var gy=l(function(VL,py){"use strict";var _e=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ie=require("@stdlib/assert/is-function"),bT=require("@stdlib/assert/is-collection"),cy=require("@stdlib/assert/is-integer").isPrimitive,AT=U(),my=require("@stdlib/symbol/iterator"),ET=z(),TT=Y(),ST=k(),Le=require("@stdlib/string/format");function Wt(r){var e,t,i,n,o,u,a,s,v,f;if(!bT(r))throw new TypeError(Le("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,a=r.length;else if(i===2)Ie(arguments[1])?(t=0,u=arguments[1]):t=arguments[1],a=r.length;else if(i===3)Ie(arguments[1])?(t=0,a=r.length,u=arguments[1],e=arguments[2]):Ie(arguments[2])?(t=arguments[1],a=r.length,u=arguments[2]):(t=arguments[1],a=arguments[2]);else{if(t=arguments[1],a=arguments[2],u=arguments[3],!Ie(u))throw new TypeError(Le("invalid argument. Fourth argument must be a function. Value: `%s`.",u));e=arguments[4]}if(!cy(t))throw new TypeError(Le("invalid argument. Second argument must be either an integer (starting index) or a function. Value: `%s`.",t));if(!cy(a))throw new TypeError(Le("invalid argument. Third argument must be either an integer (ending index) or a function. Value: `%s`.",a));return a<0?(a=r.length+a,a<0&&(a=0)):a>r.length&&(a=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=t-1,n={},u?_e(n,"next",m):_e(n,"next",c),_e(n,"return",p),my&&_e(n,my,g),v=ST(r),AT(r)?s=ET(v):s=TT(v),n;function m(){return f+=1,o||f>=a?{done:!0}:{value:u.call(e,s(r,f),f,f-t,r),done:!1}}function c(){return f+=1,o||f>=a?{done:!0}:{value:s(r,f),done:!1}}function p(y){return o=!0,arguments.length?{value:y,done:!0}:{done:!0}}function g(){return u?Wt(r,t,a,u,e):Wt(r,t,a)}}py.exports=Wt});var dy=l(function(_L,yy){"use strict";var CT=gy();yy.exports=CT});var wy=l(function(IL,xy){"use strict";var Oe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fe=require("@stdlib/assert/is-function"),jT=require("@stdlib/assert/is-collection"),qy=require("@stdlib/assert/is-integer").isPrimitive,kT=U(),hy=require("@stdlib/symbol/iterator"),VT=z(),_T=Y(),IT=k(),Re=require("@stdlib/string/format");function Zt(r){var e,t,i,n,o,u,a,s,v,f;if(!jT(r))throw new TypeError(Re("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,a=r.length;else if(i===2)Fe(arguments[1])?(t=0,u=arguments[1]):t=arguments[1],a=r.length;else if(i===3)Fe(arguments[1])?(t=0,a=r.length,u=arguments[1],e=arguments[2]):Fe(arguments[2])?(t=arguments[1],a=r.length,u=arguments[2]):(t=arguments[1],a=arguments[2]);else{if(t=arguments[1],a=arguments[2],u=arguments[3],!Fe(u))throw new TypeError(Re("invalid argument. Fourth argument must be a function. Value: `%s`.",u));e=arguments[4]}if(!qy(t))throw new TypeError(Re("invalid argument. Second argument must be either an integer (starting view index) or a function. Value: `%s`.",t));if(!qy(a))throw new TypeError(Re("invalid argument. Third argument must be either an integer (ending view index) or a function. Value: `%s`.",a));return a<0?(a=r.length+a,a<0&&(a=0)):a>r.length&&(a=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=a,n={},u?Oe(n,"next",m):Oe(n,"next",c),Oe(n,"return",p),hy&&Oe(n,hy,g),v=IT(r),kT(r)?s=VT(v):s=_T(v),n;function m(){return f-=1,o||f1&&(e=arguments[1]),kC(r.length,e)}i1.exports=VC});var u1=l(function(kO,n1){"use strict";var _C=a1();n1.exports=_C});var b=require("@stdlib/utils/define-read-only-property"),w={};b(w,"base",af());b(w,"ArrayBuffer",lt());b(w,"Complex64Array",yr());b(w,"Complex128Array",dr());b(w,"convertArray",gt());b(w,"convertArraySame",bf());b(w,"arrayCtors",Tr());b(w,"DataView",jf());b(w,"datespace",Ff());b(w,"arrayDataType",k());b(w,"arrayDataTypes",Pf());b(w,"aempty",qt());b(w,"aemptyLike",vc());b(w,"filledarray",dc());b(w,"filledarrayBy",Cc());b(w,"Float32Array",tr());b(w,"Float64Array",er());b(w,"iterator2array",Ic());b(w,"afull",jr());b(w,"afullLike",Pc());b(w,"incrspace",Yc());b(w,"Int8Array",fr());b(w,"Int16Array",sr());b(w,"Int32Array",ur());b(w,"linspace",Bm());b(w,"logspace",Dm());b(w,"arrayMinDataType",Jm());b(w,"anans",tp());b(w,"anansLike",up());b(w,"arrayNextDataType",fp());b(w,"aones",gp());b(w,"aonesLike",hp());b(w,"typedarraypool",Np());b(w,"arrayPromotionRules",Yp());b(w,"reviveTypedArray",Hp());b(w,"arraySafeCasts",tg());b(w,"arraySameKindCasts",sg());b(w,"arrayShape",pg());b(w,"SharedArrayBuffer",xg());b(w,"circarray2iterator",Cg());b(w,"array2iterator",Lg());b(w,"array2iteratorRight",Mg());b(w,"typedarray2json",Zg());b(w,"sparsearray2iterator",Qg());b(w,"sparsearray2iteratorRight",ny());b(w,"stridedarray2iterator",fy());b(w,"arrayview2iterator",dy());b(w,"arrayview2iteratorRight",Ay());b(w,"typedarray",Cy());b(w,"complexarray",Ry());b(w,"complexarrayCtors",Xt());b(w,"complexarrayDataTypes",Uy());b(w,"typedarrayCtors",Rr());b(w,"typedarrayDataTypes",Wy());b(w,"floatarrayCtors",St());b(w,"floatarrayDataTypes",Jy());b(w,"intarrayCtors",i0());b(w,"intarrayDataTypes",s0());b(w,"realarray",c0());b(w,"realarrayCtors",q0());b(w,"realarrayDataTypes",A0());b(w,"realarrayFloatCtors",k0());b(w,"realarrayFloatDataTypes",O0());b(w,"intarraySignedCtors",P0());b(w,"intarraySignedDataTypes",G0());b(w,"intarrayUnsignedCtors",J0());b(w,"intarrayUnsignedDataTypes",t1());b(w,"Uint8Array",vr());b(w,"Uint8ClampedArray",lr());b(w,"Uint16Array",or());b(w,"Uint32Array",nr());b(w,"azeros",pe());b(w,"azerosLike",u1());b(w,"constants",require("@stdlib/constants/array"));module.exports=w;
/**
* @license Apache-2.0
*
diff --git a/dist/index.js.map b/dist/index.js.map
index a27c1ac5..e7a9e3ca 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-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/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/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/incrspace/lib/main.js", "../base/incrspace/lib/index.js", "../base/last/lib/main.js", "../base/last/lib/index.js", "../base/linspace/lib/main.js", "../base/linspace/lib/index.js", "../base/logspace/lib/main.js", "../base/logspace/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/take/lib/main.js", "../base/take/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/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 get = 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 get = 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 ) {\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 ) {\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// 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 ) );\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* 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* 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\tvar buf;\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\tbuf = this._buffer;\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+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*\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 ];\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// 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// 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* 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* 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\tvar buf;\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\tbuf = this._buffer;\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\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*\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// 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-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 - 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* 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-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 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 - 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* 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 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 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 - 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* 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 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 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 - 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* 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 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 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 ] ); // 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 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 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 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 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 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 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 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 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 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) 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 accessorGetter = require( './../../../base/accessor-getter' );\nvar getter = require( './../../../base/getter' );\nvar dtype = require( './../../../dtype' );\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 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 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 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 [ 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/* eslint-disable max-depth */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Flattens a five-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 = flatten5d( x, [ 2, 1, 1, 1, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ];\n*\n* var out = flatten5d( x, [ 2, 1, 1, 1, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten5d( x, shape, colexicographic ) {\n\tvar out;\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 a0;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\n\t// Extract loop variables:\n\tS0 = shape[ 4 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = 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\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tout.push( x[ i4 ][ i3 ][ i2 ][ i1 ][ i0 ] ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\t\t}\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 ( i4 = 0; i4 < S4; i4++ ) {\n\t\ta3 = x[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\ta2 = a3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta1 = a2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\ta0 = a1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tout.push( a0[ i0 ] ); // equivalent to storing in row-major (C-style) order\n\t\t\t\t\t}\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 = flatten5d;\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-depth */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Flattens a five-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 = flatten5d( x, [ 2, 1, 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 = flatten5d( x, [ 2, 1, 1, 1, 2 ], true, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten5d( x, shape, colexicographic, out, stride, offset ) {\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 a0;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar io;\n\n\t// Extract loop variables:\n\tS0 = shape[ 4 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = 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\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tout[ io ] = x[ i4 ][ i3 ][ i2 ][ i1 ][ i0 ]; // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\t\t\tio += stride;\n\t\t\t\t\t\t}\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 ( i4 = 0; i4 < S4; i4++ ) {\n\t\ta3 = x[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\ta2 = a3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta1 = a2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\ta0 = a1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tout[ io ] = a0[ i0 ]; // equivalent to storing in row-major (C-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}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten5d;\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 five-dimensional nested array.\n*\n* @module @stdlib/array/base/flatten5d\n*\n* @example\n* var flatten5d = require( '@stdlib/array/base/flatten5d' );\n*\n* var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ];\n*\n* var out = flatten5d( x, [ 2, 1, 1, 1, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var flatten5d = require( '@stdlib/array/base/flatten5d' );\n*\n* var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ];\n*\n* var out = flatten5d( x, [ 2, 1, 1, 1, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten5d = require( '@stdlib/array/base/flatten5d' );\n*\n* var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten5d.assign( x, [ 2, 1, 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-depth, max-len */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Flattens a five-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 = flatten5dBy( x, [ 2, 1, 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 = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flatten5dBy( x, shape, colexicographic, clbk, thisArg ) {\n\tvar out;\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 a0;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\n\t// Extract loop variables:\n\tS0 = shape[ 4 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = 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\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tout.push( clbk.call( thisArg, x[ i4 ][ i3 ][ i2 ][ i1 ][ i0 ], [ i4, i3, i2, i1, i0 ], x ) ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\t\t}\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 ( i4 = 0; i4 < S4; i4++ ) {\n\t\ta3 = x[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\ta2 = a3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta1 = a2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\ta0 = a1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tout.push( clbk.call( thisArg, a0[ i0 ], [ i4, i3, i2, i1, i0 ], x ) ); // equivalent to storing in row-major (C-style) order\n\t\t\t\t\t}\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 = flatten5dBy;\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-depth, max-len */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Flattens a five-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 = flatten5dBy( x, [ 2, 1, 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 = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], true, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flatten5dBy( x, shape, colexicographic, out, stride, offset, clbk, thisArg ) {\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 a0;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar io;\n\n\t// Extract loop variables:\n\tS0 = shape[ 4 ]; // for nested arrays, the last dimensions have the fastest changing indices\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = 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\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tout[ io ] = clbk.call( thisArg, x[ i4 ][ i3 ][ i2 ][ i1 ][ i0 ], [ i4, i3, i2, i1, i0 ], x ); // equivalent to storing in column-major (Fortran-style) order\n\t\t\t\t\t\t\tio += stride;\n\t\t\t\t\t\t}\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 ( i4 = 0; i4 < S4; i4++ ) {\n\t\ta3 = x[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\ta2 = a3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta1 = a2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\ta0 = a1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tout[ io ] = clbk.call( thisArg, a0[ i0 ], [ i4, i3, i2, i1, i0 ], x ); // equivalent to storing in row-major (C-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}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten5dBy;\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 five-dimensional nested array according to a callback function.\n*\n* @module @stdlib/array/base/flatten5d-by\n*\n* @example\n* var flatten5dBy = require( '@stdlib/array/base/flatten5d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ];\n*\n* var out = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var flatten5dBy = require( '@stdlib/array/base/flatten5d-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ [ [ [ 1, 2 ] ] ] ], [ [ [ [ 3, 4 ] ] ] ] ];\n*\n* var out = flatten5dBy( x, [ 2, 1, 1, 1, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten5dBy = require( '@stdlib/array/base/flatten5d-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 = flatten5dBy.assign( x, [ 2, 1, 1, 1, 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) 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 ceil = require( '@stdlib/math/base/special/ceil' );\n\n\n// MAIN //\n\n/**\n* Generates a linearly spaced numeric array according to a provided increment.\n*\n* @param {number} x1 - first array value\n* @param {number} x2 - array element bound\n* @param {number} increment - increment\n* @returns {Array} linearly spaced numeric array\n*\n* @example\n* var arr = incrspace( 0, 11, 2 );\n* // returns [ 0, 2, 4, 6, 8, 10 ]\n*/\nfunction incrspace( x1, x2, increment ) {\n\tvar arr;\n\tvar len;\n\tvar i;\n\n\tlen = ceil( ( x2-x1 ) / increment );\n\tif ( len <= 1 ) {\n\t\treturn [ x1 ];\n\t}\n\tarr = [ x1 ];\n\tfor ( i = 1; i < len; i++ ) {\n\t\tarr.push( x1 + (increment*i) );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = incrspace;\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* Generate a linearly spaced numeric array according to a provided increment.\n*\n* @module @stdlib/array/base/incrspace\n*\n* @example\n* var incrspace = require( '@stdlib/array/base/incrspace' );\n*\n* var arr = incrspace( 0, 11, 2 );\n* // returns [ 0, 2, 4, 6, 8, 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) 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 the last element of an array-like object.\n*\n* @param {Collection} arr - input array\n* @returns {*} - last element\n*\n* @example\n* var out = last( [ 1, 2, 3 ] );\n* // returns 3\n*/\nfunction last( arr ) {\n\tvar get;\n\tvar idx;\n\tvar dt;\n\n\t// Resolve the input array data type:\n\tdt = dtype( arr );\n\n\t// Resolve an accessor for retrieving input array elements:\n\tif ( isAccessorArray( arr ) ) {\n\t\tget = accessorGetter( dt );\n\t} else {\n\t\tget = getter( dt );\n\t}\n\t// Resolve the last index:\n\tidx = arr.length - 1;\n\n\t// Return the last element:\n\tif ( idx < 0 ) {\n\t\treturn;\n\t}\n\treturn get( arr, idx );\n}\n\n\n// EXPORTS //\n\nmodule.exports = last;\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 last element of an array-like object.\n*\n* @module @stdlib/array/base/last\n*\n* @example\n* var last = require( '@stdlib/array/base/last' );\n*\n* var out = last( [ 1, 2, 3 ] );\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) 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* Generates a linearly spaced numeric array.\n*\n* @param {number} x1 - first array value\n* @param {number} x2 - last array value\n* @param {NonNegativeInteger} len - length of output array\n* @returns {Array} linearly spaced numeric array\n*\n* @example\n* var arr = linspace( 0, 100, 6 );\n* // returns [ 0, 20, 40, 60, 80, 100 ]\n*/\nfunction linspace( x1, x2, len ) {\n\tvar arr;\n\tvar N;\n\tvar d;\n\tvar i;\n\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\t// Calculate the increment:\n\tN = len - 1;\n\td = ( x2-x1 ) / N;\n\n\t// Build the output array...\n\tarr = [ x1 ];\n\tfor ( i = 1; i < N; i++ ) {\n\t\tarr.push( x1 + (d*i) );\n\t}\n\tarr.push( x2 );\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = linspace;\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* Generate a linearly spaced numeric array.\n*\n* @module @stdlib/array/base/linspace\n*\n* @example\n* var linspace = require( '@stdlib/array/base/linspace' );\n*\n* var arr = linspace( 0, 100, 6 );\n* // returns [ 0, 20, 40, 60, 80, 100 ]\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 pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Generates a logarithmically spaced numeric array.\n*\n* @param {number} a - exponent of start value\n* @param {number} b - exponent of end value\n* @param {NonNegativeInteger} len - length of output array\n* @returns {Array} logarithmically spaced numeric array\n*\n* @example\n* var arr = logspace( 0, 2, 6 );\n* // returns [ 1, ~2.5, ~6.31, ~15.85, ~39.81, 100 ]\n*/\nfunction logspace( a, b, len ) {\n\tvar arr;\n\tvar N;\n\tvar d;\n\tvar i;\n\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\t// Calculate the increment:\n\tN = len - 1;\n\td = ( b-a ) / N;\n\n\t// Build the output array...\n\tarr = [ pow( 10, a ) ];\n\tfor ( i = 1; i < N; i++ ) {\n\t\tarr.push( pow( 10, a+(d*i) ) );\n\t}\n\tarr.push( pow( 10, b ) );\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = logspace;\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* Generate a logarithmically spaced numeric array.\n*\n* @module @stdlib/array/base/logspace\n*\n* @example\n* var logspace = require( '@stdlib/array/base/logspace' );\n*\n* var arr = logspace( 0, 2, 6 );\n* // returns [ 1, ~2.5, ~6.31, ~15.85, ~39.81, 100 ]\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 the n-fold Cartesian product.\n*\n* ## Notes\n*\n* - 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 product of the size of each provided array (set). 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 each 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} x1 - first input array\n* @param {ArrayLikeObject} x2 - second input array\n* @param {ArrayLikeObject} [...args] - additional input arrays\n* @returns {Array} list of ordered tuples comprising the n-fold Cartesian product\n*\n* @example\n* var x1 = [ 1, 2, 3 ];\n* var x2 = [ 4, 5 ];\n*\n* var out = nCartesianProduct( x1, x2 );\n* // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ]\n*/\nfunction nCartesianProduct( x1, x2 ) {\n\tvar nargs;\n\tvar dims;\n\tvar arr;\n\tvar out;\n\tvar tmp;\n\tvar arg;\n\tvar idx;\n\tvar N;\n\tvar s;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tnargs = arguments.length;\n\n\t// Initialize the list of arrays:\n\tarr = [ x1, x2 ];\n\n\t// Initialize the list of array dimensions (equivalent to ndarray shape):\n\tdims = [ x1.length, x2.length ];\n\n\t// Initialize a list of indices for indexing into each array (equivalent to ndarray subscripts):\n\tidx = [ 0, 0 ];\n\n\t// Compute the total number of ordered tuples:\n\tN = dims[ 0 ] * dims[ 1 ];\n\n\t// Update loop variables for any additional arrays...\n\tfor ( i = 2; i < nargs; i++ ) {\n\t\targ = arguments[ i ];\n\t\tarr.push( arg );\n\t\tdims.push( arg.length );\n\t\tidx.push( 0 );\n\t\tN *= dims[ i ];\n\t}\n\t// Compute the n-fold Cartesian product...\n\tout = [];\n\tfor ( i = 0; i < N; 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 = nargs-1; j >= 0; j-- ) {\n\t\t\ts = k % dims[ j ];\n\t\t\tk -= s;\n\t\t\tk /= dims[ j ];\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 < nargs; j++ ) {\n\t\t\ttmp.push( arr[ j ][ idx[ j ] ] );\n\t\t}\n\t\tout.push( tmp );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nCartesianProduct;\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 n-fold Cartesian product.\n*\n* @module @stdlib/array/base/n-cartesian-product\n*\n* @example\n* var nCartesianProduct = require( '@stdlib/array/base/n-cartesian-product' );\n*\n* var x1 = [ 1, 2, 3 ];\n* var x2 = [ 4, 5 ];\n*\n* var out = nCartesianProduct( 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) 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* Generates a linearly spaced numeric array whose elements increment by 1 starting from one.\n*\n* @param {number} n - number of elements\n* @returns {Array} linearly spaced numeric array\n*\n* @example\n* var arr = oneTo( 6 );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction oneTo( n ) {\n\tvar arr;\n\tvar i;\n\n\tarr = [];\n\tif ( n <= 0 ) {\n\t\treturn arr;\n\t}\n\tfor ( i = 1; i < n+1; i++ ) {\n\t\tarr.push( i );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = oneTo;\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* Generate a linearly spaced numeric array whose elements increment by 1 starting from one.\n*\n* @module @stdlib/array/base/one-to\n*\n* @example\n* var oneTo = require( '@stdlib/array/base/one-to' );\n*\n* var arr = oneTo( 6 );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\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 \"generic\" array filled with ones.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = ones( 3 );\n* // returns [ 1.0, 1.0, 1.0 ]\n*/\nfunction ones( len ) {\n\treturn filled( 1.0, len );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ones;\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 \"generic\" array filled with ones.\n*\n* @module @stdlib/array/base/ones\n*\n* @example\n* var ones = require( '@stdlib/array/base/ones' );\n*\n* var out = ones( 3 );\n* // returns [ 1.0, 1.0, 1.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 filled2d = require( './../../../base/filled2d' );\n\n\n// MAIN //\n\n/**\n* Returns a two-dimensional nested array filled with ones.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {ArrayArray} filled array\n*\n* @example\n* var out = ones2d( [ 1, 3 ] );\n* // returns [ [ 1.0, 1.0, 1.0 ] ]\n*/\nfunction ones2d( shape ) {\n\treturn filled2d( 1.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ones2d;\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 two-dimensional nested array filled with ones.\n*\n* @module @stdlib/array/base/ones2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n*\n* var out = ones2d( [ 1, 3 ] );\n* // returns [ [ 1.0, 1.0, 1.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 filled3d = require( './../../../base/filled3d' );\n\n\n// MAIN //\n\n/**\n* Returns a three-dimensional nested array filled with ones.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = ones3d( [ 1, 1, 3 ] );\n* // returns [ [ [ 1.0, 1.0, 1.0 ] ] ]\n*/\nfunction ones3d( shape ) {\n\treturn filled3d( 1.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ones3d;\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 three-dimensional nested array filled with ones.\n*\n* @module @stdlib/array/base/ones3d\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n*\n* var out = ones3d( [ 1, 1, 3 ] );\n* // returns [ [ [ 1.0, 1.0, 1.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 filled4d = require( './../../../base/filled4d' );\n\n\n// MAIN //\n\n/**\n* Returns a four-dimensional nested array filled with ones.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = ones4d( [ 1, 1, 1, 3 ] );\n* // returns [ [ [ [ 1.0, 1.0, 1.0 ] ] ] ]\n*/\nfunction ones4d( shape ) {\n\treturn filled4d( 1.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ones4d;\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 four-dimensional nested array filled with ones.\n*\n* @module @stdlib/array/base/ones4d\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n*\n* var out = ones4d( [ 1, 1, 1, 3 ] );\n* // returns [ [ [ [ 1.0, 1.0, 1.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 filled5d = require( './../../../base/filled5d' );\n\n\n// MAIN //\n\n/**\n* Returns a five-dimensional nested array filled with ones.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = ones5d( [ 1, 1, 1, 1, 3 ] );\n* // returns [ [ [ [ [ 1.0, 1.0, 1.0 ] ] ] ] ]\n*/\nfunction ones5d( shape ) {\n\treturn filled5d( 1.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ones5d;\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 five-dimensional nested array filled with ones.\n*\n* @module @stdlib/array/base/ones5d\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n*\n* var out = ones5d( [ 1, 1, 1, 1, 3 ] );\n* // returns [ [ [ [ [ 1.0, 1.0, 1.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 fillednd = require( './../../../base/fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns an n-dimensional nested array filled with ones.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = onesnd( [ 3 ] );\n* // returns [ 1.0, 1.0, 1.0 ]\n*\n* @example\n* var out = onesnd( [ 1, 3 ] );\n* // returns [ [ 1.0, 1.0, 1.0 ] ]\n*/\nfunction onesnd( shape ) {\n\treturn fillednd( 1.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = onesnd;\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 an n-dimensional nested array filled with ones.\n*\n* @module @stdlib/array/base/onesnd\n*\n* @example\n* var onesnd = require( '@stdlib/array/base/onesnd' );\n*\n* var out = onesnd( [ 1, 3 ] );\n* // returns [ [ 1.0, 1.0, 1.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* Takes elements from an array.\n*\n* @param {Collection} x - input array\n* @param {NonNegativeIntegerArray} indices - list of indices\n* @returns {Array} output array\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n* var indices = [ 3, 1, 2, 0 ];\n*\n* var y = take( x, indices );\n* // returns [ 4, 2, 3, 1 ]\n*/\nfunction take( x, indices ) {\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tfor ( i = 0; i < indices.length; i++ ) {\n\t\tout.push( x[ indices[ i ] ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = take;\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* Take elements from an array.\n*\n* @module @stdlib/array/base/take\n*\n* @example\n* var take = require( '@stdlib/array/base/take' );\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var indices = [ 0, 0, 1, 1, 3, 3 ];\n* var y = take( x, indices );\n* // returns [ 1, 1, 2, 2, 4, 4 ]\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 AccessorArray = require( './../../../base/accessor' );\n\n\n// MAIN //\n\n/**\n* Converts an array-like object to a minimal array-like object supporting the accessor protocol.\n*\n* ## Notes\n*\n* - If a provided array-like object already supports the accessor protocol, the function returns the provided array-like object; otherwise, the function wraps the provided value in a object which uses accessors for getting and setting elements.\n*\n* @param {Collection} arr - input array\n* @throws {TypeError} must provide an array-like object\n* @returns {(Collection|AccessorArray)} array-like object supporting the accessor protocol\n*\n* @example\n* var o = toAccessorArray( [ 1, 2, 3 ] );\n* // returns \n*\n* var v = o.get( 0 );\n* // returns 1\n*/\nfunction toAccessorArray( arr ) {\n\tif ( arr && typeof arr === 'object' && isAccessorArray( arr ) ) {\n\t\treturn arr;\n\t}\n\treturn new AccessorArray( arr );\n}\n\n\n// EXPORTS //\n\nmodule.exports = toAccessorArray;\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* Convert an array-like object to a minimal array-like object supporting the accessor protocol.\n*\n* @module @stdlib/array/base/to-accessor-array\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );\n*\n* var o = toAccessorArray( [ 1, 2, 3 ] );\n* // returns