diff --git a/complex64/README.md b/complex64/README.md
index 032fcdf1..a7ca4298 100644
--- a/complex64/README.md
+++ b/complex64/README.md
@@ -1926,6 +1926,36 @@ var str = arr.toString();
// returns '1 + 1i,2 - 2i,3 + 3i'
```
+
+
+#### Complex128Array.prototype.with( index, value )
+
+Returns a new typed array with the element at a provided index replaced with a provided value.
+
+```javascript
+var realf = require( '@stdlib/complex/realf' );
+var imagf = require( '@stdlib/complex/imagf' );
+var Complex64 = require( '@stdlib/complex/float32' );
+
+var arr = new Complex64Array( 3 );
+
+arr.set( [ 1.0, 1.0 ], 0 );
+arr.set( [ 2.0, 2.0 ], 1 );
+arr.set( [ 3.0, 3.0 ], 1 );
+
+var out = arr.with( 0, new Complex64( 4.0, 4.0 ) );
+// returns
+
+var z = out.get( 0 );
+// returns
+
+var re = realf( z );
+// returns 4.0
+
+var im = imagf( z );
+// returns 4.0
+```
+
diff --git a/complex64/benchmark/benchmark.with.js b/complex64/benchmark/benchmark.with.js
new file mode 100644
index 00000000..72732c14
--- /dev/null
+++ b/complex64/benchmark/benchmark.with.js
@@ -0,0 +1,58 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var Complex64 = require( '@stdlib/complex/float32' );
+var isComplex64Array = require( '@stdlib/assert/is-complex64array' );
+var pkg = require( './../package.json' ).name;
+var Complex64Array = require( './../lib' );
+
+
+// MAIN //
+
+bench( pkg+':with', function benchmark( b ) {
+ var values;
+ var arr;
+ var out;
+ var i;
+
+ values = [
+ new Complex64( 1.0, 1.0 ),
+ new Complex64( 2.0, 2.0 ),
+ new Complex64( 3.0, 3.0 )
+ ];
+ arr = new Complex64Array( 5 );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ out = arr.with( i%arr.length, values[ i%values.length ] );
+ if ( typeof out !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !isComplex64Array( out ) ) {
+ b.fail( 'should return a Complex64Array' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/complex64/benchmark/benchmark.with.length.js b/complex64/benchmark/benchmark.with.length.js
new file mode 100644
index 00000000..cb9e156e
--- /dev/null
+++ b/complex64/benchmark/benchmark.with.length.js
@@ -0,0 +1,102 @@
+/**
+* @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 pow = require( '@stdlib/math/base/special/pow' );
+var Complex64 = require( '@stdlib/complex/float32' );
+var isComplex64Array = require('@stdlib/assert/is-complex64array' );
+var pkg = require( './../package.json' ).name;
+var Complex64Array = require( './../lib' );
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ var arr = new Complex64Array( len );
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var values;
+ var out;
+ var i;
+
+ values = [
+ new Complex64( 1.0, 1.0 ),
+ new Complex64( 2.0, 2.0 ),
+ new Complex64( 3.0, 3.0 )
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ out = arr.with( i%len, values[ i%values.length ] );
+ if ( typeof out !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !isComplex64Array( out ) ) {
+ b.fail( 'should return a Complex64Array' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+/**
+* Main execution sequence.
+*
+* @private
+*/
+function main() {
+ var len;
+ var min;
+ var max;
+ var f;
+ var i;
+
+ min = 1; // 10^min
+ max = 6; // 10^max
+
+ for ( i = min; i <= max; i++ ) {
+ len = pow( 10, i );
+ f = createBenchmark( len );
+ bench( pkg+':with:len='+len, f );
+ }
+}
+
+main();
diff --git a/complex64/docs/types/index.d.ts b/complex64/docs/types/index.d.ts
index 78aff18c..bdef0870 100644
--- a/complex64/docs/types/index.d.ts
+++ b/complex64/docs/types/index.d.ts
@@ -983,6 +983,41 @@ declare class Complex64Array implements Complex64ArrayInterface {
* // returns '1 + 1i,2 + 2i'
*/
toString(): string;
+
+ /**
+ * Returns a new typed array with the element at a provided index replaced with a provided value.
+ *
+ * @param index - element index
+ * @param value - new value
+ * @throws first argument must be an integer
+ * @throws second argument must be a complex number
+ * @throws index argument is out-of-bounds
+ * @returns modified typed array
+ *
+ * @example
+ * var realf = require( '@stdlib/complex/realf' );
+ * var imagf = require( '@stdlib/complex/imagf' );
+ * var Complex64 = require( '@stdlib/complex/float32' );
+ *
+ * var arr = new Complex64Array( 3 );
+ *
+ * arr.set( [ 1.0, 1.0 ], 0 );
+ * arr.set( [ 2.0, 2.0 ], 1 );
+ * arr.set( [ 3.0, 3.0 ], 2 );
+ *
+ * var out = arr.with( 0, new Complex64( 4.0, 4.0 ) );
+ * // returns
+ *
+ * var z = out.get( 0 );
+ * // returns
+ *
+ * var re = realf( z );
+ * // returns 4.0
+ *
+ * var im = imagf( z );
+ * // returns 4.0
+ */
+ with( index: number, value: ComplexLike ): Complex64Array;
}
/**
diff --git a/complex64/lib/main.js b/complex64/lib/main.js
index 13d03b69..fa465c17 100644
--- a/complex64/lib/main.js
+++ b/complex64/lib/main.js
@@ -2123,6 +2123,70 @@ setReadOnly( Complex64Array.prototype, 'toString', function toString() {
return out.join( ',' );
});
+/**
+* Returns a new typed array with the element at a provided index replaced with a provided value.
+*
+* @name with
+* @memberof Complex64Array.prototype
+* @type {Function}
+* @param {integer} index - element index
+* @param {ComplexLike} value - new value
+* @throws {TypeError} `this` must be a complex number array
+* @throws {TypeError} first argument must be an integer
+* @throws {RangeError} index argument is out-of-bounds
+* @throws {TypeError} second argument must be a complex number
+* @returns {Complex64Array} new typed array
+*
+* @example
+* var realf = require( '@stdlib/complex/realf' );
+* var imagf = require( '@stdlib/complex/imagf' );
+* var Complex64 = require( '@stdlib/complex/float32' );
+*
+* var arr = new Complex64Array( 3 );
+*
+* arr.set( [ 1.0, 1.0 ], 0 );
+* arr.set( [ 2.0, 2.0 ], 1 );
+* arr.set( [ 3.0, 3.0 ], 2 );
+*
+* var out = arr.with( 0, new Complex64( 4.0, 4.0 ) );
+* // returns
+*
+* var z = out.get( 0 );
+* // returns
+*
+* var re = realf( z );
+* // returns 4.0
+*
+* var im = imagf( z );
+* // returns 4.0
+*/
+setReadOnly( Complex64Array.prototype, 'with', function copyWith( index, value ) {
+ var buf;
+ var out;
+ var len;
+ if ( !isComplexArray( this ) ) {
+ throw new TypeError( 'invalid invocation. `this` is not a complex number array.' );
+ }
+ if ( !isInteger( index ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );
+ }
+ len = this._length;
+ if ( index < 0 ) {
+ index += len;
+ }
+ if ( index < 0 || index >= len ) {
+ throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );
+ }
+ if ( !isComplexLike( value ) ) {
+ throw new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );
+ }
+ out = new this.constructor( this._buffer );
+ buf = out._buffer; // eslint-disable-line no-underscore-dangle
+ buf[ 2*index ] = realf( value );
+ buf[ (2*index)+1 ] = imagf( value );
+ return out;
+});
+
// EXPORTS //
diff --git a/complex64/test/test.with.js b/complex64/test/test.with.js
new file mode 100644
index 00000000..64afe7df
--- /dev/null
+++ b/complex64/test/test.with.js
@@ -0,0 +1,203 @@
+/**
+* @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 hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var isFunction = require( '@stdlib/assert/is-function' );
+var Float32Array = require( './../../float32' );
+var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );
+var Complex64 = require( '@stdlib/complex/float32' );
+var Complex64Array = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof Complex64Array, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'attached to the prototype of the main export is a `with` method', function test( t ) {
+ t.strictEqual( hasOwnProp( Complex64Array.prototype, 'with' ), true, 'has property' );
+ t.strictEqual( isFunction( Complex64Array.prototype.with ), true, 'has method' );
+ t.end();
+});
+
+tape( 'the method throws an error if invoked with a `this` context which is not a complex number array instance', function test( t ) {
+ var values;
+ var arr;
+ var i;
+
+ arr = new Complex64Array( 5 );
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ {},
+ [],
+ function noop() {}
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ return arr.with.call( value, 0, new Complex64( 1.0, 1.0 ) );
+ };
+ }
+});
+
+tape( 'the method throws an error if provided a first argument which is not an integer', function test( t ) {
+ var values;
+ var arr;
+ var i;
+
+ arr = new Complex64Array( 5 );
+
+ values = [
+ '5',
+ 3.14,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ {},
+ [],
+ function noop() {}
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ return arr.with( value, new Complex64( 1.0, 1.0 ) );
+ };
+ }
+});
+
+tape( 'the method throws an error if provided a first argument which is not in bounds', function test( t ) {
+ var values;
+ var arr;
+ var i;
+
+ arr = new Complex64Array( 10 );
+
+ values = [
+ -11,
+ -12,
+ 11,
+ 12
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), RangeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ return arr.with( value, new Complex64( 1.0, 1.0 ) );
+ };
+ }
+});
+
+tape( 'the method throws an error if provided a second argument which is not a complex number', function test( t ) {
+ var values;
+ var arr;
+ var i;
+
+ arr = new Complex64Array( 10 );
+
+ values = [
+ '5',
+ 3.14,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ {},
+ [],
+ function noop() {}
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ return arr.with( 0, value );
+ };
+ }
+});
+
+tape( 'the method does not change the array length', function test( t ) {
+ var arr;
+ var out;
+
+ arr = new Complex64Array( 10 );
+ out = arr.with( 5, new Complex64( 1.0, 1.0 ) );
+
+ t.strictEqual( out.length, 10, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the method returns a new complex number array with the element at a provided index replaced with a provided value', function test( t ) {
+ var expected;
+ var arr;
+ var out;
+
+ arr = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] );
+ expected = new Float32Array( [ 1.0, 1.0, 5.0, 5.0, 3.0, 3.0, 4.0, 4.0 ] );
+ out = arr.with( 1, new Complex64( 5.0, 5.0 ) );
+
+ t.strictEqual( out instanceof Complex64Array, true, 'returns expected value' );
+ t.deepEqual( reinterpret64( out, 0 ), expected, 'returns expected value' );
+ t.notEqual( out, arr, 'returns new instance' );
+ t.end();
+});
+
+tape( 'the method supports negative indices', function test( t ) {
+ var expected;
+ var arr;
+ var out;
+
+ arr = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
+ expected = new Float32Array( [ 1.0, 1.0, 2.0, 2.0, 1.0, 1.0 ] );
+
+ out = arr.with( -1, new Complex64( 1.0, 1.0 ) );
+
+ t.strictEqual( out instanceof Complex64Array, true, 'returns expected value' );
+ t.deepEqual( reinterpret64( out, 0 ), expected, 'returns expected value' );
+ t.end();
+});
diff --git a/dist/index.js b/dist/index.js
index 47e036ef..dd0dd343 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 bi=l(function(MO,wi){"use strict";var xi="function";function E2(r){return typeof r.get===xi&&typeof r.set===xi}wi.exports=E2});var Q=l(function(BO,Ei){"use strict";var S2=bi();Ei.exports=S2});var Ai=l(function(NO,Ti){"use strict";var Si={float64:T2,float32:A2,int32:_2,int16:V2,int8:k2,uint32:j2,uint16:C2,uint8:F2,uint8c:z2,generic:O2,default:L2};function T2(r,e){return r[e]}function A2(r,e){return r[e]}function _2(r,e){return r[e]}function V2(r,e){return r[e]}function k2(r,e){return r[e]}function j2(r,e){return r[e]}function C2(r,e){return r[e]}function F2(r,e){return r[e]}function z2(r,e){return r[e]}function O2(r,e){return r[e]}function L2(r,e){return r[e]}function R2(r){var e=Si[r];return typeof e=="function"?e:Si.default}Ti.exports=R2});var ar=l(function(PO,_i){"use strict";var M2=Ai();_i.exports=M2});var ji=l(function(IO,ki){"use strict";var Vi={float64:B2,float32:N2,int32:P2,int16:I2,int8:U2,uint32:G2,uint16:D2,uint8:Y2,uint8c:W2,generic:Z2,default:K2};function B2(r,e,t){r[e]=t}function N2(r,e,t){r[e]=t}function P2(r,e,t){r[e]=t}function I2(r,e,t){r[e]=t}function U2(r,e,t){r[e]=t}function G2(r,e,t){r[e]=t}function D2(r,e,t){r[e]=t}function Y2(r,e,t){r[e]=t}function W2(r,e,t){r[e]=t}function Z2(r,e,t){r[e]=t}function K2(r,e,t){r[e]=t}function X2(r){var e=Vi[r];return typeof e=="function"?e:Vi.default}ki.exports=X2});var fe=l(function(UO,Ci){"use strict";var H2=ji();Ci.exports=H2});var Oi=l(function(GO,zi){"use strict";var Fi={complex128:J2,complex64:$2,default:Q2};function J2(r,e){return r.get(e)}function $2(r,e){return r.get(e)}function Q2(r,e){return r.get(e)}function rx(r){var e=Fi[r];return typeof e=="function"?e:Fi.default}zi.exports=rx});var rr=l(function(DO,Li){"use strict";var ex=Oi();Li.exports=ex});var Bi=l(function(YO,Mi){"use strict";var Ri={complex128:tx,complex64:ix,default:ax};function tx(r,e,t){r.set(t,e)}function ix(r,e,t){r.set(t,e)}function ax(r,e,t){r.set(t,e)}function nx(r){var e=Ri[r];return typeof e=="function"?e:Ri.default}Mi.exports=nx});var le=l(function(WO,Ni){"use strict";var ux=Bi();Ni.exports=ux});var Ii=l(function(ZO,Pi){"use strict";var ox={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"};Pi.exports=ox});var Gi=l(function(KO,Ui){"use strict";var vx=typeof Float64Array=="function"?Float64Array:void 0;Ui.exports=vx});var Yi=l(function(XO,Di){"use strict";function sx(){throw new Error("not implemented")}Di.exports=sx});var dr=l(function(HO,Wi){"use strict";var fx=require("@stdlib/assert/has-float64array-support"),lx=Gi(),cx=Yi(),Ke;fx()?Ke=lx:Ke=cx;Wi.exports=Ke});var Ki=l(function(JO,Zi){"use strict";var mx=typeof Float32Array=="function"?Float32Array:void 0;Zi.exports=mx});var Hi=l(function($O,Xi){"use strict";function px(){throw new Error("not implemented")}Xi.exports=px});var hr=l(function(QO,Ji){"use strict";var gx=require("@stdlib/assert/has-float32array-support"),yx=Ki(),dx=Hi(),Xe;gx()?Xe=yx:Xe=dx;Ji.exports=Xe});var Qi=l(function(rL,$i){"use strict";var hx=typeof Uint32Array=="function"?Uint32Array:void 0;$i.exports=hx});var ea=l(function(eL,ra){"use strict";function qx(){throw new Error("not implemented")}ra.exports=qx});var br=l(function(tL,ta){"use strict";var xx=require("@stdlib/assert/has-uint32array-support"),wx=Qi(),bx=ea(),He;xx()?He=wx:He=bx;ta.exports=He});var aa=l(function(iL,ia){"use strict";var Ex=typeof Int32Array=="function"?Int32Array:void 0;ia.exports=Ex});var ua=l(function(aL,na){"use strict";function Sx(){throw new Error("not implemented")}na.exports=Sx});var Er=l(function(nL,oa){"use strict";var Tx=require("@stdlib/assert/has-int32array-support"),Ax=aa(),_x=ua(),Je;Tx()?Je=Ax:Je=_x;oa.exports=Je});var sa=l(function(uL,va){"use strict";var Vx=typeof Uint16Array=="function"?Uint16Array:void 0;va.exports=Vx});var la=l(function(oL,fa){"use strict";function kx(){throw new Error("not implemented")}fa.exports=kx});var Sr=l(function(vL,ca){"use strict";var jx=require("@stdlib/assert/has-uint16array-support"),Cx=sa(),Fx=la(),$e;jx()?$e=Cx:$e=Fx;ca.exports=$e});var pa=l(function(sL,ma){"use strict";var zx=typeof Int16Array=="function"?Int16Array:void 0;ma.exports=zx});var ya=l(function(fL,ga){"use strict";function Ox(){throw new Error("not implemented")}ga.exports=Ox});var Tr=l(function(lL,da){"use strict";var Lx=require("@stdlib/assert/has-int16array-support"),Rx=pa(),Mx=ya(),Qe;Lx()?Qe=Rx:Qe=Mx;da.exports=Qe});var qa=l(function(cL,ha){"use strict";var Bx=typeof Uint8Array=="function"?Uint8Array:void 0;ha.exports=Bx});var wa=l(function(mL,xa){"use strict";function Nx(){throw new Error("not implemented")}xa.exports=Nx});var Ar=l(function(pL,ba){"use strict";var Px=require("@stdlib/assert/has-uint8array-support"),Ix=qa(),Ux=wa(),rt;Px()?rt=Ix:rt=Ux;ba.exports=rt});var Sa=l(function(gL,Ea){"use strict";var Gx=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;Ea.exports=Gx});var Aa=l(function(yL,Ta){"use strict";function Dx(){throw new Error("not implemented")}Ta.exports=Dx});var _r=l(function(dL,_a){"use strict";var Yx=require("@stdlib/assert/has-uint8clampedarray-support"),Wx=Sa(),Zx=Aa(),et;Yx()?et=Wx:et=Zx;_a.exports=et});var ka=l(function(hL,Va){"use strict";var Kx=typeof Int8Array=="function"?Int8Array:void 0;Va.exports=Kx});var Ca=l(function(qL,ja){"use strict";function Xx(){throw new Error("not implemented")}ja.exports=Xx});var Vr=l(function(xL,Fa){"use strict";var Hx=require("@stdlib/assert/has-int8array-support"),Jx=ka(),$x=Ca(),tt;Hx()?tt=Jx:tt=$x;Fa.exports=tt});var Oa=l(function(wL,za){"use strict";var Qx=require("@stdlib/assert/is-array-like-object"),rw=require("@stdlib/assert/is-complex-like"),ew=require("@stdlib/complex/realf"),tw=require("@stdlib/complex/imagf"),iw=require("@stdlib/string/format");function aw(r){var e,t,i;for(e=[];t=r.next(),!t.done;)if(i=t.value,Qx(i)&&i.length>=2)e.push(i[0],i[1]);else if(rw(i))e.push(ew(i),tw(i));else return new TypeError(iw("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}za.exports=aw});var Ra=l(function(bL,La){"use strict";var nw=require("@stdlib/assert/is-array-like-object"),uw=require("@stdlib/assert/is-complex-like"),ow=require("@stdlib/complex/realf"),vw=require("@stdlib/complex/imagf"),sw=require("@stdlib/string/format");function fw(r,e,t){var i,a,n,o;for(i=[],o=-1;a=r.next(),!a.done;)if(o+=1,n=e.call(t,a.value,o),nw(n)&&n.length>=2)i.push(n[0],n[1]);else if(uw(n))i.push(ow(n),vw(n));else return new TypeError(sw("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return i}La.exports=fw});var Ba=l(function(EL,Ma){"use strict";var lw=require("@stdlib/assert/is-complex-like"),cw=require("@stdlib/complex/realf"),mw=require("@stdlib/complex/imagf");function pw(r,e){var t,i,a,n;for(t=e.length,n=0,a=0;at.byteLength-r)throw new RangeError(L("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*nr));t=new fr(t,r,i*2)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(B,"BYTES_PER_ELEMENT",nr);D(B,"name","Complex64Array");D(B,"from",function(e){var t,i,a,n,o,u,v,s,f,c,m,p;if(!er(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(a=arguments[1],!er(a))throw new TypeError(L("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(K(e)){if(s=e.length,a){for(n=new this(s),o=n._buffer,p=0,m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return n}return new this(e)}if(at(e)){if(a){for(s=e.length,e.get&&e.set?v=ww("default"):v=xw("default"),m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return n}return new this(e)}if(Pa(e)&&Ga&&er(e[Wr])){if(o=e[Wr](),!er(o.next))throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a?u=bw(o,a,t):u=Ua(o),u instanceof Error)throw u;for(s=u.length/2,n=new this(s),o=n._buffer,m=0;m=this._length))return or(this._buffer,e)});me(B.prototype,"buffer",function(){return this._buffer.buffer});me(B.prototype,"byteLength",function(){return this._buffer.byteLength});me(B.prototype,"byteOffset",function(){return this._buffer.byteOffset});D(B.prototype,"BYTES_PER_ELEMENT",B.BYTES_PER_ELEMENT);D(B.prototype,"copyWithin",function(e,t){if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,t*2):this._buffer.copyWithin(e*2,t*2,arguments[2]*2),this});D(B.prototype,"entries",function(){var e,t,i,a,n,o,u;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,e=this._buffer,a=this._length,o=-1,u=-2,i={},D(i,"next",v),D(i,"return",s),Wr&&D(i,Wr,f),i;function v(){var c;return o+=1,n||o>=a?{done:!0}:(u+=2,c=new Ia(e[u],e[u+1]),{value:[o,c],done:!1})}function s(c){return n=!0,arguments.length?{value:c,done:!0}:{done:!0}}function f(){return t.entries()}});D(B.prototype,"every",function(e,t){var i,a;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a1){if(!xr(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=n,t<0&&(t=0)),arguments.length>2){if(!xr(i))throw new TypeError(L("invalid argument. Third argument must be an integer. Value: `%s`.",i));i<0&&(i+=n,i<0&&(i=0)),i>n&&(i=n)}else i=n}else t=0,i=n;for(u=Cr(e),v=Fr(e),s=t;s=0;a--)if(n=or(i,a),e.call(t,n,a,this))return n});D(B.prototype,"findLastIndex",function(e,t){var i,a,n;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=this._length-1;a>=0;a--)if(n=or(i,a),e.call(t,n,a,this))return a;return-1});D(B.prototype,"forEach",function(e,t){var i,a,n;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=this._length))return or(this._buffer,e)});D(B.prototype,"includes",function(e,t){var i,a,n,o,u;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!qr(e))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!xr(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=Cr(e),o=Fr(e),i=this._buffer,u=t;u1){if(!xr(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=Cr(e),o=Fr(e),i=this._buffer,u=t;u1){if(!xr(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(n=Cr(e),o=Fr(e),i=this._buffer,u=t;u>=0;u--)if(a=2*u,n===i[a]&&o===i[a+1])return u;return-1});me(B.prototype,"length",function(){return this._length});D(B.prototype,"map",function(e,t){var i,a,n,o,u;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(a=this._buffer,n=new this.constructor(this._length),i=n._buffer,o=0;o1){if(i=arguments[1],!re(i))throw new TypeError(L("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(qr(e)){if(i>=this._length)throw new RangeError(L("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,a[i]=Cr(e),a[i+1]=Fr(e);return}if(K(e)){if(u=e._length,i+u>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=a.byteOffset+i*nr,t.buffer===a.buffer&&t.byteOffsetf){for(n=new fr(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=a.byteOffset+i*nr,t.buffer===a.buffer&&t.byteOffsetf){for(n=new fr(u),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,s=0;sn&&(t=n)}}return e>=n?(n=0,i=a.byteLength):e>=t?(n=0,i=a.byteOffset+e*nr):(n=t-e,i=a.byteOffset+e*nr),new this.constructor(a.buffer,i,n<0?0:n)});D(B.prototype,"toString",function(){var e,t,i;if(!K(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],t=this._buffer,i=0;i=2)e.push(i[0],i[1]);else if(Vw(i))e.push(jw(i),Cw(i));else return new TypeError(kw("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));return e}Ka.exports=Fw});var Ja=l(function(_L,Ha){"use strict";var zw=require("@stdlib/assert/is-array-like-object"),Ow=require("@stdlib/assert/is-complex-like"),Lw=require("@stdlib/string/format"),Rw=require("@stdlib/complex/real"),Mw=require("@stdlib/complex/imag");function Bw(r,e,t){var i,a,n,o;for(i=[],o=-1;a=r.next(),!a.done;)if(o+=1,n=e.call(t,a.value,o),zw(n)&&n.length>=2)i.push(n[0],n[1]);else if(Ow(n))i.push(Rw(n),Mw(n));else return new TypeError(Lw("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return i}Ha.exports=Bw});var Qa=l(function(VL,$a){"use strict";var Nw=require("@stdlib/assert/is-complex-like"),Pw=require("@stdlib/complex/real"),Iw=require("@stdlib/complex/imag");function Uw(r,e){var t,i,a,n;for(t=e.length,n=0,a=0;at.byteLength-r)throw new RangeError(M("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*ur));t=new lr(t,r,i*2)}}return W(this,"_buffer",t),W(this,"_length",t.length/2),this}W(N,"BYTES_PER_ELEMENT",ur);W(N,"name","Complex128Array");W(N,"from",function(e){var t,i,a,n,o,u,v,s,f,c,m,p;if(!tr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(a=arguments[1],!tr(a))throw new TypeError(M("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(H(e)){if(s=e.length,a){for(n=new this(s),o=n._buffer,p=0,m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(M("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return n}return new this(e)}if(ut(e)){if(a){for(s=e.length,e.get&&e.set?v=Kw("default"):v=Zw("default"),m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(M("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return n}return new this(e)}if(en(e)&&nn&&tr(e[Zr])){if(o=e[Zr](),!tr(o.next))throw new TypeError(M("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a?u=Xw(o,a,t):u=an(o),u instanceof Error)throw u;for(s=u.length/2,n=new this(s),o=n._buffer,m=0;m=this._length))return cr(this._buffer,e)});ge(N.prototype,"buffer",function(){return this._buffer.buffer});ge(N.prototype,"byteLength",function(){return this._buffer.byteLength});ge(N.prototype,"byteOffset",function(){return this._buffer.byteOffset});W(N.prototype,"BYTES_PER_ELEMENT",N.BYTES_PER_ELEMENT);W(N.prototype,"copyWithin",function(e,t){if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,t*2):this._buffer.copyWithin(e*2,t*2,arguments[2]*2),this});W(N.prototype,"entries",function(){var e,t,i,a,n,o,u;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,e=this._buffer,a=this._length,o=-1,u=-2,i={},W(i,"next",v),W(i,"return",s),Zr&&W(i,Zr,f),i;function v(){var c;return o+=1,n||o>=a?{done:!0}:(u+=2,c=new tn(e[u],e[u+1]),{value:[o,c],done:!1})}function s(c){return n=!0,arguments.length?{value:c,done:!0}:{done:!0}}function f(){return t.entries()}});W(N.prototype,"every",function(e,t){var i,a;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(e))throw new TypeError(M("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=0;a--)if(n=cr(i,a),e.call(t,n,a,this))return n});W(N.prototype,"findLastIndex",function(e,t){var i,a,n;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(e))throw new TypeError(M("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=this._length-1;a>=0;a--)if(n=cr(i,a),e.call(t,n,a,this))return a;return-1});W(N.prototype,"forEach",function(e,t){var i,a,n;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(e))throw new TypeError(M("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=this._length))return cr(this._buffer,e)});ge(N.prototype,"length",function(){return this._length});W(N.prototype,"includes",function(e,t){var i,a,n,o,u;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!kr(e))throw new TypeError(M("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Or(t))throw new TypeError(M("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=Br(e),o=Nr(e),i=this._buffer,u=t;u1){if(!Or(t))throw new TypeError(M("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=Br(e),o=Nr(e),i=this._buffer,u=t;u1){if(!Or(t))throw new TypeError(M("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(n=Br(e),o=Nr(e),i=this._buffer,u=t;u>=0;u--)if(a=2*u,n===i[a]&&o===i[a+1])return u;return-1});W(N.prototype,"map",function(e,t){var i,a,n,o,u;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(e))throw new TypeError(M("invalid argument. First argument must be a function. Value: `%s`.",e));for(a=this._buffer,n=new this.constructor(this._length),i=n._buffer,o=0;o1){if(i=arguments[1],!ee(i))throw new TypeError(M("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(kr(e)){if(i>=this._length)throw new RangeError(M("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,a[i]=Br(e),a[i+1]=Nr(e);return}if(H(e)){if(u=e._length,i+u>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=a.byteOffset+i*ur,t.buffer===a.buffer&&t.byteOffsetf){for(n=new lr(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=a.byteOffset+i*ur,t.buffer===a.buffer&&t.byteOffsetf){for(n=new lr(u),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,s=0;sn&&(t=n)}}return e>=n?(n=0,i=a.byteLength):e>=t?(n=0,i=a.byteOffset+e*ur):(n=t-e,i=a.byteOffset+e*ur),new this.constructor(a.buffer,i,n<0?0:n)});W(N.prototype,"toString",function(){var e,t,i;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],t=this._buffer,i=0;i=0;s--)if(f=u-o+s,!(f<0)){if(v=e[f],a=t[s],a!==0&&a=0;s--)u=f%o,f-=u,f/=o,a[s]=u;for(i=[],s=0;s=0;n--)i.push(t[n]);e.push(i)}return e}tf.exports=$E});var ht=l(function(HM,nf){"use strict";var QE=af();nf.exports=QE});var of=l(function(JM,uf){"use strict";var rS=ht();function eS(r){var e,t;for(e=[],t=0;t=0;t--)e.push(r[t]);return e}yf.exports=sS});var wt=l(function(aB,hf){"use strict";var fS=df();hf.exports=fS});var xf=l(function(nB,qf){"use strict";var lS=wt();function cS(r){var e,t;for(e=[],t=0;t=0;a--)if(Se(r[a]))return a;return-1}for(a=t;a>=0;a--)if(e===r[a])return a;return-1}function KS(r,e,t,i){var a,n,o;if(a=r.data,n=r.accessors[0],i&&Se(e)){for(o=t;o>=0;o--)if(Se(n(a,o)))return o;return-1}for(o=t;o>=0;o--)if(e===n(a,o))return o;return-1}function XS(r,e,t,i){var a;if(WS(r,"lastIndexOf")&&i===!1)return r.lastIndexOf(e,t);if(t<0){if(t+=r.length,t<0)return-1}else t>r.length&&(t=r.length-1);return a=YS(r),a.accessorProtocol?KS(a,e,t,i):ZS(r,e,t,i)}al.exports=XS});var ol=l(function(AB,ul){"use strict";var HS=nl();ul.exports=HS});var sl=l(function(_B,vl){"use strict";function JS(r,e,t){var i,a,n,o;if(t===0)return[];for(a=t-1,n=(e-r)/a,i=[r],o=1;o=0;m--)f=p%i[m],p-=f,p/=i[m],v[m]=f;for(o=[],m=0;m4&&(a=arguments[4]),c=r[0],m=r[1],v=0;v2){if(arguments.length===3?D0(t)?a=t:(n=t,o=!1):(a=i,n=t),n===0)return[];if(!hA(n)||n<0)throw new TypeError(Ur("invalid argument. Length must be a positive integer. Value: `%s`.",n));if(o){if(!D0(a))throw new TypeError(Ur("invalid argument. Options argument must be an object. Value: `%s`.",a));if(dA(a,"round")){if(!qA(a.round))throw new TypeError(Ur("invalid option. `%s` option must be a string. Option: `%s`.","round",a.round));if(Y0.indexOf(a.round)===-1)throw new Error(Ur('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"round",Y0.join('", "'),a.round))}}}switch(a.round){case"round":s=wA;break;case"ceil":s=bA;break;case"floor":default:s=xA;break}for(v=n-1,c=(e.getTime()-r.getTime())/v,u=new Array(n),f=r,u[0]=f,f=f.getTime(),m=1;m1?i=arguments[1]:i="float64",i==="generic")return XA(r);if(e=HA(i),e===null)throw new TypeError(lg("invalid argument. Second argument must be a supported data type. Value: `%s`.",i));return a=KA(i),u=e*r,i==="complex128"&&(u+=8),n=ZA(u),t=n.byteOffset,i==="complex128"&&(fg(t/e)||(t+=8)),o=new a(n.buffer,t,r),o}cg.exports=JA});var yg=l(function(QP,gg){"use strict";var $A=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,QA=Ir(),r_=Rr(),pg=require("@stdlib/string/format");function e_(r){var e,t;if(!$A(r))throw new TypeError(pg("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(arguments.length>1?e=arguments[1]:e="float64",e==="generic")return r_(r);if(t=QA(e),t===null)throw new TypeError(pg("invalid argument. Second argument must be a recognized data type. Value: `%s`.",e));return new t(r)}gg.exports=e_});var Te=l(function(rI,dg){"use strict";var t_=yg();dg.exports=t_});var xg=l(function(eI,qg){"use strict";var hg=Te();function i_(r){return arguments.length>1?hg(r,arguments[1]):hg(r)}qg.exports=i_});var Mt=l(function(tI,wg){"use strict";var a_=ag(),n_=mg(),u_=xg(),Rt;a_()?Rt=n_:Rt=u_;wg.exports=Rt});var Eg=l(function(iI,bg){"use strict";var o_=Z(),v_=Mt(),s_=require("@stdlib/string/format");function f_(r){var e=o_(r);if(e===null)throw new TypeError(s_("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]),v_(r.length,e)}bg.exports=f_});var Tg=l(function(aI,Sg){"use strict";var l_=Eg();Sg.exports=l_});var Cg=l(function(nI,jg){"use strict";var c_=require("@stdlib/assert/is-string").isPrimitive,Ag=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_g=require("@stdlib/assert/is-collection"),Bt=require("@stdlib/assert/is-arraybuffer"),Vg=require("@stdlib/assert/is-object"),Ae=require("@stdlib/assert/is-function"),m_=Ir(),p_=require("@stdlib/blas/ext/base/gfill"),g_=wr(),y_=require("@stdlib/assert/has-iterator-symbol-support"),_e=require("@stdlib/symbol/iterator"),d_=require("@stdlib/iter/length"),jr=require("@stdlib/string/format"),kg=y_();function h_(r,e){var t,i;for(t=[];i=r.next(),!i.done;)t.push(e);return t}function q_(r,e){var t;for(t=0;t=0&&c_(arguments[e])?(t=arguments[e],e-=1):t="float64",i=m_(t),i===null)throw new TypeError(jr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(e<=0)return[];if(r=arguments[0],o=arguments[1],e===1){if(Ag(o)?n=o:_g(o)&&(n=o.length),n!==void 0)return g_(r,n);if(Bt(o))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(Vg(o)){if(kg===!1)throw new TypeError(jr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",o));if(!Ae(o[_e]))throw new TypeError(jr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));if(o=o[_e](),!Ae(o.next))throw new TypeError(jr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));return h_(o,r)}throw new TypeError(jr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o))}else if(Bt(o))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(jr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o))}if(e<=0)return new i(0);if(e===1)if(o=arguments[1],_g(o))a=new i(o.length);else if(Bt(o))a=new i(o);else if(Ag(o))a=new i(o);else if(Vg(o)){if(kg===!1)throw new TypeError(jr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",o));if(!Ae(o[_e]))throw new TypeError(jr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));if(o=o[_e](),!Ae(o.next))throw new TypeError(jr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));a=new i(d_(o))}else throw new TypeError(jr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));else e===2?a=new i(arguments[1],arguments[2]):a=new i(arguments[1],arguments[2],arguments[3]);return a.length>0&&(/^complex/.test(t)?q_(a,arguments[0]):p_(a.length,arguments[0],a,1)),a}jg.exports=x_});var zg=l(function(uI,Fg){"use strict";var w_=Cg();Fg.exports=w_});var Ig=l(function(oI,Pg){"use strict";var Og=require("@stdlib/assert/is-string").isPrimitive,Lg=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rg=require("@stdlib/assert/is-collection"),Nt=require("@stdlib/assert/is-arraybuffer"),Mg=require("@stdlib/assert/is-object"),Gr=require("@stdlib/assert/is-function"),Pt=Ir(),b_=require("@stdlib/blas/ext/base/gfill-by"),E_=mt(),S_=require("@stdlib/assert/has-iterator-symbol-support"),Ve=require("@stdlib/symbol/iterator"),T_=require("@stdlib/iter/length"),mr=require("@stdlib/string/format"),Bg=S_(),Ng="float64";function A_(r,e,t){var i,a,n;for(i=[],a=-1;n=r.next(),!n.done;)a+=1,i.push(e.call(t,a));return i}function __(r,e,t){var i;for(i=0;i1)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(a=Pt(t),a===null)throw new TypeError(mr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));return new a(0)}if(e<2)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(e-=1,Gr(arguments[e]))if(Gr(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],!Gr(i))throw new TypeError(mr("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&&Og(arguments[e])?(t=arguments[e],e-=1):t=Ng,a=Pt(t),a===null)throw new TypeError(mr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(u=arguments[0],e===0){if(Lg(u)?o=u:Rg(u)&&(o=u.length),o!==void 0)return E_(o,i,r);if(Nt(u))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(Mg(u)){if(Bg===!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(!Gr(u[Ve]))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));if(u=u[Ve](),!Gr(u.next))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));return A_(u,i,r)}throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u))}else if(Nt(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)if(u=arguments[0],Rg(u))n=new a(u.length);else if(Nt(u))n=new a(u);else if(Lg(u))n=new a(u);else if(Mg(u)){if(Bg===!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(!Gr(u[Ve]))throw new TypeError(mr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));if(u=u[Ve](),!Gr(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 a(T_(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===1?n=new a(arguments[0],arguments[1]):n=new a(arguments[0],arguments[1],arguments[2]);return n.length>0&&(/^complex/.test(t)?__(n,i,r):b_(n.length,n,1,v)),n;function v(s,f){return i.call(r,f)}}Pg.exports=V_});var Gg=l(function(vI,Ug){"use strict";var k_=Ig();Ug.exports=k_});var Wg=l(function(sI,Yg){"use strict";var Dg=require("@stdlib/assert/is-function"),j_=require("@stdlib/assert/is-collection"),C_=require("@stdlib/assert/is-iterator-like"),F_=Q(),z_=le(),O_=fe(),L_=Z(),It=require("@stdlib/string/format");function R_(){var r,e,t,i,a,n,o,u,v;if(r=arguments[0],arguments.length>1)if(j_(arguments[1])){if(i=arguments[1],arguments.length>2){if(t=arguments[2],!Dg(t))throw new TypeError(It("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[3]}}else{if(t=arguments[1],!Dg(t))throw new TypeError(It("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[2]}if(!C_(r))throw new TypeError(It("invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `%s`.",r));if(u=-1,i===void 0){if(i=[],t){for(;u+=1,v=r.next(),!v.done;)i.push(t.call(e,v.value,u));return i}for(;v=r.next(),!v.done;)i.push(v.value);return i}if(a=i.length,o=L_(i),F_(i)?n=z_(o):n=O_(o),t){for(;u2?t=arguments[2]:t="float64",t==="generic")return P_(e,r);if(i=N_(t),i===null)throw new TypeError(Xg("invalid argument. Third argument must be a recognized data type. Value: `%s`.",t));return a=new i(r),I_(r,e,a,1),a}Hg.exports=U_});var Dr=l(function(cI,$g){"use strict";var G_=Jg();$g.exports=G_});var ry=l(function(mI,Qg){"use strict";var D_=require("@stdlib/string/format"),Y_=Z(),W_=Dr(),Z_=require("@stdlib/complex/float64"),K_=require("@stdlib/complex/float32");function X_(r,e){var t,i;if(t=Y_(r),t===null)throw new TypeError(D_("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 Z_(e,0):t==="complex64"?i=new K_(e,0):i=e:i=e,W_(r.length,i,t)}Qg.exports=X_});var ty=l(function(pI,ey){"use strict";var H_=ry();ey.exports=H_});var ay=l(function(gI,iy){"use strict";var J_=require("@stdlib/math/base/special/ceil"),Ut=require("@stdlib/assert/is-number").isPrimitive,Gt=require("@stdlib/math/base/assert/is-nan"),Dt=require("@stdlib/string/format"),$_=require("@stdlib/constants/uint32/max"),Q_=St();function rV(r,e,t){var i,a;if(!Ut(r)||Gt(r))throw new TypeError(Dt("invalid argument. Start must be numeric. Value: `%s`.",r));if(!Ut(e)||Gt(e))throw new TypeError(Dt("invalid argument. Stop must be numeric. Value: `%s`.",e));if(arguments.length<3)a=1;else if(a=t,!Ut(a)||Gt(a))throw new TypeError(Dt("invalid argument. Increment must be numeric. Value: `%s`.",a));if(i=J_((e-r)/a),i>$_)throw new RangeError("invalid arguments. Generated array exceeds maximum array length.");return Q_(r,e,a)}iy.exports=rV});var uy=l(function(yI,ny){"use strict";var eV=ay();ny.exports=eV});var vy=l(function(dI,oy){"use strict";var tV=dr(),iV=hr(),aV=Lr(),nV=zr(),uV={float64:tV,float32:iV,complex128:aV,complex64:nV};oy.exports=uV});var fy=l(function(hI,sy){"use strict";var oV=vy();function vV(r){return oV[r]||null}sy.exports=vV});var Yt=l(function(qI,ly){"use strict";var sV=fy();ly.exports=sV});var my=l(function(xI,cy){"use strict";function fV(r,e,t,i){var a,n,o,u;if(t===0)return[];if(t===1)return i?[e]:[r];for(a=[r],i?n=t-1:n=t,o=(e-r)/n,u=1;u3&&(n=VV(i,arguments[3]),n))throw n;if(i.dtype==="generic")return s?AV(u,r,v,e,t,i.endpoint):TV(r,e,t,i.endpoint);if(a=bV(i.dtype),a===null)throw new TypeError(Hr('invalid option. `%s` option must be a real or complex floating-point data type or "generic". Option: `%s`.',"dtype",i.dtype));if(o=new a(t),i.dtype==="complex64")return Fy(EV(o,0),u,r,v,e,t,i.endpoint),o;if(i.dtype==="complex128")return Fy(SV(o,0),u,r,v,e,t,i.endpoint),o;if(s)throw new TypeError('invalid arguments. If either of the first two arguments are complex numbers, the output array data type must be a complex number data type or "generic".');return _V(o,r,e,t,i.endpoint)}zy.exports=jV});var Py=l(function(_I,Ny){"use strict";var CV=require("@stdlib/complex/float32"),FV=require("@stdlib/complex/float64"),Ly=require("@stdlib/complex/real"),Ry=require("@stdlib/complex/imag"),My=require("@stdlib/complex/realf"),By=require("@stdlib/complex/imagf");function zV(r,e,t,i,a,n,o){var u,v,s,f,c,m,p,g,y,d,h,q,b,E;if(n===0)return r;if(v=0,e==="float64"?(s=t,c=0):e==="complex64"?(v+=1,s=My(t),c=By(t)):(s=Ly(t),c=Ry(t)),i==="float64"?(f=a,m=0):i==="complex64"?(v+=1,f=My(a),m=By(a)):(f=Ly(a),m=Ry(a)),v===2?u=CV:u=FV,g=r.data,p=r.accessors[1],n===1)return o?p(g,0,new u(f,m)):p(g,0,new u(s,c)),r;for(p(g,0,new u(s,c)),o?b=n-1:b=n,h=(f-s)/b,q=(m-c)/b,E=1;E3&&(a=UV(i,arguments[3]),a))throw a;if(v=RV(t),v===null&&(v="generic"),v==="complex64")return Ky(MV(t,0),n,r,o,e,t.length,i.endpoint),t;if(v==="complex128")return Ky(BV(t,0),n,r,o,e,t.length,i.endpoint),t;if(u){if(v==="generic")return s=Zy(t),NV(s,n,r,o,e,t.length,i.endpoint),t;throw new TypeError('invalid arguments. If either of the first two arguments are complex numbers, the output array must be a complex number array or a "generic" array-like object.')}return s=Zy(t),s.accessorProtocol?(PV(s,r,e,t.length,i.endpoint),t):(IV(t,r,e,t.length,i.endpoint),t)}Xy.exports=DV});var Qy=l(function(jI,$y){"use strict";var YV=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jy=Oy(),WV=Hy();YV(Jy,"assign",WV);$y.exports=Jy});var i1=l(function(CI,t1){"use strict";var r1=require("@stdlib/assert/is-number").isPrimitive,ZV=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jt=require("@stdlib/string/format"),e1=require("@stdlib/math/base/assert/is-nan"),KV=At();function XV(r,e,t){if(!r1(r)||e1(r))throw new TypeError(Jt("invalid argument. Exponent of start value must be numeric. Value: `%s`.",r));if(!r1(e)||e1(e))throw new TypeError(Jt("invalid argument. Exponent of stop value must be numeric. Value: `%s`.",e));if(arguments.length<3)t=10;else if(!ZV(t))throw new TypeError(Jt("invalid argument. Length must be a nonnegative integer. Value: `%s`.",t));return KV(r,e,t)}t1.exports=XV});var n1=l(function(FI,a1){"use strict";var HV=i1();a1.exports=HV});var l1=l(function(zI,f1){"use strict";var o1=require("@stdlib/math/base/assert/is-integer"),JV=require("@stdlib/math/base/assert/is-negative-zero"),$V=require("@stdlib/assert/is-complex-like"),v1=require("@stdlib/constants/float64/pinf"),s1=require("@stdlib/constants/float64/ninf"),ke=require("@stdlib/constants/float32/smallest-subnormal"),QV=require("@stdlib/constants/float32/max-safe-integer"),rk=require("@stdlib/constants/float32/min-safe-integer"),ek=require("@stdlib/constants/int8/min"),tk=require("@stdlib/constants/int16/min"),ik=require("@stdlib/constants/int32/min"),ak=require("@stdlib/constants/uint8/max"),nk=require("@stdlib/constants/uint16/max"),uk=require("@stdlib/constants/uint32/max");function u1(r){return r!==r||r===v1||r===s1?"float32":o1(r)?r>=rk&&r<=QV?"float32":"float64":r>-ke&&r=ek?"int8":r>=tk?"int16":r>=ik?"int32":"float64":r<=ak?"uint8":r<=nk?"uint16":r<=uk?"uint32":"float64":r>-ke&&r1){if(e=arguments[1],p1.indexOf(e)===-1)throw new TypeError(ck('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',p1.join('", "'),e))}else e="float64";return e==="complex128"?t=mk:e==="complex64"?t=pk:t=NaN,lk(r,t,e)}g1.exports=gk});var h1=l(function(RI,d1){"use strict";var yk=y1();d1.exports=yk});var x1=l(function(MI,q1){"use strict";var dk=Z(),hk=Dr(),qk=require("@stdlib/complex/float64"),xk=require("@stdlib/complex/float32"),$t=require("@stdlib/string/format"),wk=new qk(NaN,NaN),bk=new xk(NaN,NaN),je=["float64","float32","complex128","complex64","generic"];function Ek(r){var e,t;if(e=dk(r),e===null)throw new TypeError($t("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],je.indexOf(e)===-1)throw new TypeError($t('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',je.join('", "'),e))}else if(je.indexOf(e)===-1)throw new TypeError($t('invalid argument. First argument must be one of the following data types: "%s". Value: `%s`.',je.join('", "'),e));return e==="complex128"?t=wk:e==="complex64"?t=bk:t=NaN,hk(r.length,t,e)}q1.exports=Ek});var b1=l(function(BI,w1){"use strict";var Sk=x1();w1.exports=Sk});var E1=l(function(NI,Tk){Tk.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 T1=l(function(PI,S1){"use strict";var Ak=require("@stdlib/utils/keys"),_k=require("@stdlib/assert/has-own-property"),Ce=E1();function Vk(){var r,e,t,i;for(t={},r=Ak(Ce),e=r.length,i=0;i1?e=arguments[1]:e="float64",e==="complex128"?t=Ok:e==="complex64"?t=Lk:t=1,zk(r,t,e)}V1.exports=Rk});var C1=l(function(GI,j1){"use strict";var Mk=k1();j1.exports=Mk});var z1=l(function(DI,F1){"use strict";var Bk=Z(),Nk=Dr(),Pk=require("@stdlib/complex/float64"),Ik=require("@stdlib/complex/float32"),Uk=require("@stdlib/string/format"),Gk=new Pk(1,0),Dk=new Ik(1,0);function Yk(r){var e,t;if(e=Bk(r),e===null)throw new TypeError(Uk("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=Gk:e==="complex64"?t=Dk:t=1,Nk(r.length,t,e)}F1.exports=Yk});var L1=l(function(YI,O1){"use strict";var Wk=z1();O1.exports=Wk});var M1=l(function(WI,R1){"use strict";function Zk(){return{highWaterMark:9007199254740992}}R1.exports=Zk});var P1=l(function(ZI,N1){"use strict";var Kk=require("@stdlib/assert/is-plain-object"),Xk=require("@stdlib/assert/has-own-property"),Hk=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,B1=require("@stdlib/string/format");function Jk(r,e){return Kk(e)?Xk(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Hk(r.highWaterMark))?new TypeError(B1("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","highWaterMark",r.highWaterMark)):null:new TypeError(B1("invalid argument. Options argument must be an object. Value: `%s`.",e))}N1.exports=Jk});var U1=l(function(KI,I1){"use strict";function $k(r){var e,t;for(e=[],t=0;ti.highWaterMark?null:(p=new sj(m),e+=m,p)}function u(m,p,g){var y;return p===0?new m(0):(y=o(cj(p)*dj[g]),y===null?y:new m(y,0,p))}function v(){var m,p,g,y,d,h,q,b,E;if(m=arguments.length,m&&rj(arguments[m-1])?(m-=1,p=arguments[m]):p="float64",g=ei(p),g===null)throw new TypeError(Qt("invalid argument. Must provide a recognized data type. Value: `%s`.",p));if(m<=0)return new g(0);if(ej(arguments[0]))return u(g,arguments[0],p);if(tj(arguments[0])){if(y=arguments[0],b=y.length,uj(y)?y=Y1(y,0):nj(y)?y=D1(y,0):/^complex/.test(p)&&(b/=2),d=u(g,b,p),d===null)return d;if(K1(d)||Z1(d))return d.set(y),d;for(q=W1(vj(y)).accessors[0],h=W1(p).accessors[1],E=0;E0){for(p=lj(ri(m.byteLength)),p=mj(t.length-1,p),g=t[p],y=0;y1&&(e.length=Ad(t,e,1,r,t>2)),e}_d.exports=nC});var jd=l(function(cU,kd){"use strict";var uC=Vd();kd.exports=uC});var Fd=l(function(mU,Cd){"use strict";var oC=typeof SharedArrayBuffer=="function"?SharedArrayBuffer:null;Cd.exports=oC});var Od=l(function(pU,zd){"use strict";function vC(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.")}zd.exports=vC});var Rd=l(function(gU,Ld){"use strict";var sC=require("@stdlib/assert/has-sharedarraybuffer-support"),fC=Fd(),lC=Od(),ai;sC()?ai=fC:ai=lC;Ld.exports=ai});var Id=l(function(yU,Pd){"use strict";var Jr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Md=require("@stdlib/assert/has-own-property"),Bd=require("@stdlib/assert/is-function"),cC=require("@stdlib/assert/is-collection"),mC=require("@stdlib/assert/is-plain-object"),pC=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gC=Q(),Nd=require("@stdlib/symbol/iterator"),yC=rr(),dC=ar(),hC=Z(),ve=require("@stdlib/string/format");function ni(r){var e,t,i,a,n,o,u,v,s,f;if(!cC(r))throw new TypeError(ve("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(a={iter:1e308,dir:1},arguments.length>1)if(mC(arguments[1])){if(t=arguments[1],arguments.length>2){if(u=arguments[2],!Bd(u))throw new TypeError(ve("invalid argument. Callback argument must be a function. Value: `%s`.",u));e=arguments[3]}if(Md(t,"iter")&&(a.iter=t.iter,!pC(t.iter)))throw new TypeError(ve("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter));if(Md(t,"dir")&&(a.dir=t.dir,t.dir!==1&&t.dir!==-1))throw new TypeError(ve("invalid option. `%s` option must be either `1` or `-1`. Option: `%s`.","dir",t.dir))}else{if(u=arguments[1],!Bd(u))throw new TypeError(ve("invalid argument. Second argument must be either a function or an options object. Value: `%s`.",u));e=arguments[2]}return i=0,n={},u?a.dir===1?(f=-1,Jr(n,"next",c)):(f=r.length,Jr(n,"next",m)):a.dir===1?(f=-1,Jr(n,"next",p)):(f=r.length,Jr(n,"next",g)),Jr(n,"return",y),Nd&&Jr(n,Nd,d),s=hC(r),gC(r)?v=yC(s):v=dC(s),n;function c(){return f=(f+1)%r.length,i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:u.call(e,v(r,f),f,i,r),done:!1}}function m(){return f-=1,f<0&&(f+=r.length),i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:u.call(e,v(r,f),f,i,r),done:!1}}function p(){return f=(f+1)%r.length,i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:v(r,f),done:!1}}function g(){return f-=1,f<0&&(f+=r.length),i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:v(r,f),done:!1}}function y(h){return o=!0,arguments.length?{value:h,done:!0}:{done:!0}}function d(){return u?ni(r,a,u,e):ni(r,a)}}Pd.exports=ni});var Gd=l(function(dU,Ud){"use strict";var qC=Id();Ud.exports=qC});var Zd=l(function(hU,Wd){"use strict";var Me=require("@stdlib/utils/define-nonenumerable-read-only-property"),xC=require("@stdlib/assert/is-function"),wC=require("@stdlib/assert/is-collection"),bC=Q(),Dd=require("@stdlib/symbol/iterator"),EC=rr(),SC=ar(),TC=Z(),Yd=require("@stdlib/string/format");function ui(r){var e,t,i,a,n,o,u;if(!wC(r))throw new TypeError(Yd("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!xC(a))throw new TypeError(Yd("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return u=-1,t={},a?Me(t,"next",v):Me(t,"next",s),Me(t,"return",f),Dd&&Me(t,Dd,c),o=TC(r),bC(r)?n=EC(o):n=SC(o),t;function v(){return u+=1,i||u>=r.length?{done:!0}:{value:a.call(e,n(r,u),u,r),done:!1}}function s(){return u+=1,i||u>=r.length?{done:!0}:{value:n(r,u),done:!1}}function f(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function c(){return a?ui(r,a,e):ui(r)}}Wd.exports=ui});var Xd=l(function(qU,Kd){"use strict";var AC=Zd();Kd.exports=AC});var Qd=l(function(xU,$d){"use strict";var Be=require("@stdlib/utils/define-nonenumerable-read-only-property"),_C=require("@stdlib/assert/is-function"),VC=require("@stdlib/assert/is-collection"),kC=Q(),Hd=require("@stdlib/symbol/iterator"),jC=rr(),CC=ar(),FC=Z(),Jd=require("@stdlib/string/format");function oi(r){var e,t,i,a,n,o,u,v;if(!VC(r))throw new TypeError(Jd("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!_C(a))throw new TypeError(Jd("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return n=r.length,v=n,t={},a?Be(t,"next",s):Be(t,"next",f),Be(t,"return",c),Hd&&Be(t,Hd,m),u=FC(r),kC(r)?o=jC(u):o=CC(u),t;function s(){return v+=r.length-n-1,n=r.length,i||v<0?(i=!0,{done:!0}):{value:a.call(e,o(r,v),v,r),done:!1}}function f(){return v+=r.length-n-1,n=r.length,i||v<0?(i=!0,{done:!0}):{value:o(r,v),done:!1}}function c(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return a?oi(r,a,e):oi(r)}}$d.exports=oi});var eh=l(function(wU,rh){"use strict";var zC=Qd();rh.exports=zC});var ih=l(function(bU,th){"use strict";var OC=Vr(),LC=Ar(),RC=_r(),MC=Tr(),BC=Sr(),NC=Er(),PC=br(),IC=hr(),UC=dr(),GC=zr(),DC=Lr(),YC=[[UC,"Float64Array"],[IC,"Float32Array"],[NC,"Int32Array"],[PC,"Uint32Array"],[MC,"Int16Array"],[BC,"Uint16Array"],[OC,"Int8Array"],[LC,"Uint8Array"],[RC,"Uint8ClampedArray"],[GC,"Complex64Array"],[DC,"Complex128Array"]];th.exports=YC});var nh=l(function(EU,ah){"use strict";var WC=require("@stdlib/assert/instance-of"),ZC=require("@stdlib/utils/constructor-name"),KC=require("@stdlib/utils/get-prototype-of"),$r=ih();function XC(r){var e,t;for(t=0;t<$r.length;t++)if(WC(r,$r[t][0]))return $r[t][1];for(;r;){for(e=ZC(r),t=0;t<$r.length;t++)if(e===$r[t][1])return $r[t][1];r=KC(r)}}ah.exports=XC});var oh=l(function(SU,uh){"use strict";var HC=require("@stdlib/assert/is-typed-array"),JC=require("@stdlib/assert/is-complex-typed-array"),$C=require("@stdlib/strided/base/reinterpret-complex64"),QC=require("@stdlib/strided/base/reinterpret-complex128"),rF=require("@stdlib/string/format"),eF=nh();function tF(r){var e,t,i;if(HC(r))e=r;else if(JC(r))r.BYTES_PER_ELEMENT===8?e=$C(r,0):e=QC(r,0);else throw new TypeError(rF("invalid argument. Must provide a typed array. Value: `%s`.",r));for(t={type:eF(r),data:[]},i=0;i1){if(a=arguments[1],!aF(a))throw new TypeError(lh("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return u=-1,t={},a?Ne(t,"next",v):Ne(t,"next",s),Ne(t,"return",f),fh&&Ne(t,fh,c),o=sF(r),uF(r)?n=oF(o):n=vF(o),t;function v(){var m;if(i)return{done:!0};for(m=r.length,u+=1;u=m?(i=!0,{done:!0}):{value:a.call(e,n(r,u),u,r),done:!1}}function s(){var m;if(i)return{done:!0};for(m=r.length,u+=1;u=m?(i=!0,{done:!0}):{value:n(r,u),done:!1}}function f(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function c(){return a?vi(r,a,e):vi(r)}}ch.exports=vi});var gh=l(function(_U,ph){"use strict";var fF=mh();ph.exports=fF});var qh=l(function(VU,hh){"use strict";var Pe=require("@stdlib/utils/define-nonenumerable-read-only-property"),lF=require("@stdlib/assert/is-function"),cF=require("@stdlib/assert/is-collection"),mF=Q(),yh=require("@stdlib/symbol/iterator"),pF=rr(),gF=ar(),yF=Z(),dh=require("@stdlib/string/format");function si(r){var e,t,i,a,n,o,u,v;if(!cF(r))throw new TypeError(dh("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!lF(a))throw new TypeError(dh("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return n=r.length,v=n,t={},a?Pe(t,"next",s):Pe(t,"next",f),Pe(t,"return",c),yh&&Pe(t,yh,m),u=yF(r),mF(r)?o=pF(u):o=gF(u),t;function s(){if(i)return{done:!0};for(v+=r.length-n-1,n=r.length;v>=0&&o(r,v)===void 0;)v-=1;return v<0?(i=!0,{done:!0}):{value:a.call(e,o(r,v),v,r),done:!1}}function f(){if(i)return{done:!0};for(v+=r.length-n-1,n=r.length;v>=0&&o(r,v)===void 0;)v-=1;return v<0?(i=!0,{done:!0}):{value:o(r,v),done:!1}}function c(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return a?si(r,a,e):si(r)}}hh.exports=si});var wh=l(function(kU,xh){"use strict";var dF=qh();xh.exports=dF});var Th=l(function(jU,Sh){"use strict";var Ie=require("@stdlib/utils/define-nonenumerable-read-only-property"),hF=require("@stdlib/assert/is-function"),qF=require("@stdlib/assert/is-collection"),bh=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xF=require("@stdlib/assert/is-integer").isPrimitive,wF=Q(),Eh=require("@stdlib/symbol/iterator"),bF=rr(),EF=ar(),SF=Z(),se=require("@stdlib/string/format");function fi(r,e,t,i){var a,n,o,u,v,s,f,c;if(!bh(r))throw new TypeError(se("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!qF(e))throw new TypeError(se("invalid argument. Second argument must be an array-like object. Value: `%s`.",e));if(!xF(t))throw new TypeError(se("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(!bh(i))throw new TypeError(se("invalid argument. Fourth argument must be a nonnegative integer. Value: `%s`.",i));if(arguments.length>4){if(u=arguments[4],!hF(u))throw new TypeError(se("invalid argument. Fifth argument must be a function. Value: `%s`.",u));a=arguments[5]}return v=i,c=-1,n={},u?Ie(n,"next",m):Ie(n,"next",p),Ie(n,"return",g),Eh&&Ie(n,Eh,y),f=SF(e),wF(e)?s=bF(f):s=EF(f),n;function m(){var d;return c+=1,o||c>=r?{done:!0}:(d=u.call(a,s(e,v),v,c,e),v+=t,{value:d,done:!1})}function p(){var d;return c+=1,o||c>=r?{done:!0}:(d=s(e,v),v+=t,{value:d,done:!1})}function g(d){return o=!0,arguments.length?{value:d,done:!0}:{done:!0}}function y(){return u?fi(r,e,t,i,u,a):fi(r,e,t,i)}}Sh.exports=fi});var _h=l(function(CU,Ah){"use strict";var TF=Th();Ah.exports=TF});var Ch=l(function(FU,jh){"use strict";var Ue=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ge=require("@stdlib/assert/is-function"),AF=require("@stdlib/assert/is-collection"),Vh=require("@stdlib/assert/is-integer").isPrimitive,_F=Q(),kh=require("@stdlib/symbol/iterator"),VF=rr(),kF=ar(),jF=Z(),De=require("@stdlib/string/format");function li(r){var e,t,i,a,n,o,u,v,s,f;if(!AF(r))throw new TypeError(De("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,u=r.length;else if(i===2)Ge(arguments[1])?(t=0,o=arguments[1]):t=arguments[1],u=r.length;else if(i===3)Ge(arguments[1])?(t=0,u=r.length,o=arguments[1],e=arguments[2]):Ge(arguments[2])?(t=arguments[1],u=r.length,o=arguments[2]):(t=arguments[1],u=arguments[2]);else{if(t=arguments[1],u=arguments[2],o=arguments[3],!Ge(o))throw new TypeError(De("invalid argument. Fourth argument must be a function. Value: `%s`.",o));e=arguments[4]}if(!Vh(t))throw new TypeError(De("invalid argument. Second argument must be either an integer (starting index) or a function. Value: `%s`.",t));if(!Vh(u))throw new TypeError(De("invalid argument. Third argument must be either an integer (ending index) or a function. Value: `%s`.",u));return u<0?(u=r.length+u,u<0&&(u=0)):u>r.length&&(u=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=t-1,a={},o?Ue(a,"next",c):Ue(a,"next",m),Ue(a,"return",p),kh&&Ue(a,kh,g),s=jF(r),_F(r)?v=VF(s):v=kF(s),a;function c(){return f+=1,n||f>=u?{done:!0}:{value:o.call(e,v(r,f),f,f-t,r),done:!1}}function m(){return f+=1,n||f>=u?{done:!0}:{value:v(r,f),done:!1}}function p(y){return n=!0,arguments.length?{value:y,done:!0}:{done:!0}}function g(){return o?li(r,t,u,o,e):li(r,t,u)}}jh.exports=li});var zh=l(function(zU,Fh){"use strict";var CF=Ch();Fh.exports=CF});var Mh=l(function(OU,Rh){"use strict";var Ye=require("@stdlib/utils/define-nonenumerable-read-only-property"),We=require("@stdlib/assert/is-function"),FF=require("@stdlib/assert/is-collection"),Oh=require("@stdlib/assert/is-integer").isPrimitive,zF=Q(),Lh=require("@stdlib/symbol/iterator"),OF=rr(),LF=ar(),RF=Z(),Ze=require("@stdlib/string/format");function ci(r){var e,t,i,a,n,o,u,v,s,f;if(!FF(r))throw new TypeError(Ze("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,u=r.length;else if(i===2)We(arguments[1])?(t=0,o=arguments[1]):t=arguments[1],u=r.length;else if(i===3)We(arguments[1])?(t=0,u=r.length,o=arguments[1],e=arguments[2]):We(arguments[2])?(t=arguments[1],u=r.length,o=arguments[2]):(t=arguments[1],u=arguments[2]);else{if(t=arguments[1],u=arguments[2],o=arguments[3],!We(o))throw new TypeError(Ze("invalid argument. Fourth argument must be a function. Value: `%s`.",o));e=arguments[4]}if(!Oh(t))throw new TypeError(Ze("invalid argument. Second argument must be either an integer (starting view index) or a function. Value: `%s`.",t));if(!Oh(u))throw new TypeError(Ze("invalid argument. Third argument must be either an integer (ending view index) or a function. Value: `%s`.",u));return u<0?(u=r.length+u,u<0&&(u=0)):u>r.length&&(u=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=u,a={},o?Ye(a,"next",c):Ye(a,"next",m),Ye(a,"return",p),Lh&&Ye(a,Lh,g),s=RF(r),zF(r)?v=OF(s):v=LF(s),a;function c(){return f-=1,n||f1&&(e=arguments[1]),zO(r.length,e)}q2.exports=OO});var b2=l(function(CG,w2){"use strict";var LO=x2();w2.exports=LO});var _=require("@stdlib/utils/define-read-only-property"),A={};_(A,"base",q0());_(A,"ArrayBuffer",kt());_(A,"Complex64Array",zr());_(A,"Complex128Array",Lr());_(A,"convertArray",Ot());_(A,"convertArraySame",M0());_(A,"arrayCtors",Ir());_(A,"DataView",G0());_(A,"datespace",H0());_(A,"arrayDataType",Z());_(A,"arrayDataTypes",tg());_(A,"aempty",Mt());_(A,"aemptyLike",Tg());_(A,"filledarray",zg());_(A,"filledarrayBy",Gg());_(A,"Float32Array",hr());_(A,"Float64Array",dr());_(A,"iterator2array",Kg());_(A,"afull",Dr());_(A,"afullLike",ty());_(A,"incrspace",uy());_(A,"Int8Array",Vr());_(A,"Int16Array",Tr());_(A,"Int32Array",Er());_(A,"linspace",Qy());_(A,"logspace",n1());_(A,"arrayMinDataType",m1());_(A,"anans",h1());_(A,"anansLike",b1());_(A,"arrayNextDataType",_1());_(A,"aones",C1());_(A,"aonesLike",L1());_(A,"typedarraypool",rd());_(A,"arrayPromotionRules",ud());_(A,"reviveTypedArray",cd());_(A,"arraySafeCasts",hd());_(A,"arraySameKindCasts",Sd());_(A,"arrayShape",jd());_(A,"SharedArrayBuffer",Rd());_(A,"circarray2iterator",Gd());_(A,"array2iterator",Xd());_(A,"array2iteratorRight",eh());_(A,"typedarray2json",sh());_(A,"sparsearray2iterator",gh());_(A,"sparsearray2iteratorRight",wh());_(A,"stridedarray2iterator",_h());_(A,"arrayview2iterator",zh());_(A,"arrayview2iteratorRight",Nh());_(A,"typedarray",Gh());_(A,"complexarray",$h());_(A,"complexarrayCtors",pi());_(A,"complexarrayDataTypes",iq());_(A,"typedarrayCtors",Xr());_(A,"typedarrayDataTypes",vq());_(A,"floatarrayCtors",Yt());_(A,"floatarrayDataTypes",mq());_(A,"intarrayCtors",qq());_(A,"intarrayDataTypes",Sq());_(A,"realarray",Vq());_(A,"realarrayCtors",Oq());_(A,"realarrayDataTypes",Nq());_(A,"realarrayFloatCtors",Yq());_(A,"realarrayFloatDataTypes",Hq());_(A,"intarraySignedCtors",t2());_(A,"intarraySignedDataTypes",o2());_(A,"intarrayUnsignedCtors",m2());_(A,"intarrayUnsignedDataTypes",h2());_(A,"Uint8Array",Ar());_(A,"Uint8ClampedArray",_r());_(A,"Uint16Array",Sr());_(A,"Uint32Array",br());_(A,"azeros",Te());_(A,"azerosLike",b2());_(A,"constants",require("@stdlib/constants/array"));module.exports=A;
+"use strict";var l=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var bi=l(function(MO,wi){"use strict";var xi="function";function E2(r){return typeof r.get===xi&&typeof r.set===xi}wi.exports=E2});var Q=l(function(BO,Ei){"use strict";var S2=bi();Ei.exports=S2});var Ai=l(function(NO,Ti){"use strict";var Si={float64:T2,float32:A2,int32:_2,int16:V2,int8:k2,uint32:j2,uint16:C2,uint8:F2,uint8c:z2,generic:O2,default:L2};function T2(r,e){return r[e]}function A2(r,e){return r[e]}function _2(r,e){return r[e]}function V2(r,e){return r[e]}function k2(r,e){return r[e]}function j2(r,e){return r[e]}function C2(r,e){return r[e]}function F2(r,e){return r[e]}function z2(r,e){return r[e]}function O2(r,e){return r[e]}function L2(r,e){return r[e]}function R2(r){var e=Si[r];return typeof e=="function"?e:Si.default}Ti.exports=R2});var ar=l(function(PO,_i){"use strict";var M2=Ai();_i.exports=M2});var ji=l(function(IO,ki){"use strict";var Vi={float64:B2,float32:N2,int32:P2,int16:I2,int8:U2,uint32:G2,uint16:D2,uint8:Y2,uint8c:W2,generic:Z2,default:K2};function B2(r,e,t){r[e]=t}function N2(r,e,t){r[e]=t}function P2(r,e,t){r[e]=t}function I2(r,e,t){r[e]=t}function U2(r,e,t){r[e]=t}function G2(r,e,t){r[e]=t}function D2(r,e,t){r[e]=t}function Y2(r,e,t){r[e]=t}function W2(r,e,t){r[e]=t}function Z2(r,e,t){r[e]=t}function K2(r,e,t){r[e]=t}function X2(r){var e=Vi[r];return typeof e=="function"?e:Vi.default}ki.exports=X2});var fe=l(function(UO,Ci){"use strict";var H2=ji();Ci.exports=H2});var Oi=l(function(GO,zi){"use strict";var Fi={complex128:J2,complex64:$2,default:Q2};function J2(r,e){return r.get(e)}function $2(r,e){return r.get(e)}function Q2(r,e){return r.get(e)}function rx(r){var e=Fi[r];return typeof e=="function"?e:Fi.default}zi.exports=rx});var rr=l(function(DO,Li){"use strict";var ex=Oi();Li.exports=ex});var Bi=l(function(YO,Mi){"use strict";var Ri={complex128:tx,complex64:ix,default:ax};function tx(r,e,t){r.set(t,e)}function ix(r,e,t){r.set(t,e)}function ax(r,e,t){r.set(t,e)}function nx(r){var e=Ri[r];return typeof e=="function"?e:Ri.default}Mi.exports=nx});var le=l(function(WO,Ni){"use strict";var ux=Bi();Ni.exports=ux});var Ii=l(function(ZO,Pi){"use strict";var ox={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"};Pi.exports=ox});var Gi=l(function(KO,Ui){"use strict";var vx=typeof Float64Array=="function"?Float64Array:void 0;Ui.exports=vx});var Yi=l(function(XO,Di){"use strict";function sx(){throw new Error("not implemented")}Di.exports=sx});var qr=l(function(HO,Wi){"use strict";var fx=require("@stdlib/assert/has-float64array-support"),lx=Gi(),cx=Yi(),Ke;fx()?Ke=lx:Ke=cx;Wi.exports=Ke});var Ki=l(function(JO,Zi){"use strict";var mx=typeof Float32Array=="function"?Float32Array:void 0;Zi.exports=mx});var Hi=l(function($O,Xi){"use strict";function px(){throw new Error("not implemented")}Xi.exports=px});var xr=l(function(QO,Ji){"use strict";var gx=require("@stdlib/assert/has-float32array-support"),yx=Ki(),dx=Hi(),Xe;gx()?Xe=yx:Xe=dx;Ji.exports=Xe});var Qi=l(function(rL,$i){"use strict";var hx=typeof Uint32Array=="function"?Uint32Array:void 0;$i.exports=hx});var ea=l(function(eL,ra){"use strict";function qx(){throw new Error("not implemented")}ra.exports=qx});var br=l(function(tL,ta){"use strict";var xx=require("@stdlib/assert/has-uint32array-support"),wx=Qi(),bx=ea(),He;xx()?He=wx:He=bx;ta.exports=He});var aa=l(function(iL,ia){"use strict";var Ex=typeof Int32Array=="function"?Int32Array:void 0;ia.exports=Ex});var ua=l(function(aL,na){"use strict";function Sx(){throw new Error("not implemented")}na.exports=Sx});var Er=l(function(nL,oa){"use strict";var Tx=require("@stdlib/assert/has-int32array-support"),Ax=aa(),_x=ua(),Je;Tx()?Je=Ax:Je=_x;oa.exports=Je});var sa=l(function(uL,va){"use strict";var Vx=typeof Uint16Array=="function"?Uint16Array:void 0;va.exports=Vx});var la=l(function(oL,fa){"use strict";function kx(){throw new Error("not implemented")}fa.exports=kx});var Sr=l(function(vL,ca){"use strict";var jx=require("@stdlib/assert/has-uint16array-support"),Cx=sa(),Fx=la(),$e;jx()?$e=Cx:$e=Fx;ca.exports=$e});var pa=l(function(sL,ma){"use strict";var zx=typeof Int16Array=="function"?Int16Array:void 0;ma.exports=zx});var ya=l(function(fL,ga){"use strict";function Ox(){throw new Error("not implemented")}ga.exports=Ox});var Tr=l(function(lL,da){"use strict";var Lx=require("@stdlib/assert/has-int16array-support"),Rx=pa(),Mx=ya(),Qe;Lx()?Qe=Rx:Qe=Mx;da.exports=Qe});var qa=l(function(cL,ha){"use strict";var Bx=typeof Uint8Array=="function"?Uint8Array:void 0;ha.exports=Bx});var wa=l(function(mL,xa){"use strict";function Nx(){throw new Error("not implemented")}xa.exports=Nx});var Ar=l(function(pL,ba){"use strict";var Px=require("@stdlib/assert/has-uint8array-support"),Ix=qa(),Ux=wa(),rt;Px()?rt=Ix:rt=Ux;ba.exports=rt});var Sa=l(function(gL,Ea){"use strict";var Gx=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;Ea.exports=Gx});var Aa=l(function(yL,Ta){"use strict";function Dx(){throw new Error("not implemented")}Ta.exports=Dx});var _r=l(function(dL,_a){"use strict";var Yx=require("@stdlib/assert/has-uint8clampedarray-support"),Wx=Sa(),Zx=Aa(),et;Yx()?et=Wx:et=Zx;_a.exports=et});var ka=l(function(hL,Va){"use strict";var Kx=typeof Int8Array=="function"?Int8Array:void 0;Va.exports=Kx});var Ca=l(function(qL,ja){"use strict";function Xx(){throw new Error("not implemented")}ja.exports=Xx});var Vr=l(function(xL,Fa){"use strict";var Hx=require("@stdlib/assert/has-int8array-support"),Jx=ka(),$x=Ca(),tt;Hx()?tt=Jx:tt=$x;Fa.exports=tt});var Oa=l(function(wL,za){"use strict";var Qx=require("@stdlib/assert/is-array-like-object"),rw=require("@stdlib/assert/is-complex-like"),ew=require("@stdlib/complex/realf"),tw=require("@stdlib/complex/imagf"),iw=require("@stdlib/string/format");function aw(r){var e,t,i;for(e=[];t=r.next(),!t.done;)if(i=t.value,Qx(i)&&i.length>=2)e.push(i[0],i[1]);else if(rw(i))e.push(ew(i),tw(i));else return new TypeError(iw("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}za.exports=aw});var Ra=l(function(bL,La){"use strict";var nw=require("@stdlib/assert/is-array-like-object"),uw=require("@stdlib/assert/is-complex-like"),ow=require("@stdlib/complex/realf"),vw=require("@stdlib/complex/imagf"),sw=require("@stdlib/string/format");function fw(r,e,t){var i,a,n,o;for(i=[],o=-1;a=r.next(),!a.done;)if(o+=1,n=e.call(t,a.value,o),nw(n)&&n.length>=2)i.push(n[0],n[1]);else if(uw(n))i.push(ow(n),vw(n));else return new TypeError(sw("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return i}La.exports=fw});var Ba=l(function(EL,Ma){"use strict";var lw=require("@stdlib/assert/is-complex-like"),cw=require("@stdlib/complex/realf"),mw=require("@stdlib/complex/imagf");function pw(r,e){var t,i,a,n;for(t=e.length,n=0,a=0;at.byteLength-r)throw new RangeError(L("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*nr));t=new fr(t,r,i*2)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(B,"BYTES_PER_ELEMENT",nr);D(B,"name","Complex64Array");D(B,"from",function(e){var t,i,a,n,o,u,v,s,f,c,m,p;if(!er(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(a=arguments[1],!er(a))throw new TypeError(L("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(Z(e)){if(s=e.length,a){for(n=new this(s),o=n._buffer,p=0,m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return n}return new this(e)}if(at(e)){if(a){for(s=e.length,e.get&&e.set?v=ww("default"):v=xw("default"),m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return n}return new this(e)}if(Pa(e)&&Ga&&er(e[Wr])){if(o=e[Wr](),!er(o.next))throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a?u=bw(o,a,t):u=Ua(o),u instanceof Error)throw u;for(s=u.length/2,n=new this(s),o=n._buffer,m=0;m=this._length))return or(this._buffer,e)});me(B.prototype,"buffer",function(){return this._buffer.buffer});me(B.prototype,"byteLength",function(){return this._buffer.byteLength});me(B.prototype,"byteOffset",function(){return this._buffer.byteOffset});D(B.prototype,"BYTES_PER_ELEMENT",B.BYTES_PER_ELEMENT);D(B.prototype,"copyWithin",function(e,t){if(!Z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,t*2):this._buffer.copyWithin(e*2,t*2,arguments[2]*2),this});D(B.prototype,"entries",function(){var e,t,i,a,n,o,u;if(!Z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,e=this._buffer,a=this._length,o=-1,u=-2,i={},D(i,"next",v),D(i,"return",s),Wr&&D(i,Wr,f),i;function v(){var c;return o+=1,n||o>=a?{done:!0}:(u+=2,c=new Ia(e[u],e[u+1]),{value:[o,c],done:!1})}function s(c){return n=!0,arguments.length?{value:c,done:!0}:{done:!0}}function f(){return t.entries()}});D(B.prototype,"every",function(e,t){var i,a;if(!Z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a1){if(!cr(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=n,t<0&&(t=0)),arguments.length>2){if(!cr(i))throw new TypeError(L("invalid argument. Third argument must be an integer. Value: `%s`.",i));i<0&&(i+=n,i<0&&(i=0)),i>n&&(i=n)}else i=n}else t=0,i=n;for(u=kr(e),v=jr(e),s=t;s=0;a--)if(n=or(i,a),e.call(t,n,a,this))return n});D(B.prototype,"findLastIndex",function(e,t){var i,a,n;if(!Z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=this._length-1;a>=0;a--)if(n=or(i,a),e.call(t,n,a,this))return a;return-1});D(B.prototype,"forEach",function(e,t){var i,a,n;if(!Z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=this._length))return or(this._buffer,e)});D(B.prototype,"includes",function(e,t){var i,a,n,o,u;if(!Z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!lr(e))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!cr(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=kr(e),o=jr(e),i=this._buffer,u=t;u1){if(!cr(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=kr(e),o=jr(e),i=this._buffer,u=t;u1){if(!cr(t))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(n=kr(e),o=jr(e),i=this._buffer,u=t;u>=0;u--)if(a=2*u,n===i[a]&&o===i[a+1])return u;return-1});me(B.prototype,"length",function(){return this._length});D(B.prototype,"map",function(e,t){var i,a,n,o,u;if(!Z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!er(e))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",e));for(a=this._buffer,n=new this.constructor(this._length),i=n._buffer,o=0;o1){if(i=arguments[1],!re(i))throw new TypeError(L("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(L("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,a[i]=kr(e),a[i+1]=jr(e);return}if(Z(e)){if(u=e._length,i+u>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=a.byteOffset+i*nr,t.buffer===a.buffer&&t.byteOffsetf){for(n=new fr(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=a.byteOffset+i*nr,t.buffer===a.buffer&&t.byteOffsetf){for(n=new fr(u),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,s=0;sn&&(t=n)}}return e>=n?(n=0,i=a.byteLength):e>=t?(n=0,i=a.byteOffset+e*nr):(n=t-e,i=a.byteOffset+e*nr),new this.constructor(a.buffer,i,n<0?0:n)});D(B.prototype,"toString",function(){var e,t,i;if(!Z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],t=this._buffer,i=0;i=n)throw new RangeError(L("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!lr(t))throw new TypeError(L("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return a=new this.constructor(this._buffer),i=a._buffer,i[2*e]=kr(t),i[2*e+1]=jr(t),a});Ya.exports=B});var zr=l(function(TL,Za){"use strict";var Aw=Wa();Za.exports=Aw});var Xa=l(function(AL,Ka){"use strict";var _w=require("@stdlib/assert/is-array-like-object"),Vw=require("@stdlib/assert/is-complex-like"),kw=require("@stdlib/string/format"),jw=require("@stdlib/complex/real"),Cw=require("@stdlib/complex/imag");function Fw(r){var e,t,i;for(e=[];t=r.next(),!t.done;)if(i=t.value,_w(i)&&i.length>=2)e.push(i[0],i[1]);else if(Vw(i))e.push(jw(i),Cw(i));else return new TypeError(kw("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));return e}Ka.exports=Fw});var Ja=l(function(_L,Ha){"use strict";var zw=require("@stdlib/assert/is-array-like-object"),Ow=require("@stdlib/assert/is-complex-like"),Lw=require("@stdlib/string/format"),Rw=require("@stdlib/complex/real"),Mw=require("@stdlib/complex/imag");function Bw(r,e,t){var i,a,n,o;for(i=[],o=-1;a=r.next(),!a.done;)if(o+=1,n=e.call(t,a.value,o),zw(n)&&n.length>=2)i.push(n[0],n[1]);else if(Ow(n))i.push(Rw(n),Mw(n));else return new TypeError(Lw("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return i}Ha.exports=Bw});var Qa=l(function(VL,$a){"use strict";var Nw=require("@stdlib/assert/is-complex-like"),Pw=require("@stdlib/complex/real"),Iw=require("@stdlib/complex/imag");function Uw(r,e){var t,i,a,n;for(t=e.length,n=0,a=0;at.byteLength-r)throw new RangeError(M("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",i*ur));t=new mr(t,r,i*2)}}return W(this,"_buffer",t),W(this,"_length",t.length/2),this}W(N,"BYTES_PER_ELEMENT",ur);W(N,"name","Complex128Array");W(N,"from",function(e){var t,i,a,n,o,u,v,s,f,c,m,p;if(!tr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=arguments.length,i>1){if(a=arguments[1],!tr(a))throw new TypeError(M("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(H(e)){if(s=e.length,a){for(n=new this(s),o=n._buffer,p=0,m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(M("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return n}return new this(e)}if(ut(e)){if(a){for(s=e.length,e.get&&e.set?v=Kw("default"):v=Zw("default"),m=0;m=2)o[p]=c[0],o[p+1]=c[1];else throw new TypeError(M("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));p+=2}return n}return new this(e)}if(en(e)&&nn&&tr(e[Zr])){if(o=e[Zr](),!tr(o.next))throw new TypeError(M("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a?u=Xw(o,a,t):u=an(o),u instanceof Error)throw u;for(s=u.length/2,n=new this(s),o=n._buffer,m=0;m=this._length))return pr(this._buffer,e)});ge(N.prototype,"buffer",function(){return this._buffer.buffer});ge(N.prototype,"byteLength",function(){return this._buffer.byteLength});ge(N.prototype,"byteOffset",function(){return this._buffer.byteOffset});W(N.prototype,"BYTES_PER_ELEMENT",N.BYTES_PER_ELEMENT);W(N.prototype,"copyWithin",function(e,t){if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,t*2):this._buffer.copyWithin(e*2,t*2,arguments[2]*2),this});W(N.prototype,"entries",function(){var e,t,i,a,n,o,u;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,e=this._buffer,a=this._length,o=-1,u=-2,i={},W(i,"next",v),W(i,"return",s),Zr&&W(i,Zr,f),i;function v(){var c;return o+=1,n||o>=a?{done:!0}:(u+=2,c=new tn(e[u],e[u+1]),{value:[o,c],done:!1})}function s(c){return n=!0,arguments.length?{value:c,done:!0}:{done:!0}}function f(){return t.entries()}});W(N.prototype,"every",function(e,t){var i,a;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(e))throw new TypeError(M("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=0;a--)if(n=pr(i,a),e.call(t,n,a,this))return n});W(N.prototype,"findLastIndex",function(e,t){var i,a,n;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(e))throw new TypeError(M("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=this._length-1;a>=0;a--)if(n=pr(i,a),e.call(t,n,a,this))return a;return-1});W(N.prototype,"forEach",function(e,t){var i,a,n;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(e))throw new TypeError(M("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,a=0;a=this._length))return pr(this._buffer,e)});ge(N.prototype,"length",function(){return this._length});W(N.prototype,"includes",function(e,t){var i,a,n,o,u;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Cr(e))throw new TypeError(M("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Or(t))throw new TypeError(M("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=Br(e),o=Nr(e),i=this._buffer,u=t;u1){if(!Or(t))throw new TypeError(M("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=Br(e),o=Nr(e),i=this._buffer,u=t;u1){if(!Or(t))throw new TypeError(M("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(n=Br(e),o=Nr(e),i=this._buffer,u=t;u>=0;u--)if(a=2*u,n===i[a]&&o===i[a+1])return u;return-1});W(N.prototype,"map",function(e,t){var i,a,n,o,u;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(e))throw new TypeError(M("invalid argument. First argument must be a function. Value: `%s`.",e));for(a=this._buffer,n=new this.constructor(this._length),i=n._buffer,o=0;o1){if(i=arguments[1],!ee(i))throw new TypeError(M("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(Cr(e)){if(i>=this._length)throw new RangeError(M("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));i*=2,a[i]=Br(e),a[i+1]=Nr(e);return}if(H(e)){if(u=e._length,i+u>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e._buffer,f=a.byteOffset+i*ur,t.buffer===a.buffer&&t.byteOffsetf){for(n=new mr(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,f=a.byteOffset+i*ur,t.buffer===a.buffer&&t.byteOffsetf){for(n=new mr(u),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(i*=2,s=0;sn&&(t=n)}}return e>=n?(n=0,i=a.byteLength):e>=t?(n=0,i=a.byteOffset+e*ur):(n=t-e,i=a.byteOffset+e*ur),new this.constructor(a.buffer,i,n<0?0:n)});W(N.prototype,"toString",function(){var e,t,i;if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],t=this._buffer,i=0;i=0;s--)if(f=u-o+s,!(f<0)){if(v=e[f],a=t[s],a!==0&&a=0;s--)u=f%o,f-=u,f/=o,a[s]=u;for(i=[],s=0;s=0;n--)i.push(t[n]);e.push(i)}return e}tf.exports=$E});var ht=l(function(HM,nf){"use strict";var QE=af();nf.exports=QE});var of=l(function(JM,uf){"use strict";var rS=ht();function eS(r){var e,t;for(e=[],t=0;t=0;t--)e.push(r[t]);return e}yf.exports=sS});var wt=l(function(aB,hf){"use strict";var fS=df();hf.exports=fS});var xf=l(function(nB,qf){"use strict";var lS=wt();function cS(r){var e,t;for(e=[],t=0;t=0;a--)if(Se(r[a]))return a;return-1}for(a=t;a>=0;a--)if(e===r[a])return a;return-1}function KS(r,e,t,i){var a,n,o;if(a=r.data,n=r.accessors[0],i&&Se(e)){for(o=t;o>=0;o--)if(Se(n(a,o)))return o;return-1}for(o=t;o>=0;o--)if(e===n(a,o))return o;return-1}function XS(r,e,t,i){var a;if(WS(r,"lastIndexOf")&&i===!1)return r.lastIndexOf(e,t);if(t<0){if(t+=r.length,t<0)return-1}else t>r.length&&(t=r.length-1);return a=YS(r),a.accessorProtocol?KS(a,e,t,i):ZS(r,e,t,i)}al.exports=XS});var ol=l(function(AB,ul){"use strict";var HS=nl();ul.exports=HS});var sl=l(function(_B,vl){"use strict";function JS(r,e,t){var i,a,n,o;if(t===0)return[];for(a=t-1,n=(e-r)/a,i=[r],o=1;o=0;m--)f=p%i[m],p-=f,p/=i[m],v[m]=f;for(o=[],m=0;m4&&(a=arguments[4]),c=r[0],m=r[1],v=0;v2){if(arguments.length===3?D0(t)?a=t:(n=t,o=!1):(a=i,n=t),n===0)return[];if(!hA(n)||n<0)throw new TypeError(Ur("invalid argument. Length must be a positive integer. Value: `%s`.",n));if(o){if(!D0(a))throw new TypeError(Ur("invalid argument. Options argument must be an object. Value: `%s`.",a));if(dA(a,"round")){if(!qA(a.round))throw new TypeError(Ur("invalid option. `%s` option must be a string. Option: `%s`.","round",a.round));if(Y0.indexOf(a.round)===-1)throw new Error(Ur('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"round",Y0.join('", "'),a.round))}}}switch(a.round){case"round":s=wA;break;case"ceil":s=bA;break;case"floor":default:s=xA;break}for(v=n-1,c=(e.getTime()-r.getTime())/v,u=new Array(n),f=r,u[0]=f,f=f.getTime(),m=1;m1?i=arguments[1]:i="float64",i==="generic")return XA(r);if(e=HA(i),e===null)throw new TypeError(lg("invalid argument. Second argument must be a supported data type. Value: `%s`.",i));return a=KA(i),u=e*r,i==="complex128"&&(u+=8),n=ZA(u),t=n.byteOffset,i==="complex128"&&(fg(t/e)||(t+=8)),o=new a(n.buffer,t,r),o}cg.exports=JA});var yg=l(function(QP,gg){"use strict";var $A=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,QA=Ir(),r_=Rr(),pg=require("@stdlib/string/format");function e_(r){var e,t;if(!$A(r))throw new TypeError(pg("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(arguments.length>1?e=arguments[1]:e="float64",e==="generic")return r_(r);if(t=QA(e),t===null)throw new TypeError(pg("invalid argument. Second argument must be a recognized data type. Value: `%s`.",e));return new t(r)}gg.exports=e_});var Te=l(function(rI,dg){"use strict";var t_=yg();dg.exports=t_});var xg=l(function(eI,qg){"use strict";var hg=Te();function i_(r){return arguments.length>1?hg(r,arguments[1]):hg(r)}qg.exports=i_});var Mt=l(function(tI,wg){"use strict";var a_=ag(),n_=mg(),u_=xg(),Rt;a_()?Rt=n_:Rt=u_;wg.exports=Rt});var Eg=l(function(iI,bg){"use strict";var o_=K(),v_=Mt(),s_=require("@stdlib/string/format");function f_(r){var e=o_(r);if(e===null)throw new TypeError(s_("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]),v_(r.length,e)}bg.exports=f_});var Tg=l(function(aI,Sg){"use strict";var l_=Eg();Sg.exports=l_});var Cg=l(function(nI,jg){"use strict";var c_=require("@stdlib/assert/is-string").isPrimitive,Ag=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_g=require("@stdlib/assert/is-collection"),Bt=require("@stdlib/assert/is-arraybuffer"),Vg=require("@stdlib/assert/is-object"),Ae=require("@stdlib/assert/is-function"),m_=Ir(),p_=require("@stdlib/blas/ext/base/gfill"),g_=wr(),y_=require("@stdlib/assert/has-iterator-symbol-support"),_e=require("@stdlib/symbol/iterator"),d_=require("@stdlib/iter/length"),Fr=require("@stdlib/string/format"),kg=y_();function h_(r,e){var t,i;for(t=[];i=r.next(),!i.done;)t.push(e);return t}function q_(r,e){var t;for(t=0;t=0&&c_(arguments[e])?(t=arguments[e],e-=1):t="float64",i=m_(t),i===null)throw new TypeError(Fr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(e<=0)return[];if(r=arguments[0],o=arguments[1],e===1){if(Ag(o)?n=o:_g(o)&&(n=o.length),n!==void 0)return g_(r,n);if(Bt(o))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(Vg(o)){if(kg===!1)throw new TypeError(Fr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",o));if(!Ae(o[_e]))throw new TypeError(Fr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));if(o=o[_e](),!Ae(o.next))throw new TypeError(Fr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));return h_(o,r)}throw new TypeError(Fr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o))}else if(Bt(o))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(Fr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o))}if(e<=0)return new i(0);if(e===1)if(o=arguments[1],_g(o))a=new i(o.length);else if(Bt(o))a=new i(o);else if(Ag(o))a=new i(o);else if(Vg(o)){if(kg===!1)throw new TypeError(Fr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",o));if(!Ae(o[_e]))throw new TypeError(Fr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));if(o=o[_e](),!Ae(o.next))throw new TypeError(Fr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));a=new i(d_(o))}else throw new TypeError(Fr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",o));else e===2?a=new i(arguments[1],arguments[2]):a=new i(arguments[1],arguments[2],arguments[3]);return a.length>0&&(/^complex/.test(t)?q_(a,arguments[0]):p_(a.length,arguments[0],a,1)),a}jg.exports=x_});var zg=l(function(uI,Fg){"use strict";var w_=Cg();Fg.exports=w_});var Ig=l(function(oI,Pg){"use strict";var Og=require("@stdlib/assert/is-string").isPrimitive,Lg=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rg=require("@stdlib/assert/is-collection"),Nt=require("@stdlib/assert/is-arraybuffer"),Mg=require("@stdlib/assert/is-object"),Gr=require("@stdlib/assert/is-function"),Pt=Ir(),b_=require("@stdlib/blas/ext/base/gfill-by"),E_=mt(),S_=require("@stdlib/assert/has-iterator-symbol-support"),Ve=require("@stdlib/symbol/iterator"),T_=require("@stdlib/iter/length"),gr=require("@stdlib/string/format"),Bg=S_(),Ng="float64";function A_(r,e,t){var i,a,n;for(i=[],a=-1;n=r.next(),!n.done;)a+=1,i.push(e.call(t,a));return i}function __(r,e,t){var i;for(i=0;i1)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(a=Pt(t),a===null)throw new TypeError(gr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));return new a(0)}if(e<2)throw new TypeError("invalid arguments. Must provide a length, typed array, array-like object, or an iterable.");if(e-=1,Gr(arguments[e]))if(Gr(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],!Gr(i))throw new TypeError(gr("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&&Og(arguments[e])?(t=arguments[e],e-=1):t=Ng,a=Pt(t),a===null)throw new TypeError(gr("invalid argument. Must provide a recognized data type. Value: `%s`.",t));if(t==="generic"){if(u=arguments[0],e===0){if(Lg(u)?o=u:Rg(u)&&(o=u.length),o!==void 0)return E_(o,i,r);if(Nt(u))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(Mg(u)){if(Bg===!1)throw new TypeError(gr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",u));if(!Gr(u[Ve]))throw new TypeError(gr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));if(u=u[Ve](),!Gr(u.next))throw new TypeError(gr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));return A_(u,i,r)}throw new TypeError(gr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u))}else if(Nt(u))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(gr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u))}if(e===0)if(u=arguments[0],Rg(u))n=new a(u.length);else if(Nt(u))n=new a(u);else if(Lg(u))n=new a(u);else if(Mg(u)){if(Bg===!1)throw new TypeError(gr("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",u));if(!Gr(u[Ve]))throw new TypeError(gr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));if(u=u[Ve](),!Gr(u.next))throw new TypeError(gr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));n=new a(T_(u))}else throw new TypeError(gr("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",u));else e===1?n=new a(arguments[0],arguments[1]):n=new a(arguments[0],arguments[1],arguments[2]);return n.length>0&&(/^complex/.test(t)?__(n,i,r):b_(n.length,n,1,v)),n;function v(s,f){return i.call(r,f)}}Pg.exports=V_});var Gg=l(function(vI,Ug){"use strict";var k_=Ig();Ug.exports=k_});var Wg=l(function(sI,Yg){"use strict";var Dg=require("@stdlib/assert/is-function"),j_=require("@stdlib/assert/is-collection"),C_=require("@stdlib/assert/is-iterator-like"),F_=Q(),z_=le(),O_=fe(),L_=K(),It=require("@stdlib/string/format");function R_(){var r,e,t,i,a,n,o,u,v;if(r=arguments[0],arguments.length>1)if(j_(arguments[1])){if(i=arguments[1],arguments.length>2){if(t=arguments[2],!Dg(t))throw new TypeError(It("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[3]}}else{if(t=arguments[1],!Dg(t))throw new TypeError(It("invalid argument. Callback argument must be a function. Value: `%s`.",t));e=arguments[2]}if(!C_(r))throw new TypeError(It("invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `%s`.",r));if(u=-1,i===void 0){if(i=[],t){for(;u+=1,v=r.next(),!v.done;)i.push(t.call(e,v.value,u));return i}for(;v=r.next(),!v.done;)i.push(v.value);return i}if(a=i.length,o=L_(i),F_(i)?n=z_(o):n=O_(o),t){for(;u2?t=arguments[2]:t="float64",t==="generic")return P_(e,r);if(i=N_(t),i===null)throw new TypeError(Xg("invalid argument. Third argument must be a recognized data type. Value: `%s`.",t));return a=new i(r),I_(r,e,a,1),a}Hg.exports=U_});var Dr=l(function(cI,$g){"use strict";var G_=Jg();$g.exports=G_});var ry=l(function(mI,Qg){"use strict";var D_=require("@stdlib/string/format"),Y_=K(),W_=Dr(),Z_=require("@stdlib/complex/float64"),K_=require("@stdlib/complex/float32");function X_(r,e){var t,i;if(t=Y_(r),t===null)throw new TypeError(D_("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 Z_(e,0):t==="complex64"?i=new K_(e,0):i=e:i=e,W_(r.length,i,t)}Qg.exports=X_});var ty=l(function(pI,ey){"use strict";var H_=ry();ey.exports=H_});var ay=l(function(gI,iy){"use strict";var J_=require("@stdlib/math/base/special/ceil"),Ut=require("@stdlib/assert/is-number").isPrimitive,Gt=require("@stdlib/math/base/assert/is-nan"),Dt=require("@stdlib/string/format"),$_=require("@stdlib/constants/uint32/max"),Q_=St();function rV(r,e,t){var i,a;if(!Ut(r)||Gt(r))throw new TypeError(Dt("invalid argument. Start must be numeric. Value: `%s`.",r));if(!Ut(e)||Gt(e))throw new TypeError(Dt("invalid argument. Stop must be numeric. Value: `%s`.",e));if(arguments.length<3)a=1;else if(a=t,!Ut(a)||Gt(a))throw new TypeError(Dt("invalid argument. Increment must be numeric. Value: `%s`.",a));if(i=J_((e-r)/a),i>$_)throw new RangeError("invalid arguments. Generated array exceeds maximum array length.");return Q_(r,e,a)}iy.exports=rV});var uy=l(function(yI,ny){"use strict";var eV=ay();ny.exports=eV});var vy=l(function(dI,oy){"use strict";var tV=qr(),iV=xr(),aV=Lr(),nV=zr(),uV={float64:tV,float32:iV,complex128:aV,complex64:nV};oy.exports=uV});var fy=l(function(hI,sy){"use strict";var oV=vy();function vV(r){return oV[r]||null}sy.exports=vV});var Yt=l(function(qI,ly){"use strict";var sV=fy();ly.exports=sV});var my=l(function(xI,cy){"use strict";function fV(r,e,t,i){var a,n,o,u;if(t===0)return[];if(t===1)return i?[e]:[r];for(a=[r],i?n=t-1:n=t,o=(e-r)/n,u=1;u3&&(n=VV(i,arguments[3]),n))throw n;if(i.dtype==="generic")return s?AV(u,r,v,e,t,i.endpoint):TV(r,e,t,i.endpoint);if(a=bV(i.dtype),a===null)throw new TypeError(Hr('invalid option. `%s` option must be a real or complex floating-point data type or "generic". Option: `%s`.',"dtype",i.dtype));if(o=new a(t),i.dtype==="complex64")return Fy(EV(o,0),u,r,v,e,t,i.endpoint),o;if(i.dtype==="complex128")return Fy(SV(o,0),u,r,v,e,t,i.endpoint),o;if(s)throw new TypeError('invalid arguments. If either of the first two arguments are complex numbers, the output array data type must be a complex number data type or "generic".');return _V(o,r,e,t,i.endpoint)}zy.exports=jV});var Py=l(function(_I,Ny){"use strict";var CV=require("@stdlib/complex/float32"),FV=require("@stdlib/complex/float64"),Ly=require("@stdlib/complex/real"),Ry=require("@stdlib/complex/imag"),My=require("@stdlib/complex/realf"),By=require("@stdlib/complex/imagf");function zV(r,e,t,i,a,n,o){var u,v,s,f,c,m,p,g,y,d,h,q,b,E;if(n===0)return r;if(v=0,e==="float64"?(s=t,c=0):e==="complex64"?(v+=1,s=My(t),c=By(t)):(s=Ly(t),c=Ry(t)),i==="float64"?(f=a,m=0):i==="complex64"?(v+=1,f=My(a),m=By(a)):(f=Ly(a),m=Ry(a)),v===2?u=CV:u=FV,g=r.data,p=r.accessors[1],n===1)return o?p(g,0,new u(f,m)):p(g,0,new u(s,c)),r;for(p(g,0,new u(s,c)),o?b=n-1:b=n,h=(f-s)/b,q=(m-c)/b,E=1;E3&&(a=UV(i,arguments[3]),a))throw a;if(v=RV(t),v===null&&(v="generic"),v==="complex64")return Ky(MV(t,0),n,r,o,e,t.length,i.endpoint),t;if(v==="complex128")return Ky(BV(t,0),n,r,o,e,t.length,i.endpoint),t;if(u){if(v==="generic")return s=Zy(t),NV(s,n,r,o,e,t.length,i.endpoint),t;throw new TypeError('invalid arguments. If either of the first two arguments are complex numbers, the output array must be a complex number array or a "generic" array-like object.')}return s=Zy(t),s.accessorProtocol?(PV(s,r,e,t.length,i.endpoint),t):(IV(t,r,e,t.length,i.endpoint),t)}Xy.exports=DV});var Qy=l(function(jI,$y){"use strict";var YV=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jy=Oy(),WV=Hy();YV(Jy,"assign",WV);$y.exports=Jy});var i1=l(function(CI,t1){"use strict";var r1=require("@stdlib/assert/is-number").isPrimitive,ZV=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jt=require("@stdlib/string/format"),e1=require("@stdlib/math/base/assert/is-nan"),KV=At();function XV(r,e,t){if(!r1(r)||e1(r))throw new TypeError(Jt("invalid argument. Exponent of start value must be numeric. Value: `%s`.",r));if(!r1(e)||e1(e))throw new TypeError(Jt("invalid argument. Exponent of stop value must be numeric. Value: `%s`.",e));if(arguments.length<3)t=10;else if(!ZV(t))throw new TypeError(Jt("invalid argument. Length must be a nonnegative integer. Value: `%s`.",t));return KV(r,e,t)}t1.exports=XV});var n1=l(function(FI,a1){"use strict";var HV=i1();a1.exports=HV});var l1=l(function(zI,f1){"use strict";var o1=require("@stdlib/math/base/assert/is-integer"),JV=require("@stdlib/math/base/assert/is-negative-zero"),$V=require("@stdlib/assert/is-complex-like"),v1=require("@stdlib/constants/float64/pinf"),s1=require("@stdlib/constants/float64/ninf"),ke=require("@stdlib/constants/float32/smallest-subnormal"),QV=require("@stdlib/constants/float32/max-safe-integer"),rk=require("@stdlib/constants/float32/min-safe-integer"),ek=require("@stdlib/constants/int8/min"),tk=require("@stdlib/constants/int16/min"),ik=require("@stdlib/constants/int32/min"),ak=require("@stdlib/constants/uint8/max"),nk=require("@stdlib/constants/uint16/max"),uk=require("@stdlib/constants/uint32/max");function u1(r){return r!==r||r===v1||r===s1?"float32":o1(r)?r>=rk&&r<=QV?"float32":"float64":r>-ke&&r=ek?"int8":r>=tk?"int16":r>=ik?"int32":"float64":r<=ak?"uint8":r<=nk?"uint16":r<=uk?"uint32":"float64":r>-ke&&r1){if(e=arguments[1],p1.indexOf(e)===-1)throw new TypeError(ck('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',p1.join('", "'),e))}else e="float64";return e==="complex128"?t=mk:e==="complex64"?t=pk:t=NaN,lk(r,t,e)}g1.exports=gk});var h1=l(function(RI,d1){"use strict";var yk=y1();d1.exports=yk});var x1=l(function(MI,q1){"use strict";var dk=K(),hk=Dr(),qk=require("@stdlib/complex/float64"),xk=require("@stdlib/complex/float32"),$t=require("@stdlib/string/format"),wk=new qk(NaN,NaN),bk=new xk(NaN,NaN),je=["float64","float32","complex128","complex64","generic"];function Ek(r){var e,t;if(e=dk(r),e===null)throw new TypeError($t("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],je.indexOf(e)===-1)throw new TypeError($t('invalid argument. Second argument must be one of the following: "%s". Value: `%s`.',je.join('", "'),e))}else if(je.indexOf(e)===-1)throw new TypeError($t('invalid argument. First argument must be one of the following data types: "%s". Value: `%s`.',je.join('", "'),e));return e==="complex128"?t=wk:e==="complex64"?t=bk:t=NaN,hk(r.length,t,e)}q1.exports=Ek});var b1=l(function(BI,w1){"use strict";var Sk=x1();w1.exports=Sk});var E1=l(function(NI,Tk){Tk.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 T1=l(function(PI,S1){"use strict";var Ak=require("@stdlib/utils/keys"),_k=require("@stdlib/assert/has-own-property"),Ce=E1();function Vk(){var r,e,t,i;for(t={},r=Ak(Ce),e=r.length,i=0;i1?e=arguments[1]:e="float64",e==="complex128"?t=Ok:e==="complex64"?t=Lk:t=1,zk(r,t,e)}V1.exports=Rk});var C1=l(function(GI,j1){"use strict";var Mk=k1();j1.exports=Mk});var z1=l(function(DI,F1){"use strict";var Bk=K(),Nk=Dr(),Pk=require("@stdlib/complex/float64"),Ik=require("@stdlib/complex/float32"),Uk=require("@stdlib/string/format"),Gk=new Pk(1,0),Dk=new Ik(1,0);function Yk(r){var e,t;if(e=Bk(r),e===null)throw new TypeError(Uk("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=Gk:e==="complex64"?t=Dk:t=1,Nk(r.length,t,e)}F1.exports=Yk});var L1=l(function(YI,O1){"use strict";var Wk=z1();O1.exports=Wk});var M1=l(function(WI,R1){"use strict";function Zk(){return{highWaterMark:9007199254740992}}R1.exports=Zk});var P1=l(function(ZI,N1){"use strict";var Kk=require("@stdlib/assert/is-plain-object"),Xk=require("@stdlib/assert/has-own-property"),Hk=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,B1=require("@stdlib/string/format");function Jk(r,e){return Kk(e)?Xk(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Hk(r.highWaterMark))?new TypeError(B1("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","highWaterMark",r.highWaterMark)):null:new TypeError(B1("invalid argument. Options argument must be an object. Value: `%s`.",e))}N1.exports=Jk});var U1=l(function(KI,I1){"use strict";function $k(r){var e,t;for(e=[],t=0;ti.highWaterMark?null:(p=new sj(m),e+=m,p)}function u(m,p,g){var y;return p===0?new m(0):(y=o(cj(p)*dj[g]),y===null?y:new m(y,0,p))}function v(){var m,p,g,y,d,h,q,b,E;if(m=arguments.length,m&&rj(arguments[m-1])?(m-=1,p=arguments[m]):p="float64",g=ei(p),g===null)throw new TypeError(Qt("invalid argument. Must provide a recognized data type. Value: `%s`.",p));if(m<=0)return new g(0);if(ej(arguments[0]))return u(g,arguments[0],p);if(tj(arguments[0])){if(y=arguments[0],b=y.length,uj(y)?y=Y1(y,0):nj(y)?y=D1(y,0):/^complex/.test(p)&&(b/=2),d=u(g,b,p),d===null)return d;if(K1(d)||Z1(d))return d.set(y),d;for(q=W1(vj(y)).accessors[0],h=W1(p).accessors[1],E=0;E0){for(p=lj(ri(m.byteLength)),p=mj(t.length-1,p),g=t[p],y=0;y1&&(e.length=Ad(t,e,1,r,t>2)),e}_d.exports=nC});var jd=l(function(cU,kd){"use strict";var uC=Vd();kd.exports=uC});var Fd=l(function(mU,Cd){"use strict";var oC=typeof SharedArrayBuffer=="function"?SharedArrayBuffer:null;Cd.exports=oC});var Od=l(function(pU,zd){"use strict";function vC(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.")}zd.exports=vC});var Rd=l(function(gU,Ld){"use strict";var sC=require("@stdlib/assert/has-sharedarraybuffer-support"),fC=Fd(),lC=Od(),ai;sC()?ai=fC:ai=lC;Ld.exports=ai});var Id=l(function(yU,Pd){"use strict";var Jr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Md=require("@stdlib/assert/has-own-property"),Bd=require("@stdlib/assert/is-function"),cC=require("@stdlib/assert/is-collection"),mC=require("@stdlib/assert/is-plain-object"),pC=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gC=Q(),Nd=require("@stdlib/symbol/iterator"),yC=rr(),dC=ar(),hC=K(),ve=require("@stdlib/string/format");function ni(r){var e,t,i,a,n,o,u,v,s,f;if(!cC(r))throw new TypeError(ve("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(a={iter:1e308,dir:1},arguments.length>1)if(mC(arguments[1])){if(t=arguments[1],arguments.length>2){if(u=arguments[2],!Bd(u))throw new TypeError(ve("invalid argument. Callback argument must be a function. Value: `%s`.",u));e=arguments[3]}if(Md(t,"iter")&&(a.iter=t.iter,!pC(t.iter)))throw new TypeError(ve("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter));if(Md(t,"dir")&&(a.dir=t.dir,t.dir!==1&&t.dir!==-1))throw new TypeError(ve("invalid option. `%s` option must be either `1` or `-1`. Option: `%s`.","dir",t.dir))}else{if(u=arguments[1],!Bd(u))throw new TypeError(ve("invalid argument. Second argument must be either a function or an options object. Value: `%s`.",u));e=arguments[2]}return i=0,n={},u?a.dir===1?(f=-1,Jr(n,"next",c)):(f=r.length,Jr(n,"next",m)):a.dir===1?(f=-1,Jr(n,"next",p)):(f=r.length,Jr(n,"next",g)),Jr(n,"return",y),Nd&&Jr(n,Nd,d),s=hC(r),gC(r)?v=yC(s):v=dC(s),n;function c(){return f=(f+1)%r.length,i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:u.call(e,v(r,f),f,i,r),done:!1}}function m(){return f-=1,f<0&&(f+=r.length),i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:u.call(e,v(r,f),f,i,r),done:!1}}function p(){return f=(f+1)%r.length,i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:v(r,f),done:!1}}function g(){return f-=1,f<0&&(f+=r.length),i+=1,o||i>a.iter||r.length===0?{done:!0}:{value:v(r,f),done:!1}}function y(h){return o=!0,arguments.length?{value:h,done:!0}:{done:!0}}function d(){return u?ni(r,a,u,e):ni(r,a)}}Pd.exports=ni});var Gd=l(function(dU,Ud){"use strict";var qC=Id();Ud.exports=qC});var Zd=l(function(hU,Wd){"use strict";var Me=require("@stdlib/utils/define-nonenumerable-read-only-property"),xC=require("@stdlib/assert/is-function"),wC=require("@stdlib/assert/is-collection"),bC=Q(),Dd=require("@stdlib/symbol/iterator"),EC=rr(),SC=ar(),TC=K(),Yd=require("@stdlib/string/format");function ui(r){var e,t,i,a,n,o,u;if(!wC(r))throw new TypeError(Yd("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!xC(a))throw new TypeError(Yd("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return u=-1,t={},a?Me(t,"next",v):Me(t,"next",s),Me(t,"return",f),Dd&&Me(t,Dd,c),o=TC(r),bC(r)?n=EC(o):n=SC(o),t;function v(){return u+=1,i||u>=r.length?{done:!0}:{value:a.call(e,n(r,u),u,r),done:!1}}function s(){return u+=1,i||u>=r.length?{done:!0}:{value:n(r,u),done:!1}}function f(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function c(){return a?ui(r,a,e):ui(r)}}Wd.exports=ui});var Xd=l(function(qU,Kd){"use strict";var AC=Zd();Kd.exports=AC});var Qd=l(function(xU,$d){"use strict";var Be=require("@stdlib/utils/define-nonenumerable-read-only-property"),_C=require("@stdlib/assert/is-function"),VC=require("@stdlib/assert/is-collection"),kC=Q(),Hd=require("@stdlib/symbol/iterator"),jC=rr(),CC=ar(),FC=K(),Jd=require("@stdlib/string/format");function oi(r){var e,t,i,a,n,o,u,v;if(!VC(r))throw new TypeError(Jd("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!_C(a))throw new TypeError(Jd("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return n=r.length,v=n,t={},a?Be(t,"next",s):Be(t,"next",f),Be(t,"return",c),Hd&&Be(t,Hd,m),u=FC(r),kC(r)?o=jC(u):o=CC(u),t;function s(){return v+=r.length-n-1,n=r.length,i||v<0?(i=!0,{done:!0}):{value:a.call(e,o(r,v),v,r),done:!1}}function f(){return v+=r.length-n-1,n=r.length,i||v<0?(i=!0,{done:!0}):{value:o(r,v),done:!1}}function c(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return a?oi(r,a,e):oi(r)}}$d.exports=oi});var eh=l(function(wU,rh){"use strict";var zC=Qd();rh.exports=zC});var ih=l(function(bU,th){"use strict";var OC=Vr(),LC=Ar(),RC=_r(),MC=Tr(),BC=Sr(),NC=Er(),PC=br(),IC=xr(),UC=qr(),GC=zr(),DC=Lr(),YC=[[UC,"Float64Array"],[IC,"Float32Array"],[NC,"Int32Array"],[PC,"Uint32Array"],[MC,"Int16Array"],[BC,"Uint16Array"],[OC,"Int8Array"],[LC,"Uint8Array"],[RC,"Uint8ClampedArray"],[GC,"Complex64Array"],[DC,"Complex128Array"]];th.exports=YC});var nh=l(function(EU,ah){"use strict";var WC=require("@stdlib/assert/instance-of"),ZC=require("@stdlib/utils/constructor-name"),KC=require("@stdlib/utils/get-prototype-of"),$r=ih();function XC(r){var e,t;for(t=0;t<$r.length;t++)if(WC(r,$r[t][0]))return $r[t][1];for(;r;){for(e=ZC(r),t=0;t<$r.length;t++)if(e===$r[t][1])return $r[t][1];r=KC(r)}}ah.exports=XC});var oh=l(function(SU,uh){"use strict";var HC=require("@stdlib/assert/is-typed-array"),JC=require("@stdlib/assert/is-complex-typed-array"),$C=require("@stdlib/strided/base/reinterpret-complex64"),QC=require("@stdlib/strided/base/reinterpret-complex128"),rF=require("@stdlib/string/format"),eF=nh();function tF(r){var e,t,i;if(HC(r))e=r;else if(JC(r))r.BYTES_PER_ELEMENT===8?e=$C(r,0):e=QC(r,0);else throw new TypeError(rF("invalid argument. Must provide a typed array. Value: `%s`.",r));for(t={type:eF(r),data:[]},i=0;i1){if(a=arguments[1],!aF(a))throw new TypeError(lh("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return u=-1,t={},a?Ne(t,"next",v):Ne(t,"next",s),Ne(t,"return",f),fh&&Ne(t,fh,c),o=sF(r),uF(r)?n=oF(o):n=vF(o),t;function v(){var m;if(i)return{done:!0};for(m=r.length,u+=1;u=m?(i=!0,{done:!0}):{value:a.call(e,n(r,u),u,r),done:!1}}function s(){var m;if(i)return{done:!0};for(m=r.length,u+=1;u=m?(i=!0,{done:!0}):{value:n(r,u),done:!1}}function f(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function c(){return a?vi(r,a,e):vi(r)}}ch.exports=vi});var gh=l(function(_U,ph){"use strict";var fF=mh();ph.exports=fF});var qh=l(function(VU,hh){"use strict";var Pe=require("@stdlib/utils/define-nonenumerable-read-only-property"),lF=require("@stdlib/assert/is-function"),cF=require("@stdlib/assert/is-collection"),mF=Q(),yh=require("@stdlib/symbol/iterator"),pF=rr(),gF=ar(),yF=K(),dh=require("@stdlib/string/format");function si(r){var e,t,i,a,n,o,u,v;if(!cF(r))throw new TypeError(dh("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(arguments.length>1){if(a=arguments[1],!lF(a))throw new TypeError(dh("invalid argument. Second argument must be a function. Value: `%s`.",a));e=arguments[2]}return n=r.length,v=n,t={},a?Pe(t,"next",s):Pe(t,"next",f),Pe(t,"return",c),yh&&Pe(t,yh,m),u=yF(r),mF(r)?o=pF(u):o=gF(u),t;function s(){if(i)return{done:!0};for(v+=r.length-n-1,n=r.length;v>=0&&o(r,v)===void 0;)v-=1;return v<0?(i=!0,{done:!0}):{value:a.call(e,o(r,v),v,r),done:!1}}function f(){if(i)return{done:!0};for(v+=r.length-n-1,n=r.length;v>=0&&o(r,v)===void 0;)v-=1;return v<0?(i=!0,{done:!0}):{value:o(r,v),done:!1}}function c(p){return i=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return a?si(r,a,e):si(r)}}hh.exports=si});var wh=l(function(kU,xh){"use strict";var dF=qh();xh.exports=dF});var Th=l(function(jU,Sh){"use strict";var Ie=require("@stdlib/utils/define-nonenumerable-read-only-property"),hF=require("@stdlib/assert/is-function"),qF=require("@stdlib/assert/is-collection"),bh=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xF=require("@stdlib/assert/is-integer").isPrimitive,wF=Q(),Eh=require("@stdlib/symbol/iterator"),bF=rr(),EF=ar(),SF=K(),se=require("@stdlib/string/format");function fi(r,e,t,i){var a,n,o,u,v,s,f,c;if(!bh(r))throw new TypeError(se("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!qF(e))throw new TypeError(se("invalid argument. Second argument must be an array-like object. Value: `%s`.",e));if(!xF(t))throw new TypeError(se("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(!bh(i))throw new TypeError(se("invalid argument. Fourth argument must be a nonnegative integer. Value: `%s`.",i));if(arguments.length>4){if(u=arguments[4],!hF(u))throw new TypeError(se("invalid argument. Fifth argument must be a function. Value: `%s`.",u));a=arguments[5]}return v=i,c=-1,n={},u?Ie(n,"next",m):Ie(n,"next",p),Ie(n,"return",g),Eh&&Ie(n,Eh,y),f=SF(e),wF(e)?s=bF(f):s=EF(f),n;function m(){var d;return c+=1,o||c>=r?{done:!0}:(d=u.call(a,s(e,v),v,c,e),v+=t,{value:d,done:!1})}function p(){var d;return c+=1,o||c>=r?{done:!0}:(d=s(e,v),v+=t,{value:d,done:!1})}function g(d){return o=!0,arguments.length?{value:d,done:!0}:{done:!0}}function y(){return u?fi(r,e,t,i,u,a):fi(r,e,t,i)}}Sh.exports=fi});var _h=l(function(CU,Ah){"use strict";var TF=Th();Ah.exports=TF});var Ch=l(function(FU,jh){"use strict";var Ue=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ge=require("@stdlib/assert/is-function"),AF=require("@stdlib/assert/is-collection"),Vh=require("@stdlib/assert/is-integer").isPrimitive,_F=Q(),kh=require("@stdlib/symbol/iterator"),VF=rr(),kF=ar(),jF=K(),De=require("@stdlib/string/format");function li(r){var e,t,i,a,n,o,u,v,s,f;if(!AF(r))throw new TypeError(De("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,u=r.length;else if(i===2)Ge(arguments[1])?(t=0,o=arguments[1]):t=arguments[1],u=r.length;else if(i===3)Ge(arguments[1])?(t=0,u=r.length,o=arguments[1],e=arguments[2]):Ge(arguments[2])?(t=arguments[1],u=r.length,o=arguments[2]):(t=arguments[1],u=arguments[2]);else{if(t=arguments[1],u=arguments[2],o=arguments[3],!Ge(o))throw new TypeError(De("invalid argument. Fourth argument must be a function. Value: `%s`.",o));e=arguments[4]}if(!Vh(t))throw new TypeError(De("invalid argument. Second argument must be either an integer (starting index) or a function. Value: `%s`.",t));if(!Vh(u))throw new TypeError(De("invalid argument. Third argument must be either an integer (ending index) or a function. Value: `%s`.",u));return u<0?(u=r.length+u,u<0&&(u=0)):u>r.length&&(u=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=t-1,a={},o?Ue(a,"next",c):Ue(a,"next",m),Ue(a,"return",p),kh&&Ue(a,kh,g),s=jF(r),_F(r)?v=VF(s):v=kF(s),a;function c(){return f+=1,n||f>=u?{done:!0}:{value:o.call(e,v(r,f),f,f-t,r),done:!1}}function m(){return f+=1,n||f>=u?{done:!0}:{value:v(r,f),done:!1}}function p(y){return n=!0,arguments.length?{value:y,done:!0}:{done:!0}}function g(){return o?li(r,t,u,o,e):li(r,t,u)}}jh.exports=li});var zh=l(function(zU,Fh){"use strict";var CF=Ch();Fh.exports=CF});var Mh=l(function(OU,Rh){"use strict";var Ye=require("@stdlib/utils/define-nonenumerable-read-only-property"),We=require("@stdlib/assert/is-function"),FF=require("@stdlib/assert/is-collection"),Oh=require("@stdlib/assert/is-integer").isPrimitive,zF=Q(),Lh=require("@stdlib/symbol/iterator"),OF=rr(),LF=ar(),RF=K(),Ze=require("@stdlib/string/format");function ci(r){var e,t,i,a,n,o,u,v,s,f;if(!FF(r))throw new TypeError(Ze("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=arguments.length,i===1)t=0,u=r.length;else if(i===2)We(arguments[1])?(t=0,o=arguments[1]):t=arguments[1],u=r.length;else if(i===3)We(arguments[1])?(t=0,u=r.length,o=arguments[1],e=arguments[2]):We(arguments[2])?(t=arguments[1],u=r.length,o=arguments[2]):(t=arguments[1],u=arguments[2]);else{if(t=arguments[1],u=arguments[2],o=arguments[3],!We(o))throw new TypeError(Ze("invalid argument. Fourth argument must be a function. Value: `%s`.",o));e=arguments[4]}if(!Oh(t))throw new TypeError(Ze("invalid argument. Second argument must be either an integer (starting view index) or a function. Value: `%s`.",t));if(!Oh(u))throw new TypeError(Ze("invalid argument. Third argument must be either an integer (ending view index) or a function. Value: `%s`.",u));return u<0?(u=r.length+u,u<0&&(u=0)):u>r.length&&(u=r.length),t<0&&(t=r.length+t,t<0&&(t=0)),f=u,a={},o?Ye(a,"next",c):Ye(a,"next",m),Ye(a,"return",p),Lh&&Ye(a,Lh,g),s=RF(r),zF(r)?v=OF(s):v=LF(s),a;function c(){return f-=1,n||f1&&(e=arguments[1]),zO(r.length,e)}q2.exports=OO});var b2=l(function(CG,w2){"use strict";var LO=x2();w2.exports=LO});var _=require("@stdlib/utils/define-read-only-property"),A={};_(A,"base",q0());_(A,"ArrayBuffer",kt());_(A,"Complex64Array",zr());_(A,"Complex128Array",Lr());_(A,"convertArray",Ot());_(A,"convertArraySame",M0());_(A,"arrayCtors",Ir());_(A,"DataView",G0());_(A,"datespace",H0());_(A,"arrayDataType",K());_(A,"arrayDataTypes",tg());_(A,"aempty",Mt());_(A,"aemptyLike",Tg());_(A,"filledarray",zg());_(A,"filledarrayBy",Gg());_(A,"Float32Array",xr());_(A,"Float64Array",qr());_(A,"iterator2array",Kg());_(A,"afull",Dr());_(A,"afullLike",ty());_(A,"incrspace",uy());_(A,"Int8Array",Vr());_(A,"Int16Array",Tr());_(A,"Int32Array",Er());_(A,"linspace",Qy());_(A,"logspace",n1());_(A,"arrayMinDataType",m1());_(A,"anans",h1());_(A,"anansLike",b1());_(A,"arrayNextDataType",_1());_(A,"aones",C1());_(A,"aonesLike",L1());_(A,"typedarraypool",rd());_(A,"arrayPromotionRules",ud());_(A,"reviveTypedArray",cd());_(A,"arraySafeCasts",hd());_(A,"arraySameKindCasts",Sd());_(A,"arrayShape",jd());_(A,"SharedArrayBuffer",Rd());_(A,"circarray2iterator",Gd());_(A,"array2iterator",Xd());_(A,"array2iteratorRight",eh());_(A,"typedarray2json",sh());_(A,"sparsearray2iterator",gh());_(A,"sparsearray2iteratorRight",wh());_(A,"stridedarray2iterator",_h());_(A,"arrayview2iterator",zh());_(A,"arrayview2iteratorRight",Nh());_(A,"typedarray",Gh());_(A,"complexarray",$h());_(A,"complexarrayCtors",pi());_(A,"complexarrayDataTypes",iq());_(A,"typedarrayCtors",Xr());_(A,"typedarrayDataTypes",vq());_(A,"floatarrayCtors",Yt());_(A,"floatarrayDataTypes",mq());_(A,"intarrayCtors",qq());_(A,"intarrayDataTypes",Sq());_(A,"realarray",Vq());_(A,"realarrayCtors",Oq());_(A,"realarrayDataTypes",Nq());_(A,"realarrayFloatCtors",Yq());_(A,"realarrayFloatDataTypes",Hq());_(A,"intarraySignedCtors",t2());_(A,"intarraySignedDataTypes",o2());_(A,"intarrayUnsignedCtors",m2());_(A,"intarrayUnsignedDataTypes",h2());_(A,"Uint8Array",Ar());_(A,"Uint8ClampedArray",_r());_(A,"Uint16Array",Sr());_(A,"Uint32Array",br());_(A,"azeros",Te());_(A,"azerosLike",b2());_(A,"constants",require("@stdlib/constants/array"));module.exports=A;
/**
* @license Apache-2.0
*
diff --git a/dist/index.js.map b/dist/index.js.map
index fbc94f0f..236dcbb3 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/resolve-getter/lib/main.js", "../base/resolve-getter/lib/index.js", "../base/bifurcate-entries/lib/main.js", "../base/bifurcate-entries/lib/index.js", "../base/bifurcate-indices/lib/main.js", "../base/bifurcate-indices/lib/index.js", "../base/bifurcate-values/lib/main.js", "../base/bifurcate-values/lib/index.js", "../base/binary2d/lib/main.js", "../base/binary2d/lib/index.js", "../base/binary3d/lib/main.js", "../base/binary3d/lib/index.js", "../base/binary4d/lib/main.js", "../base/binary4d/lib/index.js", "../base/binary5d/lib/main.js", "../base/binary5d/lib/index.js", "../base/binarynd/lib/main.js", "../base/binarynd/lib/index.js", "../base/copy-indexed/lib/main.js", "../base/copy-indexed/lib/index.js", "../base/filled/lib/main.js", "../base/filled/lib/index.js", "../base/zeros/lib/main.js", "../base/zeros/lib/index.js", "../base/broadcast-array/lib/main.js", "../base/broadcast-array/lib/index.js", "../base/broadcasted-binary2d/lib/main.js", "../base/broadcasted-binary2d/lib/index.js", "../base/broadcasted-binary3d/lib/main.js", "../base/broadcasted-binary3d/lib/index.js", "../base/broadcasted-binary4d/lib/main.js", "../base/broadcasted-binary4d/lib/index.js", "../base/broadcasted-binary5d/lib/main.js", "../base/broadcasted-binary5d/lib/index.js", "../base/broadcasted-quaternary2d/lib/main.js", "../base/broadcasted-quaternary2d/lib/index.js", "../base/broadcasted-quinary2d/lib/main.js", "../base/broadcasted-quinary2d/lib/index.js", "../base/broadcasted-ternary2d/lib/main.js", "../base/broadcasted-ternary2d/lib/index.js", "../base/broadcasted-unary2d/lib/main.js", "../base/broadcasted-unary2d/lib/index.js", "../base/broadcasted-unary3d/lib/main.js", "../base/broadcasted-unary3d/lib/index.js", "../base/broadcasted-unary4d/lib/main.js", "../base/broadcasted-unary4d/lib/index.js", "../base/broadcasted-unary5d/lib/main.js", "../base/broadcasted-unary5d/lib/index.js", "../base/cartesian-power/lib/main.js", "../base/cartesian-power/lib/index.js", "../base/cartesian-product/lib/main.js", "../base/cartesian-product/lib/index.js", "../base/cartesian-square/lib/main.js", "../base/cartesian-square/lib/index.js", "../base/copy/lib/main.js", "../base/copy/lib/index.js", "../base/dedupe/lib/main.js", "../base/dedupe/lib/index.js", "../base/filled-by/lib/main.js", "../base/filled-by/lib/index.js", "../base/filled2d/lib/main.js", "../base/filled2d/lib/index.js", "../base/filled2d-by/lib/main.js", "../base/filled2d-by/lib/index.js", "../base/filled3d/lib/main.js", "../base/filled3d/lib/index.js", "../base/filled3d-by/lib/main.js", "../base/filled3d-by/lib/index.js", "../base/filled4d/lib/main.js", "../base/filled4d/lib/index.js", "../base/filled4d-by/lib/main.js", "../base/filled4d-by/lib/index.js", "../base/filled5d/lib/main.js", "../base/filled5d/lib/index.js", "../base/filled5d-by/lib/main.js", "../base/filled5d-by/lib/index.js", "../base/fillednd/lib/main.js", "../base/fillednd/lib/index.js", "../base/fillednd-by/lib/main.js", "../base/fillednd-by/lib/index.js", "../base/first/lib/main.js", "../base/first/lib/index.js", "../base/flatten/lib/assign.js", "../base/flatten/lib/main.js", "../base/flatten/lib/index.js", "../base/flatten-by/lib/assign.js", "../base/flatten-by/lib/main.js", "../base/flatten-by/lib/index.js", "../base/flatten2d/lib/main.js", "../base/flatten2d/lib/assign.js", "../base/flatten2d/lib/index.js", "../base/flatten2d-by/lib/main.js", "../base/flatten2d-by/lib/assign.js", "../base/flatten2d-by/lib/index.js", "../base/flatten3d/lib/main.js", "../base/flatten3d/lib/assign.js", "../base/flatten3d/lib/index.js", "../base/flatten3d-by/lib/main.js", "../base/flatten3d-by/lib/assign.js", "../base/flatten3d-by/lib/index.js", "../base/flatten4d/lib/main.js", "../base/flatten4d/lib/assign.js", "../base/flatten4d/lib/index.js", "../base/flatten4d-by/lib/main.js", "../base/flatten4d-by/lib/assign.js", "../base/flatten4d-by/lib/index.js", "../base/flatten5d/lib/main.js", "../base/flatten5d/lib/assign.js", "../base/flatten5d/lib/index.js", "../base/flatten5d-by/lib/main.js", "../base/flatten5d-by/lib/assign.js", "../base/flatten5d-by/lib/index.js", "../base/fliplr2d/lib/main.js", "../base/fliplr2d/lib/index.js", "../base/fliplr3d/lib/main.js", "../base/fliplr3d/lib/index.js", "../base/fliplr4d/lib/main.js", "../base/fliplr4d/lib/index.js", "../base/fliplr5d/lib/main.js", "../base/fliplr5d/lib/index.js", "../base/flipud2d/lib/main.js", "../base/flipud2d/lib/index.js", "../base/flipud3d/lib/main.js", "../base/flipud3d/lib/index.js", "../base/flipud4d/lib/main.js", "../base/flipud4d/lib/index.js", "../base/flipud5d/lib/main.js", "../base/flipud5d/lib/index.js", "../base/from-strided/lib/main.js", "../base/from-strided/lib/index.js", "../base/group-entries/lib/main.js", "../base/group-entries/lib/index.js", "../base/group-indices/lib/main.js", "../base/group-indices/lib/index.js", "../base/group-values/lib/main.js", "../base/group-values/lib/index.js", "../base/incrspace/lib/main.js", "../base/incrspace/lib/index.js", "../base/index-of/lib/main.js", "../base/index-of/lib/index.js", "../base/last/lib/main.js", "../base/last/lib/index.js", "../base/last-index-of/lib/main.js", "../base/last-index-of/lib/index.js", "../base/linspace/lib/main.js", "../base/linspace/lib/index.js", "../base/logspace/lib/main.js", "../base/logspace/lib/index.js", "../base/map2d/lib/main.js", "../base/map2d/lib/assign.js", "../base/map2d/lib/index.js", "../base/map3d/lib/main.js", "../base/map3d/lib/assign.js", "../base/map3d/lib/index.js", "../base/map4d/lib/main.js", "../base/map4d/lib/assign.js", "../base/map4d/lib/index.js", "../base/map5d/lib/main.js", "../base/map5d/lib/assign.js", "../base/map5d/lib/index.js", "../base/mskbinary2d/lib/main.js", "../base/mskbinary2d/lib/index.js", "../base/mskunary2d/lib/main.js", "../base/mskunary2d/lib/index.js", "../base/mskunary3d/lib/main.js", "../base/mskunary3d/lib/index.js", "../base/n-cartesian-product/lib/main.js", "../base/n-cartesian-product/lib/index.js", "../base/one-to/lib/main.js", "../base/one-to/lib/index.js", "../base/ones/lib/main.js", "../base/ones/lib/index.js", "../base/ones2d/lib/main.js", "../base/ones2d/lib/index.js", "../base/ones3d/lib/main.js", "../base/ones3d/lib/index.js", "../base/ones4d/lib/main.js", "../base/ones4d/lib/index.js", "../base/ones5d/lib/main.js", "../base/ones5d/lib/index.js", "../base/onesnd/lib/main.js", "../base/onesnd/lib/index.js", "../base/quaternary2d/lib/main.js", "../base/quaternary2d/lib/index.js", "../base/quaternary3d/lib/main.js", "../base/quaternary3d/lib/index.js", "../base/quaternary4d/lib/main.js", "../base/quaternary4d/lib/index.js", "../base/quaternary5d/lib/main.js", "../base/quaternary5d/lib/index.js", "../base/quinary2d/lib/main.js", "../base/quinary2d/lib/index.js", "../base/quinary3d/lib/main.js", "../base/quinary3d/lib/index.js", "../base/quinary4d/lib/main.js", "../base/quinary4d/lib/index.js", "../base/quinary5d/lib/main.js", "../base/quinary5d/lib/index.js", "../base/slice/lib/main.js", "../base/slice/lib/index.js", "../base/strided2array2d/lib/main.js", "../base/strided2array2d/lib/index.js", "../base/strided2array3d/lib/main.js", "../base/strided2array3d/lib/index.js", "../base/strided2array4d/lib/main.js", "../base/strided2array4d/lib/index.js", "../base/strided2array5d/lib/main.js", "../base/strided2array5d/lib/index.js", "../base/take/lib/main.js", "../base/take/lib/index.js", "../base/take-indexed/lib/main.js", "../base/take-indexed/lib/index.js", "../base/take2d/lib/main.js", "../base/take2d/lib/index.js", "../base/take3d/lib/main.js", "../base/take3d/lib/index.js", "../base/ternary2d/lib/main.js", "../base/ternary2d/lib/index.js", "../base/ternary3d/lib/main.js", "../base/ternary3d/lib/index.js", "../base/ternary4d/lib/main.js", "../base/ternary4d/lib/index.js", "../base/ternary5d/lib/main.js", "../base/ternary5d/lib/index.js", "../base/to-accessor-array/lib/main.js", "../base/to-accessor-array/lib/index.js", "../base/to-deduped/lib/main.js", "../base/to-deduped/lib/index.js", "../base/unary2d/lib/main.js", "../base/unary2d/lib/index.js", "../base/unary2d-by/lib/main.js", "../base/unary2d-by/lib/index.js", "../base/unary3d/lib/main.js", "../base/unary3d/lib/index.js", "../base/unary4d/lib/main.js", "../base/unary4d/lib/index.js", "../base/unary5d/lib/main.js", "../base/unary5d/lib/index.js", "../base/unarynd/lib/main.js", "../base/unarynd/lib/index.js", "../base/unitspace/lib/main.js", "../base/unitspace/lib/index.js", "../base/zero-to/lib/main.js", "../base/zero-to/lib/index.js", "../base/zeros2d/lib/main.js", "../base/zeros2d/lib/index.js", "../base/zeros3d/lib/main.js", "../base/zeros3d/lib/index.js", "../base/zeros4d/lib/main.js", "../base/zeros4d/lib/index.js", "../base/zeros5d/lib/main.js", "../base/zeros5d/lib/index.js", "../base/zerosnd/lib/main.js", "../base/zerosnd/lib/index.js", "../base/lib/index.js", "../buffer/lib/main.js", "../buffer/lib/polyfill.js", "../buffer/lib/index.js", "../ctors/lib/ctors.js", "../ctors/lib/main.js", "../ctors/lib/index.js", "../convert/lib/main.js", "../convert/lib/index.js", "../convert-same/lib/main.js", "../convert-same/lib/index.js", "../dataview/lib/main.js", "../dataview/lib/polyfill.js", "../dataview/lib/index.js", "../datespace/lib/main.js", "../datespace/lib/index.js", "../dtypes/lib/dtypes.json", "../dtypes/lib/main.js", "../dtypes/lib/index.js", "../empty/lib/is_buffer_uint8array.js", "../typed-ctors/lib/ctors.js", "../typed-ctors/lib/main.js", "../typed-ctors/lib/index.js", "../empty/lib/main.js", "../zeros/lib/main.js", "../zeros/lib/index.js", "../empty/lib/polyfill.js", "../empty/lib/index.js", "../empty-like/lib/main.js", "../empty-like/lib/index.js", "../filled/lib/main.js", "../filled/lib/index.js", "../filled-by/lib/main.js", "../filled-by/lib/index.js", "../from-iterator/lib/main.js", "../from-iterator/lib/index.js", "../full/lib/main.js", "../full/lib/index.js", "../full-like/lib/main.js", "../full-like/lib/index.js", "../incrspace/lib/main.js", "../incrspace/lib/index.js", "../typed-float-ctors/lib/ctors.js", "../typed-float-ctors/lib/main.js", "../typed-float-ctors/lib/index.js", "../linspace/lib/generic_real.js", "../linspace/lib/generic_complex.js", "../linspace/lib/typed_real.js", "../linspace/lib/typed_complex.js", "../linspace/lib/validate.js", "../linspace/lib/defaults.json", "../linspace/lib/main.js", "../linspace/lib/accessors_complex.js", "../linspace/lib/accessors_real.js", "../linspace/lib/assign.js", "../linspace/lib/index.js", "../logspace/lib/main.js", "../logspace/lib/index.js", "../min-dtype/lib/main.js", "../min-dtype/lib/index.js", "../nans/lib/main.js", "../nans/lib/index.js", "../nans-like/lib/main.js", "../nans-like/lib/index.js", "../next-dtype/lib/next_dtypes.json", "../next-dtype/lib/main.js", "../next-dtype/lib/index.js", "../ones/lib/main.js", "../ones/lib/index.js", "../ones-like/lib/main.js", "../ones-like/lib/index.js", "../pool/lib/defaults.js", "../pool/lib/validate.js", "../pool/lib/pool.js", "../pool/lib/bytes_per_element.json", "../pool/lib/factory.js", "../pool/lib/main.js", "../pool/lib/index.js", "../promotion-rules/lib/promotion_rules.json", "../promotion-rules/lib/main.js", "../promotion-rules/lib/index.js", "../reviver/lib/ctors.js", "../reviver/lib/main.js", "../reviver/lib/index.js", "../safe-casts/lib/safe_casts.json", "../safe-casts/lib/main.js", "../safe-casts/lib/index.js", "../same-kind-casts/lib/same_kind_casts.json", "../same-kind-casts/lib/main.js", "../same-kind-casts/lib/index.js", "../shape/lib/main.js", "../shape/lib/index.js", "../shared-buffer/lib/main.js", "../shared-buffer/lib/polyfill.js", "../shared-buffer/lib/index.js", "../to-circular-iterator/lib/main.js", "../to-circular-iterator/lib/index.js", "../to-iterator/lib/main.js", "../to-iterator/lib/index.js", "../to-iterator-right/lib/main.js", "../to-iterator-right/lib/index.js", "../to-json/lib/ctors.js", "../to-json/lib/type.js", "../to-json/lib/main.js", "../to-json/lib/index.js", "../to-sparse-iterator/lib/main.js", "../to-sparse-iterator/lib/index.js", "../to-sparse-iterator-right/lib/main.js", "../to-sparse-iterator-right/lib/index.js", "../to-strided-iterator/lib/main.js", "../to-strided-iterator/lib/index.js", "../to-view-iterator/lib/main.js", "../to-view-iterator/lib/index.js", "../to-view-iterator-right/lib/main.js", "../to-view-iterator-right/lib/index.js", "../typed/lib/main.js", "../typed/lib/index.js", "../typed-complex-ctors/lib/ctors.js", "../typed-complex-ctors/lib/main.js", "../typed-complex-ctors/lib/index.js", "../typed-complex/lib/main.js", "../typed-complex/lib/index.js", "../typed-complex-dtypes/lib/dtypes.json", "../typed-complex-dtypes/lib/main.js", "../typed-complex-dtypes/lib/index.js", "../typed-dtypes/lib/dtypes.json", "../typed-dtypes/lib/main.js", "../typed-dtypes/lib/index.js", "../typed-float-dtypes/lib/dtypes.json", "../typed-float-dtypes/lib/main.js", "../typed-float-dtypes/lib/index.js", "../typed-integer-ctors/lib/ctors.js", "../typed-integer-ctors/lib/main.js", "../typed-integer-ctors/lib/index.js", "../typed-integer-dtypes/lib/dtypes.json", "../typed-integer-dtypes/lib/main.js", "../typed-integer-dtypes/lib/index.js", "../typed-real/lib/main.js", "../typed-real/lib/index.js", "../typed-real-ctors/lib/ctors.js", "../typed-real-ctors/lib/main.js", "../typed-real-ctors/lib/index.js", "../typed-real-dtypes/lib/dtypes.json", "../typed-real-dtypes/lib/main.js", "../typed-real-dtypes/lib/index.js", "../typed-real-float-ctors/lib/ctors.js", "../typed-real-float-ctors/lib/main.js", "../typed-real-float-ctors/lib/index.js", "../typed-real-float-dtypes/lib/dtypes.json", "../typed-real-float-dtypes/lib/main.js", "../typed-real-float-dtypes/lib/index.js", "../typed-signed-integer-ctors/lib/ctors.js", "../typed-signed-integer-ctors/lib/main.js", "../typed-signed-integer-ctors/lib/index.js", "../typed-signed-integer-dtypes/lib/dtypes.json", "../typed-signed-integer-dtypes/lib/main.js", "../typed-signed-integer-dtypes/lib/index.js", "../typed-unsigned-integer-ctors/lib/ctors.js", "../typed-unsigned-integer-ctors/lib/main.js", "../typed-unsigned-integer-ctors/lib/index.js", "../typed-unsigned-integer-dtypes/lib/dtypes.json", "../typed-unsigned-integer-dtypes/lib/main.js", "../typed-unsigned-integer-dtypes/lib/index.js", "../zeros-like/lib/main.js", "../zeros-like/lib/index.js", "../lib/index.js"],
- "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar TYPE = 'function';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like object supports the accessor (get/set) protocol.\n*\n* @param {Object} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn ( typeof value.get === TYPE && typeof value.set === TYPE ); // eslint-disable-line valid-typeof\n}\n\n\n// EXPORTS //\n\nmodule.exports = isAccessorArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if an array-like object supports the accessor (get/set) protocol.\n*\n* @module @stdlib/array/base/assert/is-accessor-array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128array' );\n* var isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isAccessorArray( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'float64': getFloat64,\n\t'float32': getFloat32,\n\t'int32': getInt32,\n\t'int16': getInt16,\n\t'int8': getInt8,\n\t'uint32': getUint32,\n\t'uint16': getUint16,\n\t'uint8': getUint8,\n\t'uint8c': getUint8c,\n\t'generic': getGeneric,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat64( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat64( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var arr = new Float32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat32( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat32( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Int32Array = require( '@stdlib/array/int32' );\n*\n* var arr = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt32( arr, 2 );\n* // returns 3\n*/\nfunction getInt32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Int16Array = require( '@stdlib/array/int16' );\n*\n* var arr = new Int16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt16( arr, 2 );\n* // returns 3\n*/\nfunction getInt16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Int8Array = require( '@stdlib/array/int8' );\n*\n* var arr = new Int8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt8( arr, 2 );\n* // returns 3\n*/\nfunction getInt8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n*\n* var arr = new Uint32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint32( arr, 2 );\n* // returns 3\n*/\nfunction getUint32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint16Array = require( '@stdlib/array/uint16' );\n*\n* var arr = new Uint16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint16( arr, 2 );\n* // returns 3\n*/\nfunction getUint16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint8Array = require( '@stdlib/array/uint8' );\n*\n* var arr = new Uint8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8( arr, 2 );\n* // returns 3\n*/\nfunction getUint8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint8ClampedArray = require( '@stdlib/array/uint8c' );\n*\n* var arr = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8c( arr, 2 );\n* // returns 3\n*/\nfunction getUint8c( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getGeneric( arr, 2 );\n* // returns 3\n*/\nfunction getGeneric( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for retrieving an element from an indexed array-like object.\n*\n* @module @stdlib/array/base/getter\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n* var getter = require( '@stdlib/array/base/getter' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'float64': setFloat64,\n\t'float32': setFloat32,\n\t'int32': setInt32,\n\t'int16': setInt16,\n\t'int8': setInt8,\n\t'uint32': setUint32,\n\t'uint16': setUint16,\n\t'uint8': setUint8,\n\t'uint8c': setUint8c,\n\t'generic': setGeneric,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( 4 );\n*\n* setFloat64( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat64( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var arr = new Float32Array( 4 );\n*\n* setFloat32( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Int32Array = require( '@stdlib/array/int32' );\n*\n* var arr = new Int32Array( 4 );\n*\n* setInt32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Int16Array = require( '@stdlib/array/int16' );\n*\n* var arr = new Int16Array( 4 );\n*\n* setInt16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Int8Array = require( '@stdlib/array/int8' );\n*\n* var arr = new Int8Array( 4 );\n*\n* setInt8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n*\n* var arr = new Uint32Array( 4 );\n*\n* setUint32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint16Array = require( '@stdlib/array/uint16' );\n*\n* var arr = new Uint16Array( 4 );\n*\n* setUint16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint8Array = require( '@stdlib/array/uint8' );\n*\n* var arr = new Uint8Array( 4 );\n*\n* setUint8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint8ClampedArray = require( '@stdlib/array/uint8c' );\n*\n* var arr = new Uint8ClampedArray( 4 );\n*\n* setUint8c( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8c( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setGeneric( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setGeneric( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setArrayLike( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for setting an element in an indexed array-like object.\n*\n* @module @stdlib/array/base/setter\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n* var set = require( '@stdlib/array/base/setter' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'complex128': getComplex128,\n\t'complex64': getComplex64,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex128( arr, 1 );\n* // returns \n*\n* var re = real( v );\n* // returns 3.0\n*\n* var im = imag( v );\n* // returns 4.0\n*/\nfunction getComplex128( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex64( arr, 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 3.0\n*\n* var im = imagf( v );\n* // returns 4.0\n*/\nfunction getComplex64( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 3.0\n*\n* var im = imagf( v );\n* // returns 4.0\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @module @stdlib/array/base/accessor-getter\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var dtype = require( '@stdlib/array/dtype' );\n* var getter = require( '@stdlib/array/base/accessor-getter' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 3.0\n*\n* var im = imagf( v );\n* // returns 4.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'complex128': setComplex128,\n\t'complex64': setComplex64,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var Complex128 = require( '@stdlib/complex/float64' );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex128( arr, 1, new Complex128( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = real( v );\n* // returns 10.0\n*\n* var im = imag( v );\n* // returns 11.0\n*/\nfunction setComplex128( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex64( arr, 1, new Complex64( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 11.0\n*/\nfunction setComplex64( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* setArrayLike( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 11.0\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @module @stdlib/array/base/accessor-setter\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var dtype = require( '@stdlib/array/dtype' );\n* var setter = require( '@stdlib/array/base/accessor-setter' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns \n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 11.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128'\n};\n\n\n// EXPORTS //\n\nmodule.exports = ctor2dtypes;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array/float64\n*\n* @example\n* var ctor = require( '@stdlib/array/float64' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array/float32\n*\n* @example\n* var ctor = require( '@stdlib/array/float32' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint32\n*\n* @example\n* var ctor = require( '@stdlib/array/uint32' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int32Array === 'function' ) ? Int32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int32\n*\n* @example\n* var ctor = require( '@stdlib/array/int32' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint16\n*\n* @example\n* var ctor = require( '@stdlib/array/uint16' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int16Array === 'function' ) ? Int16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int16\n*\n* @example\n* var ctor = require( '@stdlib/array/int16' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint8\n*\n* @example\n* var ctor = require( '@stdlib/array/uint8' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @module @stdlib/array/uint8c\n*\n* @example\n* var ctor = require( '@stdlib/array/uint8c' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); // eslint-disable-line id-length\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ClampedArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int8Array === 'function' ) ? Int8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int8\n*\n* @example\n* var ctor = require( '@stdlib/array/int8' );\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar realf = require( '@stdlib/complex/realf' );\nvar imagf = require( '@stdlib/complex/imagf' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar realf = require( '@stdlib/complex/realf' );\nvar imagf = require( '@stdlib/complex/imagf' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar realf = require( '@stdlib/complex/realf' );\nvar imagf = require( '@stdlib/complex/imagf' );\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float32Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float32Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = realf( v );\n\t\tbuf[ j+1 ] = imagf( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromArray;\n", "/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar isEven = require( '@stdlib/math/base/assert/is-even' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar Float32Array = require( './../../float32' );\nvar Complex64 = require( '@stdlib/complex/float32' );\nvar format = require( '@stdlib/string/format' );\nvar realf = require( '@stdlib/complex/realf' );\nvar imagf = require( '@stdlib/complex/imagf' );\nvar reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\nvar reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' );\nvar getter = require( './../../base/getter' );\nvar accessorGetter = require( './../../base/accessor-getter' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\nvar fromArray = require( './from_array.js' );\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex64Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex64Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex128Array...\n\t\tvalue.name === 'Complex128Array'\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*/\nfunction isComplex64Array( value ) { // TODO: move to array/base/assert/is-complex64-array\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*/\nfunction isComplex128Array( value ) { // TODO: move to array/base/assert/is-complex128-array\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT*2\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float32Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex64} complex number\n*/\nfunction getComplex64( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); // FIXME: `buf` is what is returned from above, NOT the original value\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function clbk( v ) {\n* return new Complex64( realf(v)*2.0, imagf(v)*2.0 );\n* }\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 64-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex64Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = realf( z );\n* // returns 9.0\n*\n* im = imagf( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} modified array\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex64( 1.0, 1.0 ), 0 );\n* arr.set( new Complex64( 2.0, 2.0 ), 1 );\n* arr.set( new Complex64( 3.0, 3.0 ), 2 );\n* arr.set( new Complex64( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = [\n* new Complex64( 1.0, 1.0 ),\n* new Complex64( 2.0, 2.0 ),\n* new Complex64( 3.0, 3.0 )\n* ];\n* arr = new Complex64Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex64( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Complex64} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.fill( new Complex64( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*\n* z = arr.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = realf( value );\n\tim = imagf( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex64Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex64Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Complex64} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex64( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex64( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex64( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Complex64} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = new Complex64Array( 10 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 );\n* // returns -1\n*/\nsetReadOnly( Complex64Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Complex64} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex64( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function scale( v, i ) {\n* return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2\n*\n* var im = imagf( z );\n* // returns -2\n*/\nsetReadOnly( Complex64Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex64( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = realf( v );\n\t\t\toutbuf[ (2*i)+1 ] = imagf( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\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}\n\t}\n\treturn out;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + (begin*BYTES_PER_ELEMENT);\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nmodule.exports = Complex64Array;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* 64-bit complex number array.\n*\n* @module @stdlib/array/complex64\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar format = require( '@stdlib/string/format' );\nvar real = require( '@stdlib/complex/real' );\nvar imag = require( '@stdlib/complex/imag' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar format = require( '@stdlib/string/format' );\nvar real = require( '@stdlib/complex/real' );\nvar imag = require( '@stdlib/complex/imag' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar real = require( '@stdlib/complex/real' );\nvar imag = require( '@stdlib/complex/imag' );\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float64Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float64Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = real( v );\n\t\tbuf[ j+1 ] = imag( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromArray;\n", "/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar isEven = require( '@stdlib/math/base/assert/is-even' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar Float64Array = require( './../../float64' );\nvar Complex128 = require( '@stdlib/complex/float64' );\nvar real = require( '@stdlib/complex/real' );\nvar imag = require( '@stdlib/complex/imag' );\nvar reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\nvar reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' );\nvar getter = require( './../../base/getter' );\nvar accessorGetter = require( './../../base/accessor-getter' );\nvar format = require( '@stdlib/string/format' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\nvar fromArray = require( './from_array.js' );\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float64Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex128Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex128Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex64Array...\n\t\tvalue.name === 'Complex64Array'\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*/\nfunction isComplex64Array( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT/2\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*/\nfunction isComplex128Array( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float64Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex128} complex number\n*/\nfunction getComplex128( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 128-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `16`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `16`\n* @throws {TypeError} view length must be a positive multiple of `16`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex128Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex128Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex128Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex128Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex128Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex128Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex128Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float64Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float64Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float64Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float64Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float64Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var nbytes = Complex128Array.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128Array\n* @readonly\n* @type {string}\n* @default 'Complex128Array'\n*\n* @example\n* var name = Complex128Array.name;\n* // returns 'Complex128Array'\n*/\nsetReadOnly( Complex128Array, 'name', 'Complex128Array' );\n\n/**\n* Creates a new 128-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex128Array\n* @type {Function}\n* @param {(Collection|Object)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function clbk( v ) {\n* return new Complex128( real(v)*2.0, imag(v)*2.0 );\n* }\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex128Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 128-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex128Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex128Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = real( z );\n* // returns 9.0\n*\n* im = imag( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 160\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array.prototype, 'BYTES_PER_ELEMENT', Complex128Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} modified array\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex128( 1.0, 1.0 ), 0 );\n* arr.set( new Complex128( 2.0, 2.0 ), 1 );\n* arr.set( new Complex128( 3.0, 3.0 ), 2 );\n* arr.set( new Complex128( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n*\n* var arr = [\n* new Complex128( 1.0, 1.0 ),\n* new Complex128( 2.0, 2.0 ),\n* new Complex128( 3.0, 3.0 )\n* ];\n* arr = new Complex128Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex128( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex128Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex128Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Complex128} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex128( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex128( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex128( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Complex128} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex128( 4.0, -4.0 ), -3 );\n* // returns 3\n*/\nsetReadOnly( Complex128Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Complex128} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64' );\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex128( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number 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* function scale( v, i ) {\n* return new Complex128( 2.0*real( v ), 2.0*imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns -2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex128( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = real( v );\n\t\t\toutbuf[ (2*i)+1 ] = imag( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\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}\n\t}\n\treturn out;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n* @name set\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = real( value );\n\t\tbuf[ idx+1 ] = imag( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float64Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float64Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = real( v );\n\t\t\tbuf[ idx+1 ] = imag( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* var real = require( '@stdlib/complex/real' );\n* var imag = require( '@stdlib/complex/imag' );\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\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// MODULES //\n\nvar isAccessorArray = require( './../../../base/assert/is-accessor-array' );\nvar accessorGetter = require( './../../../base/accessor-getter' );\nvar getter = require( './../../../base/getter' );\nvar dtype = require( './../../../dtype' );\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object.\n*\n* @param {Collection} x - input array\n* @returns {Function} accessor\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = resolveGetter( arr );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction resolveGetter( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn accessorGetter( dt );\n\t}\n\treturn getter( dt );\n}\n\n\n// EXPORTS //\n\nmodule.exports = resolveGetter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for retrieving an element from an array-like object.\n*\n* @module @stdlib/array/base/resolve-getter\n*\n* @example\n* var resolveGetter = require( '@stdlib/array/base/resolve-getter' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = resolveGetter( arr );\n* var v = get( arr, 2 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar resolveGetter = require( './../../../base/resolve-getter' );\n\n\n// MAIN //\n\n/**\n* Splits array element entries into two groups.\n*\n* @param {Collection} x - input array\n* @param {Collection} filter - array indicating which group an element in the input array belongs to\n* @throws {RangeError} must provide arrays having the same length\n* @returns {ArrayArray} results\n*\n* @example\n* var x = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcateEntries( x, filter );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\nfunction bifurcateEntries( x, filter ) {\n\tvar xget;\n\tvar gget;\n\tvar len;\n\tvar out;\n\tvar g;\n\tvar v;\n\tvar i;\n\n\t// Get the number of elements to group:\n\tlen = x.length;\n\tif ( filter.length !== len ) {\n\t\tthrow new RangeError( 'invalid argument. The first and second arguments must have the same length.' );\n\t}\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\t// Resolve accessors for retrieving array elements:\n\txget = resolveGetter( x );\n\tgget = resolveGetter( filter );\n\n\t// Loop over the elements and assign each to a group...\n\tout = [ [], [] ];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = xget( x, i );\n\t\tg = gget( filter, i );\n\t\tif ( g ) {\n\t\t\tout[ 0 ].push( [ i, v ] );\n\t\t} else {\n\t\t\tout[ 1 ].push( [ i, v ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateEntries;\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* Split array element entries into two groups.\n*\n* @module @stdlib/array/base/bifurcate-entries\n*\n* @example\n* var bifurcateEntries = require( '@stdlib/array/base/bifurcate-entries' );\n*\n* var x = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcateEntries( x, filter );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar resolveGetter = require( './../../../base/resolve-getter' );\n\n\n// MAIN //\n\n/**\n* Splits array element indices into two groups.\n*\n* @param {Collection} x - input array\n* @param {Collection} filter - array indicating which group an element in the input array belongs to\n* @throws {RangeError} must provide arrays having the same length\n* @returns {ArrayArray} results\n*\n* @example\n* var x = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcateIndices( x, filter );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*/\nfunction bifurcateIndices( x, filter ) {\n\tvar gget;\n\tvar len;\n\tvar out;\n\tvar g;\n\tvar i;\n\n\t// Get the number of elements to group:\n\tlen = x.length;\n\tif ( filter.length !== len ) {\n\t\tthrow new RangeError( 'invalid argument. The first and second arguments must have the same length.' );\n\t}\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\t// Resolve accessors for retrieving array elements:\n\tgget = resolveGetter( filter );\n\n\t// Loop over the elements and assign each to a group...\n\tout = [ [], [] ];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tg = gget( filter, i );\n\t\tif ( g ) {\n\t\t\tout[ 0 ].push( i );\n\t\t} else {\n\t\t\tout[ 1 ].push( i );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateIndices;\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* Split array element indices into two groups.\n*\n* @module @stdlib/array/base/bifurcate-indices\n*\n* @example\n* var bifurcateIndices = require( '@stdlib/array/base/bifurcate-indices' );\n*\n* var x = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcateIndices( x, filter );\n* // returns [ [ 0, 1, 3 ], [ 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 resolveGetter = require( './../../../base/resolve-getter' );\n\n\n// MAIN //\n\n/**\n* Splits array element values into two groups.\n*\n* @param {Collection} x - input array\n* @param {Collection} filter - array indicating which group an element in the input array belongs to\n* @throws {RangeError} must provide arrays having the same length\n* @returns {ArrayArray} results\n*\n* @example\n* var x = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcateValues( x, filter );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*/\nfunction bifurcateValues( x, filter ) {\n\tvar xget;\n\tvar gget;\n\tvar len;\n\tvar out;\n\tvar g;\n\tvar v;\n\tvar i;\n\n\t// Get the number of elements to group:\n\tlen = x.length;\n\tif ( filter.length !== len ) {\n\t\tthrow new RangeError( 'invalid argument. The first and second arguments must have the same length.' );\n\t}\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\t// Resolve accessors for retrieving array elements:\n\txget = resolveGetter( x );\n\tgget = resolveGetter( filter );\n\n\t// Loop over the elements and assign each to a group...\n\tout = [ [], [] ];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = xget( x, i );\n\t\tg = gget( filter, i );\n\t\tif ( g ) {\n\t\t\tout[ 0 ].push( v );\n\t\t} else {\n\t\t\tout[ 1 ].push( v );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateValues;\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* Split array element values into two groups.\n*\n* @module @stdlib/array/base/bifurcate-values\n*\n* @example\n* var bifurcateValues = require( '@stdlib/array/base/bifurcate-values' );\n*\n* var x = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcateValues( x, filter );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two two-dimensional nested input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = ones2d( shape );\n* var y = ones2d( shape );\n* var z = zeros2d( shape );\n*\n* binary2d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\nfunction binary2d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tS0 = shape[ 1 ];\n\tS1 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tx0 = x[ i1 ];\n\t\ty0 = y[ i1 ];\n\t\tz0 = z[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tz0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ] );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = binary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a binary callback to elements in two two-dimensional nested input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/binary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var binary2d = require( '@stdlib/array/base/binary2d' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = ones2d( shape );\n* var y = ones2d( shape );\n* var z = zeros2d( shape );\n*\n* binary2d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two three-dimensional nested input arrays and assigns results to elements in a three-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shape = [ 2, 2, 2 ];\n*\n* var x = ones3d( shape );\n* var y = ones3d( shape );\n* var z = zeros3d( shape );\n*\n* binary3d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\nfunction binary3d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar z0;\n\tvar z1;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tS0 = shape[ 2 ];\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tx1 = x[ i2 ];\n\t\ty1 = y[ i2 ];\n\t\tz1 = z[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tx0 = x1[ i1 ];\n\t\t\ty0 = y1[ i1 ];\n\t\t\tz0 = z1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tz0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ] );\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = binary3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a binary callback to elements in two three-dimensional nested input arrays and assign results to elements in a three-dimensional nested output array.\n*\n* @module @stdlib/array/base/binary3d\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var binary3d = require( '@stdlib/array/base/binary3d' );\n*\n* var shape = [ 2, 2, 2 ];\n*\n* var x = ones3d( shape );\n* var y = ones3d( shape );\n* var z = zeros3d( shape );\n*\n* binary3d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two four-dimensional nested input arrays and assigns results to elements in a four-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shape = [ 1, 2, 2, 2 ];\n*\n* var x = ones4d( shape );\n* var y = ones4d( shape );\n* var z = zeros4d( shape );\n*\n* binary4d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ]\n*/\nfunction binary4d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar z0;\n\tvar z1;\n\tvar z2;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tS0 = shape[ 3 ];\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tx2 = x[ i3 ];\n\t\ty2 = y[ i3 ];\n\t\tz2 = z[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tx1 = x2[ i2 ];\n\t\t\ty1 = y2[ i2 ];\n\t\t\tz1 = z2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tx0 = x1[ i1 ];\n\t\t\t\ty0 = y1[ i1 ];\n\t\t\t\tz0 = z1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tz0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = binary4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a binary callback to elements in two four-dimensional nested input arrays and assign results to elements in a four-dimensional nested output array.\n*\n* @module @stdlib/array/base/binary4d\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var binary4d = require( '@stdlib/array/base/binary4d' );\n*\n* var shape = [ 1, 2, 2, 2 ];\n*\n* var x = ones4d( shape );\n* var y = ones4d( shape );\n* var z = zeros4d( shape );\n*\n* binary4d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two five-dimensional nested input arrays and assigns results to elements in a five-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shape = [ 1, 1, 2, 2, 2 ];\n*\n* var x = ones5d( shape );\n* var y = ones5d( shape );\n* var z = zeros5d( shape );\n*\n* binary5d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ] ]\n*/\nfunction binary5d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar x3;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar y3;\n\tvar z0;\n\tvar z1;\n\tvar z2;\n\tvar z3;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tS0 = shape[ 4 ];\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 || S4 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tx3 = x[ i4 ];\n\t\ty3 = y[ i4 ];\n\t\tz3 = z[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tx2 = x3[ i3 ];\n\t\t\ty2 = y3[ i3 ];\n\t\t\tz2 = z3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tx1 = x2[ i2 ];\n\t\t\t\ty1 = y2[ i2 ];\n\t\t\t\tz1 = z2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tx0 = x1[ i1 ];\n\t\t\t\t\ty0 = y1[ i1 ];\n\t\t\t\t\tz0 = z1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tz0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = binary5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a binary callback to elements in two five-dimensional nested input arrays and assign results to elements in a five-dimensional nested output array.\n*\n* @module @stdlib/array/base/binary5d\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var binary5d = require( '@stdlib/array/base/binary5d' );\n*\n* var shape = [ 1, 1, 2, 2, 2 ];\n*\n* var x = ones5d( shape );\n* var y = ones5d( shape );\n* var z = zeros5d( shape );\n*\n* binary5d( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Recursively applies a binary callback.\n*\n* @private\n* @param {ArrayLikeObject} x - input array\n* @param {ArrayLikeObject} y - input array\n* @param {ArrayLikeObject} z - output array\n* @param {NonNegativeInteger} ndims - number of dimensions\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {NonNegativeInteger} dim - dimension index\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*/\nfunction recurse( x, y, z, ndims, shape, dim, fcn ) {\n\tvar S;\n\tvar d;\n\tvar i;\n\n\tS = shape[ dim ];\n\n\t// Check whether we've reached the innermost dimension:\n\td = dim + 1;\n\n\tif ( d === ndims ) {\n\t\t// Apply the provided callback...\n\t\tfor ( i = 0; i < S; i++ ) {\n\t\t\tz[ i ] = fcn( x[ i ], y[ i ] );\n\t\t}\n\t\treturn;\n\t}\n\t// Continue recursing into the nested arrays...\n\tfor ( i = 0; i < S; i++ ) {\n\t\trecurse( x[ i ], y[ i ], z[ i ], ndims, shape, d, fcn );\n\t}\n}\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two n-dimensional nested input arrays and assigns results to elements in an n-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add' );\n* var onesnd = require( '@stdlib/array/base/onesnd' );\n* var zerosnd = require( '@stdlib/array/base/zerosnd' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = onesnd( shape );\n* var y = onesnd( shape );\n* var z = zerosnd( shape );\n*\n* binarynd( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\nfunction binarynd( arrays, shape, fcn ) {\n\treturn recurse( arrays[ 0 ], arrays[ 1 ], arrays[ 2 ], shape.length, shape, 0, fcn ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = binarynd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a binary callback to elements in an n-dimensional nested input array and assign results to elements in an n-dimensional nested output array.\n*\n* @module @stdlib/array/base/binarynd\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add' );\n* var onesnd = require( '@stdlib/array/base/onesnd' );\n* var zerosnd = require( '@stdlib/array/base/zerosnd' );\n* var binarynd = require( '@stdlib/array/base/binarynd' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = onesnd( shape );\n* var y = onesnd( shape );\n* var z = zerosnd( shape );\n*\n* binarynd( [ x, y, z ], shape, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies the elements of an indexed array-like object to a new \"generic\" array.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\n\tlen = x.length;\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( x[ i ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = copy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Copy the elements of an indexed array-like object to a new \"generic\" array.\n*\n* @module @stdlib/array/base/copy-indexed\n*\n* @example\n* var copy = require( '@stdlib/array/base/copy-indexed' );\n*\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a filled \"generic\" array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} filled array\n*\n* @example\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\nfunction filled( value, len ) {\n\tvar arr;\n\tvar i;\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tarr.push( value );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled \"generic\" array.\n*\n* @module @stdlib/array/base/filled\n*\n* @example\n* var filled = require( '@stdlib/array/base/filled' );\n*\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var filled = require( '@stdlib/array/base/filled' );\n*\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled \"generic\" array.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\nfunction zeros( len ) {\n\treturn filled( 0.0, len );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zeros;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a zero-filled \"generic\" array.\n*\n* @module @stdlib/array/base/zeros\n*\n* @example\n* var zeros = require( '@stdlib/array/base/zeros' );\n*\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar copy = require( './../../../base/copy-indexed' );\nvar zeros = require( './../../../base/zeros' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Broadcasts an array to a specified shape.\n*\n* @param {Collection} x - input array\n* @param {NonNegativeIntegerArray} inShape - input array shape\n* @param {NonNegativeIntegerArray} outShape - output array shape\n* @throws {Error} input array cannot have more dimensions than the desired shape\n* @throws {Error} input array dimension sizes must be `1` or equal to the corresponding dimension in the provided output shape\n* @throws {Error} input array and desired shape must be broadcast compatible\n* @returns {Object} broadcast object\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 2 ] );\n* // returns {...}\n*\n* var shape = out.shape;\n* // returns [ 2, 2 ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1 ]\n*\n* var ref = out.ref;\n* // returns [ 1, 2 ]\n*\n* var bool = ( x === ref );\n* // returns true\n*\n* var data = out.data;\n* // returns [ [ 1, 2 ] ]\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 1, 2 ] );\n* // returns {...}\n*\n* var data = out.data;\n* // returns [ [ [ 1, 2 ] ] ]\n*\n* var strides = out.strides;\n* // returns [ 0, 0, 1 ]\n*\n* @example\n* var x = [ [ 1 ], [ 2 ] ];\n*\n* var out = broadcastArray( x, [ 2, 1 ], [ 3, 2, 2 ] );\n* // returns {...}\n*\n* var data = out.data;\n* // returns [ [ [ 1 ], [ 2 ] ] ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1, 0 ]\n*/\nfunction broadcastArray( x, inShape, outShape ) {\n\tvar data;\n\tvar dim;\n\tvar st;\n\tvar N;\n\tvar M;\n\tvar d;\n\tvar i;\n\tvar j;\n\n\tN = outShape.length;\n\tM = inShape.length;\n\tif ( N < M ) {\n\t\tthrow new Error( 'invalid argument. Cannot broadcast an array to a shape having fewer dimensions. Arrays can only be broadcasted to shapes having the same or more dimensions.' );\n\t}\n\t// Prepend additional dimensions...\n\tdata = x;\n\tfor ( i = M; i < N; i++ ) {\n\t\tdata = [ data ];\n\t}\n\n\t// Initialize a strides array:\n\tst = zeros( N );\n\n\t// Determine the output array strides...\n\tfor ( i = N-1; i >= 0; i-- ) {\n\t\tj = M - N + i;\n\t\tif ( j < 0 ) {\n\t\t\t// Prepended singleton dimension; stride is zero...\n\t\t\tcontinue;\n\t\t}\n\t\td = inShape[ j ];\n\t\tdim = outShape[ i ];\n\t\tif ( dim !== 0 && dim < d ) {\n\t\t\tthrow new Error( format( 'invalid argument. Input array cannot be broadcast to the specified shape, as the specified shape has a dimension whose size is less than the size of the corresponding dimension in the input array. Array shape: (%s). Desired shape: (%s). Dimension: %u.', copy( inShape ).join( ', ' ), copy( outShape ).join( ', ' ), i ) );\n\t\t}\n\t\tif ( d === dim ) {\n\t\t\t// As the dimension sizes are equal, the stride is one, meaning that each element in the array should be iterated over as normal...\n\t\t\tst[ i ] = 1;\n\t\t} else if ( d === 1 ) {\n\t\t\t// In order to broadcast a dimension, we set the stride for that dimension to zero...\n\t\t\tst[ i ] = 0;\n\t\t} else {\n\t\t\t// At this point, we know that `dim > d` and that `d` does not equal `1` (e.g., `dim=3` and `d=2`); in which case, the shapes are considered incompatible (even for desired shapes which are multiples of array dimensions, as might be desired when \"tiling\" an array; e.g., `dim=4` and `d=2`)...\n\t\t\tthrow new Error( format( 'invalid argument. Input array and the specified shape are broadcast incompatible. Array shape: (%s). Desired shape: (%s). Dimension: %u.', copy( inShape ).join( ', ' ), copy( outShape ).join( ', ' ), i ) );\n\t\t}\n\t}\n\t// Return broadcast results:\n\treturn {\n\t\t'ref': x, // reference to the original input array\n\t\t'data': data, // broadcasted array\n\t\t'shape': copy( outShape ), // copy in order to prevent mutation\n\t\t'strides': st\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = broadcastArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Broadcast an array to a specified shape.\n*\n* @module @stdlib/array/base/broadcast-array\n*\n* @example\n* var broadcastArray = require( '@stdlib/array/base/broadcast-array' );\n*\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 2 ] );\n* // returns {...}\n*\n* var shape = out.shape;\n* // returns [ 2, 2 ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1 ]\n*\n* var ref = out.ref;\n* // returns [ 1, 2 ]\n*\n* var bool = ( x === ref );\n* // returns true\n*\n* var data = out.data;\n* // returns [ [ 1, 2 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = zeros2d( shapes[ 2 ] );\n*\n* bbinary2d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\nfunction bbinary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar k0;\n\tvar k1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tsh = shapes[ 2 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 1 ];\n\tdy1 = st[ 0 ];\n\n\tz = arrays[ 2 ];\n\n\tj1 = 0;\n\tk1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tk0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ k1 ];\n\t\tz0 = z[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tz0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ] );\n\t\t\tj0 += dx0;\n\t\t\tk0 += dy0;\n\t\t}\n\t\tj1 += dx1;\n\t\tk1 += dy1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bbinary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-binary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var bbinary2d = require( '@stdlib/array/base/broadcasted-binary2d' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = zeros2d( shapes[ 2 ] );\n*\n* bbinary2d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a three-dimensional nested output array.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 2, 1, 1 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = zeros3d( shapes[ 2 ] );\n*\n* bbinary3d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\nfunction bbinary3d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar k0;\n\tvar k1;\n\tvar k2;\n\tvar x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar z0;\n\tvar z1;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tsh = shapes[ 2 ];\n\tS0 = sh[ 2 ];\n\tS1 = sh[ 1 ];\n\tS2 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 2 ];\n\tdx1 = st[ 1 ];\n\tdx2 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 2 ];\n\tdy1 = st[ 1 ];\n\tdy2 = st[ 0 ];\n\n\tz = arrays[ 2 ];\n\n\tj2 = 0;\n\tk2 = 0;\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tj1 = 0;\n\t\tk1 = 0;\n\t\tx1 = x[ j2 ];\n\t\ty1 = y[ k2 ];\n\t\tz1 = z[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tj0 = 0;\n\t\t\tk0 = 0;\n\t\t\tx0 = x1[ j1 ];\n\t\t\ty0 = y1[ k1 ];\n\t\t\tz0 = z1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tz0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ] );\n\t\t\t\tj0 += dx0;\n\t\t\t\tk0 += dy0;\n\t\t\t}\n\t\t\tj1 += dx1;\n\t\t\tk1 += dy1;\n\t\t}\n\t\tj2 += dx2;\n\t\tk2 += dy2;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bbinary3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a three-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-binary3d\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var bbinary3d = require( '@stdlib/array/base/broadcasted-binary3d' );\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 2, 1, 1 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = zeros3d( shapes[ 2 ] );\n*\n* bbinary3d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a four-dimensional nested output array.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shapes = [\n* [ 1, 1, 1, 2 ],\n* [ 1, 2, 1, 1 ],\n* [ 1, 2, 2, 2 ]\n* ];\n*\n* var x = ones4d( shapes[ 0 ] );\n* var y = ones4d( shapes[ 1 ] );\n* var z = zeros4d( shapes[ 2 ] );\n*\n* bbinary4d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ]\n*/\nfunction bbinary4d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar k0;\n\tvar k1;\n\tvar k2;\n\tvar k3;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar z0;\n\tvar z1;\n\tvar z2;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tsh = shapes[ 2 ];\n\tS0 = sh[ 3 ];\n\tS1 = sh[ 2 ];\n\tS2 = sh[ 1 ];\n\tS3 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 3 ];\n\tdx1 = st[ 2 ];\n\tdx2 = st[ 1 ];\n\tdx3 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 3 ];\n\tdy1 = st[ 2 ];\n\tdy2 = st[ 1 ];\n\tdy3 = st[ 0 ];\n\n\tz = arrays[ 2 ];\n\n\tj3 = 0;\n\tk3 = 0;\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tj2 = 0;\n\t\tk2 = 0;\n\t\tx2 = x[ j3 ];\n\t\ty2 = y[ k3 ];\n\t\tz2 = z[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tj1 = 0;\n\t\t\tk1 = 0;\n\t\t\tx1 = x2[ j2 ];\n\t\t\ty1 = y2[ k2 ];\n\t\t\tz1 = z2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tj0 = 0;\n\t\t\t\tk0 = 0;\n\t\t\t\tx0 = x1[ j1 ];\n\t\t\t\ty0 = y1[ k1 ];\n\t\t\t\tz0 = z1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tz0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ] );\n\t\t\t\t\tj0 += dx0;\n\t\t\t\t\tk0 += dy0;\n\t\t\t\t}\n\t\t\t\tj1 += dx1;\n\t\t\t\tk1 += dy1;\n\t\t\t}\n\t\t\tj2 += dx2;\n\t\t\tk2 += dy2;\n\t\t}\n\t\tj3 += dx3;\n\t\tk3 += dy3;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bbinary4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a four-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-binary4d\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var bbinary4d = require( '@stdlib/array/base/broadcasted-binary4d' );\n*\n* var shapes = [\n* [ 1, 1, 1, 2 ],\n* [ 1, 2, 1, 1 ],\n* [ 1, 2, 2, 2 ]\n* ];\n*\n* var x = ones4d( shapes[ 0 ] );\n* var y = ones4d( shapes[ 1 ] );\n* var z = zeros4d( shapes[ 2 ] );\n*\n* bbinary4d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a five-dimensional nested output array.\n*\n* @param {ArrayLikeObject} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var shapes = [\n* [ 1, 1, 1, 1, 2 ],\n* [ 1, 1, 2, 1, 1 ],\n* [ 1, 1, 2, 2, 2 ]\n* ];\n*\n* var x = ones5d( shapes[ 0 ] );\n* var y = ones5d( shapes[ 1 ] );\n* var z = zeros5d( shapes[ 2 ] );\n*\n* bbinary5d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ] ]\n*/\nfunction bbinary5d( arrays, shapes, fcn ) { // eslint-disable-line max-statements\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dy3;\n\tvar dy4;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar k0;\n\tvar k1;\n\tvar k2;\n\tvar k3;\n\tvar k4;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar x3;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar y3;\n\tvar z0;\n\tvar z1;\n\tvar z2;\n\tvar z3;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tsh = shapes[ 2 ];\n\tS0 = sh[ 4 ];\n\tS1 = sh[ 3 ];\n\tS2 = sh[ 2 ];\n\tS3 = sh[ 1 ];\n\tS4 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 || S4 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 4 ];\n\tdx1 = st[ 3 ];\n\tdx2 = st[ 2 ];\n\tdx3 = st[ 1 ];\n\tdx4 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 4 ];\n\tdy1 = st[ 3 ];\n\tdy2 = st[ 2 ];\n\tdy3 = st[ 1 ];\n\tdy4 = st[ 0 ];\n\n\tz = arrays[ 2 ];\n\n\tj4 = 0;\n\tk4 = 0;\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tj3 = 0;\n\t\tk3 = 0;\n\t\tx3 = x[ j4 ];\n\t\ty3 = y[ k4 ];\n\t\tz3 = z[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tj2 = 0;\n\t\t\tk2 = 0;\n\t\t\tx2 = x3[ j3 ];\n\t\t\ty2 = y3[ k3 ];\n\t\t\tz2 = z3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tj1 = 0;\n\t\t\t\tk1 = 0;\n\t\t\t\tx1 = x2[ j2 ];\n\t\t\t\ty1 = y2[ k2 ];\n\t\t\t\tz1 = z2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tj0 = 0;\n\t\t\t\t\tk0 = 0;\n\t\t\t\t\tx0 = x1[ j1 ];\n\t\t\t\t\ty0 = y1[ k1 ];\n\t\t\t\t\tz0 = z1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tz0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ] );\n\t\t\t\t\t\tj0 += dx0;\n\t\t\t\t\t\tk0 += dy0;\n\t\t\t\t\t}\n\t\t\t\t\tj1 += dx1;\n\t\t\t\t\tk1 += dy1;\n\t\t\t\t}\n\t\t\t\tj2 += dx2;\n\t\t\t\tk2 += dy2;\n\t\t\t}\n\t\t\tj3 += dx3;\n\t\t\tk3 += dy3;\n\t\t}\n\t\tj4 += dx4;\n\t\tk4 += dy4;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bbinary5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a five-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-binary5d\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var bbinary5d = require( '@stdlib/array/base/broadcasted-binary5d' );\n*\n* var shapes = [\n* [ 1, 1, 1, 1, 2 ],\n* [ 1, 1, 2, 1, 1 ],\n* [ 1, 1, 2, 2, 2 ]\n* ];\n*\n* var x = ones5d( shapes[ 0 ] );\n* var y = ones5d( shapes[ 1 ] );\n* var z = zeros5d( shapes[ 2 ] );\n*\n* bbinary5d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a quaternary callback to elements in four broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing four input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - quaternary callback\n* @returns {void}\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add4' );\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var w = ones2d( shapes[ 3 ] );\n* var out = zeros2d( shapes[ 4 ] );\n*\n* bquaternary2d( [ x, y, z, w, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 4.0, 4.0 ], [ 4.0, 4.0 ] ]\n*/\nfunction bquaternary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar dz0;\n\tvar dz1;\n\tvar dw0;\n\tvar dw1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar k0;\n\tvar k1;\n\tvar m0;\n\tvar m1;\n\tvar n0;\n\tvar n1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar w0;\n\tvar u0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\tvar u;\n\n\tsh = shapes[ 4 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 1 ];\n\tdy1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );\n\tz = o.data;\n\tst = o.strides;\n\tdz0 = st[ 1 ];\n\tdz1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 3 ], shapes[ 3 ], sh );\n\tw = o.data;\n\tst = o.strides;\n\tdw0 = st[ 1 ];\n\tdw1 = st[ 0 ];\n\n\tu = arrays[ 4 ];\n\n\tj1 = 0;\n\tk1 = 0;\n\tm1 = 0;\n\tn1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tk0 = 0;\n\t\tm0 = 0;\n\t\tn0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ k1 ];\n\t\tz0 = z[ m1 ];\n\t\tw0 = w[ n1 ];\n\t\tu0 = u[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tu0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ], w0[ n0 ] );\n\t\t\tj0 += dx0;\n\t\t\tk0 += dy0;\n\t\t\tm0 += dz0;\n\t\t\tn0 += dw0;\n\t\t}\n\t\tj1 += dx1;\n\t\tk1 += dy1;\n\t\tm1 += dz1;\n\t\tn1 += dw1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bquaternary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a quaternary callback to elements in four broadcasted input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-quaternary2d\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add4' );\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var bquaternary2d = require( '@stdlib/array/base/broadcasted-quaternary2d' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var w = ones2d( shapes[ 3 ] );\n* var out = zeros2d( shapes[ 4 ] );\n*\n* bquaternary2d( [ x, y, z, w, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 4.0, 4.0 ], [ 4.0, 4.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a quinary callback to elements in five broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing five input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - quinary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n*\n* function add( x, y, z, w, v ) {\n* return x + y + z + w + v;\n* }\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ],\n* [ 1, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var w = ones2d( shapes[ 3 ] );\n* var v = ones2d( shapes[ 4 ] );\n* var out = zeros2d( shapes[ 5 ] );\n*\n* bquinary2d( [ x, y, z, w, v, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ]\n*/\nfunction bquinary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar dz0;\n\tvar dz1;\n\tvar dw0;\n\tvar dw1;\n\tvar du0;\n\tvar du1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar k0;\n\tvar k1;\n\tvar m0;\n\tvar m1;\n\tvar n0;\n\tvar n1;\n\tvar p0;\n\tvar p1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar w0;\n\tvar u0;\n\tvar v0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\tvar u;\n\tvar v;\n\n\tsh = shapes[ 5 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 1 ];\n\tdy1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );\n\tz = o.data;\n\tst = o.strides;\n\tdz0 = st[ 1 ];\n\tdz1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 3 ], shapes[ 3 ], sh );\n\tw = o.data;\n\tst = o.strides;\n\tdw0 = st[ 1 ];\n\tdw1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 4 ], shapes[ 4 ], sh );\n\tu = o.data;\n\tst = o.strides;\n\tdu0 = st[ 1 ];\n\tdu1 = st[ 0 ];\n\n\tv = arrays[ 5 ];\n\n\tj1 = 0;\n\tk1 = 0;\n\tm1 = 0;\n\tn1 = 0;\n\tp1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tk0 = 0;\n\t\tm0 = 0;\n\t\tn0 = 0;\n\t\tp0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ k1 ];\n\t\tz0 = z[ m1 ];\n\t\tw0 = w[ n1 ];\n\t\tu0 = u[ p1 ];\n\t\tv0 = v[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tv0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ], w0[ n0 ], u0[ p0 ] );\n\t\t\tj0 += dx0;\n\t\t\tk0 += dy0;\n\t\t\tm0 += dz0;\n\t\t\tn0 += dw0;\n\t\t\tp0 += du0;\n\t\t}\n\t\tj1 += dx1;\n\t\tk1 += dy1;\n\t\tm1 += dz1;\n\t\tn1 += dw1;\n\t\tp1 += du1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bquinary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a quinary callback to elements in five broadcasted input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-quinary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var bquinary2d = require( '@stdlib/array/base/broadcasted-quinary2d' );\n*\n* function add( x, y, z, w, v ) {\n* return x + y + z + w + v;\n* }\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ],\n* [ 1, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var w = ones2d( shapes[ 3 ] );\n* var v = ones2d( shapes[ 4 ] );\n* var out = zeros2d( shapes[ 5 ] );\n*\n* bquinary2d( [ x, y, z, w, v, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a ternary callback to elements in three broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing three input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - ternary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add3' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var out = zeros2d( shapes[ 3 ] );\n*\n* bternary2d( [ x, y, z, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ]\n*/\nfunction bternary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dy0;\n\tvar dy1;\n\tvar dz0;\n\tvar dz1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar k0;\n\tvar k1;\n\tvar m0;\n\tvar m1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar w0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\n\tsh = shapes[ 3 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 1 ];\n\tdy1 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );\n\tz = o.data;\n\tst = o.strides;\n\tdz0 = st[ 1 ];\n\tdz1 = st[ 0 ];\n\n\tw = arrays[ 3 ];\n\n\tj1 = 0;\n\tk1 = 0;\n\tm1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tk0 = 0;\n\t\tm0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ k1 ];\n\t\tz0 = z[ m1 ];\n\t\tw0 = w[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tw0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ] );\n\t\t\tj0 += dx0;\n\t\t\tk0 += dy0;\n\t\t\tm0 += dz0;\n\t\t}\n\t\tj1 += dx1;\n\t\tk1 += dy1;\n\t\tm1 += dz1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bternary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a ternary callback to elements in three broadcasted input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-ternary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var add = require( '@stdlib/math/base/ops/add3' );\n* var bternary2d = require( '@stdlib/array/base/broadcasted-ternary2d' );\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 1 ],\n* [ 1, 1 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = ones2d( shapes[ 1 ] );\n* var z = ones2d( shapes[ 2 ] );\n* var out = zeros2d( shapes[ 3 ] );\n*\n* bternary2d( [ x, y, z, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a two-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing one input nested array and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - unary callback\n* @returns {void}\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = zeros2d( shapes[ 1 ] );\n*\n* bunary2d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ]\n*/\nfunction bunary2d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar x0;\n\tvar y0;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\n\tsh = shapes[ 1 ];\n\tS0 = sh[ 1 ];\n\tS1 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 1 ];\n\tdx1 = st[ 0 ];\n\n\ty = arrays[ 1 ];\n\n\tj1 = 0;\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tj0 = 0;\n\t\tx0 = x[ j1 ];\n\t\ty0 = y[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\ty0[ i0 ] = fcn( x0[ j0 ] );\n\t\t\tj0 += dx0;\n\t\t}\n\t\tj1 += dx1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bunary2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-unary2d\n*\n* @example\n* var ones2d = require( '@stdlib/array/base/ones2d' );\n* var zeros2d = require( '@stdlib/array/base/zeros2d' );\n* var bunary2d = require( '@stdlib/array/base/broadcasted-unary2d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 2 ],\n* [ 2, 2 ]\n* ];\n*\n* var x = ones2d( shapes[ 0 ] );\n* var y = zeros2d( shapes[ 1 ] );\n*\n* bunary2d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a three-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing one input nested array and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - unary callback\n* @returns {void}\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 1, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = zeros3d( shapes[ 1 ] );\n*\n* bunary3d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ]\n*/\nfunction bunary3d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\n\tsh = shapes[ 1 ];\n\tS0 = sh[ 2 ];\n\tS1 = sh[ 1 ];\n\tS2 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 2 ];\n\tdx1 = st[ 1 ];\n\tdx2 = st[ 0 ];\n\n\ty = arrays[ 1 ];\n\tj2 = 0;\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tj1 = 0;\n\t\tx1 = x[ j2 ];\n\t\ty1 = y[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tj0 = 0;\n\t\t\tx0 = x1[ j1 ];\n\t\t\ty0 = y1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\ty0[ i0 ] = fcn( x0[ j0 ] );\n\t\t\t\tj0 += dx0;\n\t\t\t}\n\t\t\tj1 += dx1;\n\t\t}\n\t\tj2 += dx2;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bunary3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a three-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-unary3d\n*\n* @example\n* var ones3d = require( '@stdlib/array/base/ones3d' );\n* var zeros3d = require( '@stdlib/array/base/zeros3d' );\n* var bunary3d = require( '@stdlib/array/base/broadcasted-unary3d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 1, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = zeros3d( shapes[ 1 ] );\n*\n* bunary3d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a four-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing one input nested array and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - unary callback\n* @returns {void}\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 1, 2 ],\n* [ 1, 1, 2, 2 ]\n* ];\n*\n* var x = ones4d( shapes[ 0 ] );\n* var y = zeros4d( shapes[ 1 ] );\n*\n* bunary4d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ]\n*/\nfunction bunary4d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\n\tsh = shapes[ 1 ];\n\tS0 = sh[ 3 ];\n\tS1 = sh[ 2 ];\n\tS2 = sh[ 1 ];\n\tS3 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 3 ];\n\tdx1 = st[ 2 ];\n\tdx2 = st[ 1 ];\n\tdx3 = st[ 0 ];\n\n\ty = arrays[ 1 ];\n\tj3 = 0;\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tj2 = 0;\n\t\tx2 = x[ j3 ];\n\t\ty2 = y[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tj1 = 0;\n\t\t\tx1 = x2[ j2 ];\n\t\t\ty1 = y2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tj0 = 0;\n\t\t\t\tx0 = x1[ j1 ];\n\t\t\t\ty0 = y1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\ty0[ i0 ] = fcn( x0[ j0 ] );\n\t\t\t\t\tj0 += dx0;\n\t\t\t\t}\n\t\t\t\tj1 += dx1;\n\t\t\t}\n\t\t\tj2 += dx2;\n\t\t}\n\t\tj3 += dx3;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bunary4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a four-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-unary4d\n*\n* @example\n* var ones4d = require( '@stdlib/array/base/ones4d' );\n* var zeros4d = require( '@stdlib/array/base/zeros4d' );\n* var bunary4d = require( '@stdlib/array/base/broadcasted-unary4d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 1, 2 ],\n* [ 1, 1, 2, 2 ]\n* ];\n*\n* var x = ones4d( shapes[ 0 ] );\n* var y = zeros4d( shapes[ 1 ] );\n*\n* bunary4d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar broadcastArray = require( './../../../base/broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a unary callback to elements in a broadcasted nested input array and assigns results to elements in a five-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing one input nested array and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - unary callback\n* @returns {void}\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 1, 1, 2 ],\n* [ 1, 1, 1, 2, 2 ]\n* ];\n*\n* var x = ones5d( shapes[ 0 ] );\n* var y = zeros5d( shapes[ 1 ] );\n*\n* bunary5d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ] ]\n*/\nfunction bunary5d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar x3;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar y3;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\n\tsh = shapes[ 1 ];\n\tS0 = sh[ 4 ];\n\tS1 = sh[ 3 ];\n\tS2 = sh[ 2 ];\n\tS3 = sh[ 1 ];\n\tS4 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 || S4 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 4 ];\n\tdx1 = st[ 3 ];\n\tdx2 = st[ 2 ];\n\tdx3 = st[ 1 ];\n\tdx4 = st[ 0 ];\n\n\ty = arrays[ 1 ];\n\tj4 = 0;\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tj3 = 0;\n\t\tx3 = x[ j4 ];\n\t\ty3 = y[ i4 ];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tj2 = 0;\n\t\t\tx2 = x3[ j3 ];\n\t\t\ty2 = y3[ i3 ];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tj1 = 0;\n\t\t\t\tx1 = x2[ j2 ];\n\t\t\t\ty1 = y2[ i2 ];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tj0 = 0;\n\t\t\t\t\tx0 = x1[ j1 ];\n\t\t\t\t\ty0 = y1[ i1 ];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\ty0[ i0 ] = fcn( x0[ j0 ] );\n\t\t\t\t\t\tj0 += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tj1 += dx1;\n\t\t\t\t}\n\t\t\t\tj2 += dx2;\n\t\t\t}\n\t\t\tj3 += dx3;\n\t\t}\n\t\tj4 += dx4;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bunary5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a five-dimensional nested output array.\n*\n* @module @stdlib/array/base/broadcasted-unary5d\n*\n* @example\n* var ones5d = require( '@stdlib/array/base/ones5d' );\n* var zeros5d = require( '@stdlib/array/base/zeros5d' );\n* var bunary5d = require( '@stdlib/array/base/broadcasted-unary5d' );\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var shapes = [\n* [ 1, 1, 1, 1, 2 ],\n* [ 1, 1, 1, 2, 2 ]\n* ];\n*\n* var x = ones5d( shapes[ 0 ] );\n* var y = zeros5d( shapes[ 1 ] );\n*\n* bunary5d( [ x, y ], shapes, scale );\n*\n* console.log( y );\n* // => [ [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns the Cartesian power.\n*\n* ## Notes\n*\n* - The Cartesian power is an n-fold Cartesian product involving a single array. The main insight of this implementation is that the n-fold Cartesian product can be presented as an n-dimensional array stored in row-major order. As such, we can\n*\n* - Compute the total number of tuples, which is simply the size of the provided array (set) raised to the specified power `n`. For n-dimensional arrays, this is the equivalent of computing the product of array dimensions to determine the total number of elements.\n* - Initialize an array for storing indices for indexing into the provided array. For n-dimensional arrays, the index array is equivalent to an array of subscripts for indexing into each dimension.\n* - For the outermost loop, treat the loop index as a linear index into an n-dimensional array and resolve the corresponding subscripts.\n* - Continue iterating until all tuples have been generated.\n*\n* @param {ArrayLikeObject} x - input array\n* @param {NonNegativeInteger} n - power\n* @returns {Array} list of ordered tuples comprising the Cartesian product\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = cartesianPower( x, 2 );\n* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]\n*/\nfunction cartesianPower( x, n ) {\n\tvar out;\n\tvar tmp;\n\tvar idx;\n\tvar len;\n\tvar N;\n\tvar s;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tN = x.length;\n\tif ( N <= 0 || n <= 0 ) {\n\t\treturn [];\n\t}\n\t// Compute the total number of ordered tuples:\n\tlen = pow( N, n );\n\n\t// Initialize a list of indices for indexing into the array (equivalent to ndarray subscripts):\n\tidx = [];\n\tfor ( i = 0; i < n; i++ ) {\n\t\tidx.push( 0 );\n\t}\n\t// Compute the n-fold Cartesian product...\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\t// Resolve a linear index to array indices (logic is equivalent to what is found in ndarray/base/ind2sub for an ndarray stored in row-major order; see https://github.com/stdlib-js/stdlib/blob/215ca5355f3404f15996fd0ced58a98e46f22be6/lib/node_modules/%40stdlib/ndarray/base/ind2sub/lib/assign.js)...\n\t\tk = i;\n\t\tfor ( j = n-1; j >= 0; j-- ) {\n\t\t\ts = k % N;\n\t\t\tk -= s;\n\t\t\tk /= N;\n\t\t\tidx[ j ] = s;\n\t\t}\n\t\t// Generate the next ordered tuple...\n\t\ttmp = [];\n\t\tfor ( j = 0; j < n; j++ ) {\n\t\t\ttmp.push( x[ idx[ j ] ] );\n\t\t}\n\t\tout.push( tmp );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cartesianPower;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the Cartesian power.\n*\n* @module @stdlib/array/base/cartesian-power\n*\n* @example\n* var cartesianPower = require( '@stdlib/array/base/cartesian-power' );\n*\n* var x = [ 1, 2 ];\n*\n* var out = cartesianPower( x, 2 );\n* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]\n*/\n\n// MAIN //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the Cartesian product.\n*\n* @param {ArrayLikeObject} x1 - first input array\n* @param {ArrayLikeObject} x2 - second input array\n* @returns {Array} list of ordered tuples comprising the Cartesian product\n*\n* @example\n* var x1 = [ 1, 2, 3 ];\n* var x2 = [ 4, 5 ];\n*\n* var out = cartesianProduct( x1, x2 );\n* // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ]\n*/\nfunction cartesianProduct( x1, x2 ) {\n\tvar out;\n\tvar M;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tM = x1.length;\n\tN = x2.length;\n\tout = [];\n\tfor ( i = 0; i < M; i++ ) {\n\t\tv = x1[ i ];\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tout.push( [ v, x2[ j ] ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cartesianProduct;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the Cartesian product.\n*\n* @module @stdlib/array/base/cartesian-product\n*\n* @example\n* var cartesianProduct = require( '@stdlib/array/base/cartesian-product' );\n*\n* var x1 = [ 1, 2, 3 ];\n* var x2 = [ 4, 5 ];\n*\n* var out = cartesianProduct( x1, x2 );\n* // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ]\n*/\n\n// MAIN //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the Cartesian square.\n*\n* @param {ArrayLikeObject} x - input array\n* @returns {Array} list of ordered tuples comprising the Cartesian product\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = cartesianSquare( x );\n* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]\n*/\nfunction cartesianSquare( x ) {\n\tvar out;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tN = x.length;\n\tout = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ i ];\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tout.push( [ v, x[ j ] ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cartesianSquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the Cartesian square.\n*\n* @module @stdlib/array/base/cartesian-square\n*\n* @example\n* var cartesianSquare = require( '@stdlib/array/base/cartesian-square' );\n*\n* var x = [ 1, 2 ];\n*\n* var out = cartesianSquare( x );\n* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]\n*/\n\n// MAIN //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar resolveGetter = require( './../../../base/resolve-getter' );\n\n\n// MAIN //\n\n/**\n* Copies the elements of an array-like object to a new \"generic\" array.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x ) {\n\tvar out;\n\tvar len;\n\tvar get;\n\tvar i;\n\n\t// Resolve an accessor for retrieving input array elements:\n\tget = resolveGetter( x );\n\n\t// Get the number of elements to copy:\n\tlen = x.length;\n\n\t// Loop over the elements...\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( get( x, i ) ); // ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = copy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Copy the elements of an array-like object to a new \"generic\" array.\n*\n* @module @stdlib/array/base/copy\n*\n* @example\n* var copy = require( '@stdlib/array/base/copy' );\n*\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 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 isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// FUNCTIONS //\n\n/**\n* De-duplicates values in-place.\n*\n* @private\n* @param {Array} x - input array\n* @param {PositiveInteger} limit - number of allowed consecutive duplicates\n* @returns {Array} input array\n*\n* @example\n* var x = [ 1, 1, 2, 3, 3 ];\n*\n* var y = dedupeInPlace( x, 1 );\n* // returns [ 1, 2, 3 ]\n*\n* var bool = ( x === y );\n* // returns true\n*\n* @example\n* var x = [ 1, 1, 1, 2, 1, 1, 3, 3 ];\n*\n* var y = dedupeInPlace( x, 2 );\n* // returns [ 1, 1, 2, 1, 1, 3, 3 ]\n*\n* var bool = ( x === y );\n* // returns true\n*/\nfunction dedupeInPlace( x, limit ) {\n\tvar count;\n\tvar prev;\n\tvar len;\n\tvar ptr;\n\tvar v;\n\tvar i;\n\n\tlen = x.length;\n\tif ( len === 0 ) {\n\t\treturn x;\n\t}\n\tprev = x[ 0 ];\n\tcount = 1;\n\tptr = 1;\n\tfor ( i = 1; i < len; i++ ) {\n\t\tv = x[ i ];\n\t\tif ( v === prev ) {\n\t\t\tcount += 1;\n\t\t\tif ( count <= limit ) {\n\t\t\t\tx[ ptr ] = prev;\n\t\t\t\tptr += 1;\n\t\t\t}\n\t\t} else {\n\t\t\tprev = v;\n\t\t\tcount = 1;\n\t\t\tx[ ptr ] = prev;\n\t\t\tptr += 1;\n\t\t}\n\t}\n\tx.length = ptr;\n\treturn x;\n}\n\n/**\n* De-duplicates values in-place, treating `NaN` values as equal.\n*\n* @private\n* @param {Array} x - input array\n* @param {PositiveInteger} limit - number of allowed consecutive duplicates\n* @returns {Array} input array\n*\n* @example\n* var x = [ 1, 1, 2, NaN, NaN, 3, 3 ];\n*\n* var y = dedupeEqualNaNs( x, 1 );\n* // returns [ 1, 2, NaN, 3 ]\n*\n* var bool = ( x === y );\n* // returns true\n*\n* @example\n* var x = [ 1, 1, 1, 2, 1, 1, NaN, NaN, NaN, 3, 3 ];\n*\n* var y = dedupeEqualNaNs( x, 2 );\n* // returns [ 1, 1, 2, 1, 1, NaN, NaN, 3, 3 ]\n*\n* var bool = ( x === y );\n* // returns true\n*/\nfunction dedupeEqualNaNs( x, limit ) {\n\tvar count;\n\tvar prev;\n\tvar len;\n\tvar ptr;\n\tvar FLG;\n\tvar v;\n\tvar i;\n\n\tlen = x.length;\n\tif ( len === 0 ) {\n\t\treturn x;\n\t}\n\tFLG = false;\n\tprev = x[ 0 ];\n\tif ( isnan( prev ) ) {\n\t\tFLG = true;\n\t}\n\tcount = 1;\n\tptr = 1;\n\tfor ( i = 1; i < len; i++ ) {\n\t\tv = x[ i ];\n\t\tif ( v === prev || ( FLG && isnan( v ) ) ) {\n\t\t\tcount += 1;\n\t\t\tif ( count <= limit ) {\n\t\t\t\tx[ ptr ] = prev;\n\t\t\t\tptr += 1;\n\t\t\t}\n\t\t} else {\n\t\t\tprev = v;\n\t\t\tcount = 1;\n\t\t\tx[ ptr ] = prev;\n\t\t\tptr += 1;\n\t\t\tFLG = false;\n\t\t\tif ( isnan( prev ) ) {\n\t\t\t\tFLG = true;\n\t\t\t}\n\t\t}\n\t}\n\tx.length = ptr;\n\treturn x;\n}\n\n\n// MAIN //\n\n/**\n* Removes consecutive duplicated values.\n*\n* @param {Array} x - input array\n* @param {PositiveInteger} limit - number of allowed consecutive duplicates\n* @param {boolean} equalNaNs - boolean indicating whether NaNs should be considered equal\n* @returns {Array} de-duplicated values\n*\n* @example\n* var x = [ 1, 1, 2, 3, 3 ];\n*\n* var y = dedupe( x, 1, false );\n* // returns [ 1, 2, 3 ]\n*\n* var bool = ( x === y );\n* // returns true\n*\n* @example\n* var x = [ 1, 1, 1, 2, 1, 1, 3, 3 ];\n*\n* var y = dedupe( x, 2, false );\n* // returns [ 1, 1, 2, 1, 1, 3, 3 ]\n*\n* var bool = ( x === y );\n* // returns true\n*/\nfunction dedupe( x, limit, equalNaNs ) {\n\tif ( equalNaNs ) {\n\t\treturn dedupeEqualNaNs( x, limit );\n\t}\n\treturn dedupeInPlace( x, limit );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dedupe;\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* Remove consecutive duplicated values.\n*\n* @module @stdlib/array/base/dedupe\n*\n* @example\n* var dedupe = require( '@stdlib/array/base/dedupe' );\n*\n* var x = [ 1, 1, 2, 3, 3 ];\n*\n* var y = dedupe( x, 1, false );\n* // returns [ 1, 2, 3 ]\n*\n* var bool = ( x === y );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a filled \"generic\" array according to a provided callback function.\n*\n* @param {NonNegativeInteger} len - array length\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filledBy( 3, constantFunction( 'beep' ) );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\nfunction filledBy( len, clbk, thisArg ) {\n\tvar arr;\n\tvar i;\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tarr.push( clbk.call( thisArg, i ) );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filledBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled \"generic\" array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filledBy = require( '@stdlib/array/base/filled-by' );\n*\n* var out = filledBy( 3, constantFunction( 'beep' ) );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a filled two-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = filled2d( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var out = filled2d( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\nfunction filled2d( value, shape ) {\n\tvar arr;\n\tvar S0;\n\tvar S1;\n\tvar i;\n\n\tS0 = shape[ 1 ];\n\tS1 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < S1; i++ ) {\n\t\tarr.push( filled( value, S0 ) );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled two-dimensional nested array.\n*\n* @module @stdlib/array/base/filled2d\n*\n* @example\n* var filled2d = require( '@stdlib/array/base/filled2d' );\n*\n* var out = filled2d( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var filled2d = require( '@stdlib/array/base/filled2d' );\n*\n* var out = filled2d( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a filled two-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filled2dBy( [ 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ 'beep', 'beep', 'beep' ] ]\n*/\nfunction filled2dBy( shape, clbk, thisArg ) {\n\tvar arr;\n\tvar a0;\n\tvar S0;\n\tvar S1;\n\tvar i;\n\tvar j;\n\n\tS0 = shape[ 1 ];\n\tS1 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < S1; i++ ) {\n\t\ta0 = [];\n\t\tfor ( j = 0; j < S0; j++ ) {\n\t\t\ta0.push( clbk.call( thisArg, [ i, j ] ) );\n\t\t}\n\t\tarr.push( a0 );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled2dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled two-dimensional nested array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled2d-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filled2dBy = require( '@stdlib/array/base/filled2d-by' );\n*\n* var out = filled2dBy( [ 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ 'beep', 'beep', 'beep' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a filled three-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = filled3d( 0.0, [ 1, 1, 3 ] );\n* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ]\n*\n* @example\n* var out = filled3d( 'beep', [ 1, 3, 1 ] );\n* // returns [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ]\n*/\nfunction filled3d( value, shape ) {\n\tvar out;\n\tvar a1;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i2;\n\tvar i1;\n\n\tS0 = shape[ 2 ];\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tout = [];\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\ta1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta1.push( filled( value, S0 ) );\n\t\t}\n\t\tout.push( a1 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled three-dimensional nested array.\n*\n* @module @stdlib/array/base/filled3d\n*\n* @example\n* var filled3d = require( '@stdlib/array/base/filled3d' );\n*\n* var out = filled3d( 0.0, [ 1, 1, 3 ] );\n* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ]\n*\n* @example\n* var filled3d = require( '@stdlib/array/base/filled3d' );\n*\n* var out = filled3d( 'beep', [ 1, 3, 1 ] );\n* // returns [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a filled three-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filled3dBy( [ 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ 'beep', 'beep', 'beep' ] ] ]\n*/\nfunction filled3dBy( shape, clbk, thisArg ) {\n\tvar arr;\n\tvar a0;\n\tvar a1;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\tS0 = shape[ 2 ];\n\tS1 = shape[ 1 ];\n\tS2 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\ta1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta0 = [];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\ta0.push( clbk.call( thisArg, [ i2, i1, i0 ] ) );\n\t\t\t}\n\t\t\ta1.push( a0 );\n\t\t}\n\t\tarr.push( a1 );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled3dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled three-dimensional nested array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled3d-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filled3dBy = require( '@stdlib/array/base/filled3d-by' );\n*\n* var out = filled3dBy( [ 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ 'beep', 'beep', 'beep' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a filled four-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = filled4d( 0.0, [ 1, 1, 1, 3 ] );\n* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ]\n*\n* @example\n* var out = filled4d( 'beep', [ 1, 1, 3, 1 ] );\n* // returns [ [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ] ]\n*/\nfunction filled4d( value, shape ) {\n\tvar out;\n\tvar a1;\n\tvar a2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\tS0 = shape[ 3 ];\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tout = [];\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\ta2 = [];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\ta1 = [];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\ta1.push( filled( value, S0 ) );\n\t\t\t}\n\t\t\ta2.push( a1 );\n\t\t}\n\t\tout.push( a2 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled four-dimensional nested array.\n*\n* @module @stdlib/array/base/filled4d\n*\n* @example\n* var filled4d = require( '@stdlib/array/base/filled4d' );\n*\n* var out = filled4d( 0.0, [ 1, 1, 1, 3 ] );\n* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ]\n*\n* @example\n* var filled4d = require( '@stdlib/array/base/filled4d' );\n*\n* var out = filled4d( 'beep', [ 1, 1, 3, 1 ] );\n* // returns [ [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a filled four-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filled4dBy( [ 1, 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ]\n*/\nfunction filled4dBy( shape, clbk, thisArg ) {\n\tvar arr;\n\tvar a0;\n\tvar a1;\n\tvar a2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\tS0 = shape[ 3 ];\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\ta2 = [];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\ta1 = [];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\ta0 = [];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\ta0.push( clbk.call( thisArg, [ i3, i2, i1, i0 ] ) );\n\t\t\t\t}\n\t\t\t\ta1.push( a0 );\n\t\t\t}\n\t\t\ta2.push( a1 );\n\t\t}\n\t\tarr.push( a2 );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled4dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled four-dimensional nested array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled4d-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filled4dBy = require( '@stdlib/array/base/filled4d-by' );\n*\n* var out = filled4dBy( [ 1, 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a filled five-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = filled5d( 0.0, [ 1, 1, 1, 1, 3 ] );\n* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ]\n*\n* @example\n* var out = filled5d( 'beep', [ 1, 1, 1, 3, 1 ] );\n* // returns [ [ [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ] ] ]\n*/\nfunction filled5d( value, shape ) {\n\tvar out;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\tS0 = shape[ 4 ];\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tout = [];\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\ta3 = [];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\ta2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta1 = [];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\ta1.push( filled( value, S0 ) );\n\t\t\t\t}\n\t\t\t\ta2.push( a1 );\n\t\t\t}\n\t\t\ta3.push( a2 );\n\t\t}\n\t\tout.push( a3 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled five-dimensional nested array.\n*\n* @module @stdlib/array/base/filled5d\n*\n* @example\n* var filled5d = require( '@stdlib/array/base/filled5d' );\n*\n* var out = filled5d( 0.0, [ 1, 1, 1, 1, 3 ] );\n* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ]\n*\n* @example\n* var filled5d = require( '@stdlib/array/base/filled5d' );\n*\n* var out = filled5d( 'beep', [ 1, 1, 1, 3, 1 ] );\n* // returns [ [ [ [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a filled five-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} clbk - callback function\n* @param {*} [thisArg] - callback function execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filled5dBy( [ 1, 1, 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ] ]\n*/\nfunction filled5dBy( shape, clbk, thisArg ) {\n\tvar arr;\n\tvar a0;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\tS0 = shape[ 4 ];\n\tS1 = shape[ 3 ];\n\tS2 = shape[ 2 ];\n\tS3 = shape[ 1 ];\n\tS4 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\ta3 = [];\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\ta2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta1 = [];\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\ta0 = [];\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\ta0.push( clbk.call( thisArg, [ i4, i3, i2, i1, i0 ] ) );\n\t\t\t\t\t}\n\t\t\t\t\ta1.push( a0 );\n\t\t\t\t}\n\t\t\t\ta2.push( a1 );\n\t\t\t}\n\t\t\ta3.push( a2 );\n\t\t}\n\t\tarr.push( a3 );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled5dBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled five-dimensional nested array according to a provided callback function.\n*\n* @module @stdlib/array/base/filled5d-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filled5dBy = require( '@stdlib/array/base/filled5d-by' );\n*\n* var out = filled5dBy( [ 1, 1, 1, 1, 3 ], constantFunction( 'beep' ) );\n* // returns [ [ [ [ [ 'beep', 'beep', 'beep' ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar filled = require( './../../../base/filled' );\n\n\n// FUNCTIONS //\n\n/**\n* Recursive fills an array.\n*\n* @private\n* @param {*} value - fill value\n* @param {NonNegativeInteger} ndims - number of dimensions\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {NonNegativeInteger} dim - dimension index\n* @param {Array} out - output array\n* @returns {Array} output array\n*/\nfunction recurse( value, ndims, shape, dim, out ) {\n\tvar S;\n\tvar d;\n\tvar i;\n\n\tS = shape[ dim ];\n\n\t// Check whether we're filling the last dimension:\n\td = dim + 1;\n\tif ( d === ndims ) {\n\t\treturn filled( value, S );\n\t}\n\n\t// Fill nested dimensions...\n\tfor ( i = 0; i < S; i++ ) {\n\t\tout.push( recurse( value, ndims, shape, d, [] ) );\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a filled two-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = fillednd( 0.0, [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = fillednd( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var out = fillednd( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\nfunction fillednd( value, shape ) {\n\treturn recurse( value, shape.length, shape, 0, [] );\n}\n\n\n// EXPORTS //\n\nmodule.exports = fillednd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled n-dimensional nested array.\n*\n* @module @stdlib/array/base/fillednd\n*\n* @example\n* var fillednd = require( '@stdlib/array/base/fillednd' );\n*\n* var out = fillednd( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var fillednd = require( '@stdlib/array/base/fillednd' );\n*\n* var out = fillednd( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Recursive fills an array.\n*\n* @private\n* @param {NonNegativeInteger} ndims - number of dimensions\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {NonNegativeInteger} dim - dimension index\n* @param {NonNegativeIntegerArray} indices - outer array element indices\n* @param {Array} out - output array\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Array} output array\n*/\nfunction recurse( ndims, shape, dim, indices, out, clbk, thisArg ) {\n\tvar idx;\n\tvar FLG;\n\tvar S;\n\tvar d;\n\tvar i;\n\n\t// Check whether we're filling the last dimension:\n\td = dim + 1;\n\tFLG = ( d === ndims );\n\n\tS = shape[ dim ];\n\tfor ( i = 0; i < S; i++ ) {\n\t\tidx = indices.slice(); // we explicitly copy in order to avoid potential mutation when calling `clbk`\n\t\tidx.push( i );\n\t\tif ( FLG ) {\n\t\t\tout.push( clbk.call( thisArg, idx ) );\n\t\t} else {\n\t\t\tout.push( recurse( ndims, shape, d, idx, [], clbk, thisArg ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a filled two-dimensional nested array according to a provided callback function.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Array} filled array\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var out = filledndBy( [ 3, 1 ], constantFunction( 'beep' ) );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\nfunction filledndBy( shape, clbk, thisArg ) {\n\treturn recurse( shape.length, shape, 0, [], [], clbk, thisArg );\n}\n\n\n// EXPORTS //\n\nmodule.exports = filledndBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled n-dimensional nested array according to a callback function.\n*\n* @module @stdlib/array/base/fillednd-by\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n* var filledndBy = require( '@stdlib/array/base/fillednd-by' );\n*\n* var out = filledndBy( [ 3, 1 ], constantFunction( 'beep' ) );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar resolveGetter = require( './../../../base/resolve-getter' );\n\n\n// MAIN //\n\n/**\n* Returns the first element of an array-like object.\n*\n* @param {Collection} arr - input array\n* @returns {*} - first element\n*\n* @example\n* var out = first( [ 1, 2, 3 ] );\n* // returns 1\n*/\nfunction first( arr ) {\n\tvar get;\n\n\tif ( arr.length === 0 ) {\n\t\treturn;\n\t}\n\t// Resolve an accessor for retrieving input array elements:\n\tget = resolveGetter( arr );\n\n\t// Return the first element:\n\treturn get( arr, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = first;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the first element of an array-like object.\n*\n* @module @stdlib/array/base/first\n*\n* @example\n* var first = require( '@stdlib/array/base/first' );\n*\n* var out = first( [ 1, 2, 3 ] );\n* // returns 1\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar shape2strides = require( '@stdlib/ndarray/base/shape2strides' );\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\nvar numel = require( '@stdlib/ndarray/base/numel' );\nvar grev = require( '@stdlib/blas/ext/base/grev' );\nvar zeros = require( './../../../base/zeros' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// FUNCTIONS //\n\n/**\n* Copies a specified number of array elements to a provided array.\n*\n* @private\n* @param {Array} x - input array\n* @param {NonNegativeInteger} N - number of elements to copy\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = [ 0, 0, 0 ];\n* copy( x, 3, out, 1, 0 );\n*\n* var o = out;\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x, N, out, stride, offset ) {\n\tvar i;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tout[ offset ] = x[ i ];\n\t\toffset += stride;\n\t}\n}\n\n/**\n* Recursively flattens an array in lexicographic order.\n*\n* @private\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {NonNegativeInteger} dim - dimension index\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {NonNegativeInteger} offset for next output array element\n*/\nfunction recurseLexicographic( x, ndims, shape, dim, out, stride, offset ) {\n\tvar FLG;\n\tvar S;\n\tvar d;\n\tvar i;\n\n\t// Check whether we've reached the last dimension:\n\td = dim + 1;\n\tFLG = ( d === ndims );\n\n\tS = shape[ dim ];\n\tfor ( i = 0; i < S; i++ ) {\n\t\tif ( FLG ) {\n\t\t\tout[ offset ] = x[ i ];\n\t\t\toffset += stride;\n\t\t} else {\n\t\t\toffset = recurseLexicographic( x[ i ], ndims, shape, d, out, stride, offset ); // eslint-disable-line max-len\n\t\t}\n\t}\n\treturn offset;\n}\n\n/**\n* Flattens an array in colexicographic order.\n*\n* @private\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n*/\nfunction flattenColexicographic( x, ndims, shape, out, stride, offset ) {\n\tvar len;\n\tvar tmp;\n\tvar ord;\n\tvar sh;\n\tvar sx;\n\tvar j;\n\tvar i;\n\n\t// Note that, in contrast to lexicographic iteration, we cannot readily define a straightforward recursive definition for colexicographic iteration. Accordingly, we have to perform a workaround in which we first flatten in lexicographic order and then perform an out-of-place transposition to return an array in colexicographic order.\n\n\t// Determine how many elements will be in the output array:\n\tlen = numel( shape );\n\n\t// For input arrays having an arbitrary number of dimensions, first flatten in lexicographic order:\n\ttmp = zeros( len );\n\trecurseLexicographic( x, ndims, shape, 0, tmp, 1, 0 );\n\n\t// Define the memory layout:\n\tord = 'row-major';\n\n\t// Generate a stride array for lexicographic order:\n\tsx = shape2strides( shape, ord );\n\n\t// Reverse the dimensions and strides (i.e., define the shape and strides of the transpose):\n\tsh = zeros( ndims );\n\tcopy( shape, ndims, sh, 1, 0 );\n\tgrev( ndims, sh, 1 );\n\tgrev( ndims, sx, 1 );\n\n\t// Iterate over each element based on the linear **view** index (note: this has negative performance implications due to lack of data locality)...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = vind2bind( sh, sx, 0, ord, i, MODE );\n\t\tout[ offset ] = tmp[ j ];\n\t\toffset += stride;\n\t}\n}\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], false, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], true, new Float64Array( 4 ), 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten( x, shape, colexicographic, out, stride, offset ) {\n\tvar ndims = shape.length;\n\tif ( ndims === 0 ) { // 0-dimensional array\n\t\treturn out;\n\t}\n\tif ( ndims === 1 ) { // 1-dimensional array\n\t\t// For 1-dimensional arrays, we can perform a simple copy:\n\t\tcopy( x, shape[ 0 ], out, stride, offset );\n\t\treturn out;\n\t}\n\tif ( colexicographic ) {\n\t\tflattenColexicographic( x, ndims, shape, out, stride, offset );\n\t\treturn out;\n\t}\n\trecurseLexicographic( x, ndims, shape, 0, out, stride, offset );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numel = require( '@stdlib/ndarray/base/numel' );\nvar zeros = require( './../../../base/zeros' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @returns {Array} flattened array\n*\n* @example\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten( x, shape, colexicographic ) {\n\tvar out = zeros( numel( shape ) );\n\treturn assign( x, shape, colexicographic, out, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Flatten an n-dimensional nested array.\n*\n* @module @stdlib/array/base/flatten\n*\n* @example\n* var flatten = require( '@stdlib/array/base/flatten' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var flatten = require( '@stdlib/array/base/flatten' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flatten = require( '@stdlib/array/base/flatten' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten.assign( x, [ 2, 2 ], true, out, 1, 0 );\n* // returns [ 1, 3, 2, 4 ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar shape2strides = require( '@stdlib/ndarray/base/shape2strides' );\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\nvar numel = require( '@stdlib/ndarray/base/numel' );\nvar grev = require( '@stdlib/blas/ext/base/grev' );\nvar zeros = require( './../../../base/zeros' );\nvar copy = require( './../../../base/copy-indexed' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// FUNCTIONS //\n\n/**\n* Copies a specified number of array elements to a provided array according to a callback function.\n*\n* @private\n* @param {Array} x - input array\n* @param {NonNegativeInteger} N - number of elements to copy\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = [ 0, 0, 0 ];\n* copyBy( x, 3, out, 1, 0, scale );\n*\n* var o = out;\n* // returns [ 2, 4, 6 ]\n*/\nfunction copyBy( x, N, out, stride, offset, clbk, thisArg ) {\n\tvar i;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tout[ offset ] = clbk.call( thisArg, x[ i ], [ i ], x );\n\t\toffset += stride;\n\t}\n}\n\n/**\n* Recursively flattens an array in lexicographic order.\n*\n* @private\n* @param {Array} orig - original input array\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {NonNegativeInteger} dim - dimension index\n* @param {NonNegativeIntegerArray} indices - outer array element indices\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {NonNegativeInteger} offset for next output array element\n*/\nfunction recurseLexicographic( orig, x, ndims, shape, dim, indices, out, stride, offset, clbk, thisArg ) { // eslint-disable-line max-params\n\tvar FLG;\n\tvar idx;\n\tvar S;\n\tvar d;\n\tvar i;\n\n\t// Check whether we've reached the last dimension:\n\td = dim + 1;\n\tFLG = ( d === ndims );\n\n\tS = shape[ dim ];\n\tfor ( i = 0; i < S; i++ ) {\n\t\tidx = indices.slice(); // we explicitly copy in order to avoid potential mutation when calling `clbk`\n\t\tidx.push( i );\n\t\tif ( FLG ) {\n\t\t\tout[ offset ] = clbk.call( thisArg, x[ i ], idx, orig );\n\t\t\toffset += stride;\n\t\t} else {\n\t\t\toffset = recurseLexicographic( orig, x[ i ], ndims, shape, d, idx, out, stride, offset, clbk, thisArg );\n\t\t}\n\t}\n\treturn offset;\n}\n\n/**\n* Flattens an array in colexicographic order.\n*\n* @private\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n*/\nfunction flattenColexicographic( x, ndims, shape, out, stride, offset, clbk, thisArg ) {\n\tvar len;\n\tvar tmp;\n\tvar ord;\n\tvar sh;\n\tvar sx;\n\tvar j;\n\tvar i;\n\n\t// Note that, in contrast to lexicographic iteration, we cannot readily define a straightforward recursive definition for colexicographic iteration. Accordingly, we have to perform a workaround in which we first flatten in lexicographic order and then perform an out-of-place transposition to return an array in colexicographic order.\n\n\t// Determine how many elements will be in the output array:\n\tlen = numel( shape );\n\n\t// For input arrays having an arbitrary number of dimensions, first flatten in lexicographic order:\n\ttmp = zeros( len );\n\trecurseLexicographic( x, x, ndims, shape, 0, [], tmp, 1, 0, clbk, thisArg );\n\n\t// Define the memory layout:\n\tord = 'row-major';\n\n\t// Generate a stride array for lexicographic order:\n\tsx = shape2strides( shape, ord );\n\n\t// Reverse the dimensions and strides (i.e., define the shape and strides of the transpose):\n\tsh = copy( shape );\n\tgrev( ndims, sh, 1 );\n\tgrev( ndims, sx, 1 );\n\n\t// Iterate over each element based on the linear **view** index (note: this has negative performance implications due to lack of data locality)...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = vind2bind( sh, sx, 0, ord, i, MODE );\n\t\tout[ offset ] = tmp[ j ];\n\t\toffset += stride;\n\t}\n}\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array according to a callback function and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], false, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], true, new Float64Array( 4 ), 1, 0, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flattenBy( x, shape, colexicographic, out, stride, offset, clbk, thisArg ) {\n\tvar ndims = shape.length;\n\tif ( ndims === 0 ) { // 0-dimensional array\n\t\treturn out;\n\t}\n\tif ( ndims === 1 ) { // 1-dimensional array\n\t\t// For 1-dimensional arrays, we can perform simple iteration:\n\t\tcopyBy( x, shape[ 0 ], out, stride, offset, clbk, thisArg );\n\t\treturn out;\n\t}\n\tif ( colexicographic ) {\n\t\tflattenColexicographic( x, ndims, shape, out, stride, offset, clbk, thisArg );\n\t\treturn out;\n\t}\n\trecurseLexicographic( x, x, ndims, shape, 0, [], out, stride, offset, clbk, thisArg );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flattenBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numel = require( '@stdlib/ndarray/base/numel' );\nvar zeros = require( './../../../base/zeros' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array according to a callback function.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Array} flattened array\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*/\nfunction flattenBy( x, shape, colexicographic, clbk, thisArg ) {\n\tvar out = zeros( numel( shape ) );\n\treturn assign( x, shape, colexicographic, out, 1, 0, clbk, thisArg );\n}\n\n\n// EXPORTS //\n\nmodule.exports = flattenBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Flatten an n-dimensional nested array according to a callback function.\n*\n* @module @stdlib/array/base/flatten-by\n*\n* @example\n* var flattenBy = require( '@stdlib/array/base/flatten-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], false, scale );\n* // returns [ 2, 4, 6, 8 ]\n*\n* @example\n* var flattenBy = require( '@stdlib/array/base/flatten-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flattenBy( x, [ 2, 2 ], true, scale );\n* // returns [ 2, 6, 4, 8 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var flattenBy = require( '@stdlib/array/base/flatten-by' );\n*\n* function scale( v ) {\n* return v * 2;\n* }\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flattenBy.assign( x, [ 2, 2 ], true, out, 1, 0, scale );\n* // returns