diff --git a/README.md b/README.md
index e2c3f6f..b913914 100644
--- a/README.md
+++ b/README.md
@@ -1957,6 +1957,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/benchmark/benchmark.with.js b/benchmark/benchmark.with.js
new file mode 100644
index 0000000..4d955d8
--- /dev/null
+++ b/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-harness' );
+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/benchmark/benchmark.with.length.js b/benchmark/benchmark.with.length.js
new file mode 100644
index 0000000..cd44347
--- /dev/null
+++ b/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-harness' );
+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/dist/index.js b/dist/index.js
index 7ea12bc..58fcdb2 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,4 +1,4 @@
-"use strict";var L=function(a,e){return function(){return e||a((e={exports:{}}).exports,e),e.exports}};var C=L(function(_r,S){"use strict";var K=require("@stdlib/assert-is-array-like-object"),Q=require("@stdlib/assert-is-complex-like"),U=require("@stdlib/complex-realf"),X=require("@stdlib/complex-imagf"),Z=require("@stdlib/string-format");function $(a){var e,r,t;for(e=[];r=a.next(),!r.done;)if(t=r.value,K(t)&&t.length>=2)e.push(t[0],t[1]);else if(Q(t))e.push(U(t),X(t));else return new TypeError(Z("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",t));return e}S.exports=$});var B=L(function(dr,F){"use strict";var I=require("@stdlib/assert-is-array-like-object"),rr=require("@stdlib/assert-is-complex-like"),er=require("@stdlib/complex-realf"),tr=require("@stdlib/complex-imagf"),ir=require("@stdlib/string-format");function nr(a,e,r){var t,i,n,o;for(t=[],o=-1;i=a.next(),!i.done;)if(o+=1,n=e.call(r,i.value,o),I(n)&&n.length>=2)t.push(n[0],n[1]);else if(rr(n))t.push(er(n),tr(n));else return new TypeError(ir("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return t}F.exports=nr});var N=L(function(xr,M){"use strict";var ar=require("@stdlib/assert-is-complex-like"),or=require("@stdlib/complex-realf"),ur=require("@stdlib/complex-imagf");function sr(a,e){var r,t,i,n;for(r=e.length,n=0,i=0;ir.byteLength-a)throw new RangeError(s("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",t*w));r=new T(r,a,t*2)}}return h(this,"_buffer",r),h(this,"_length",r.length/2),this}h(l,"BYTES_PER_ELEMENT",w);h(l,"name","Complex64Array");h(l,"from",function(e){var r,t,i,n,o,u,c,f,y,g,m,E;if(!p(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(t=arguments.length,t>1){if(i=arguments[1],!p(i))throw new TypeError(s("invalid argument. Second argument must be a function. Value: `%s`.",i));t>2&&(r=arguments[2])}if(v(e)){if(f=e.length,i){for(n=new this(f),o=n._buffer,E=0,m=0;m=2)o[E]=g[0],o[E+1]=g[1];else throw new TypeError(s("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",g));E+=2}return n}return new this(e)}if(R(e)){if(i){for(f=e.length,e.get&&e.set?c=yr("default"):c=vr("default"),m=0;m=2)o[E]=g[0],o[E+1]=g[1];else throw new TypeError(s("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",g));E+=2}return n}return new this(e)}if(P(e)&&G&&p(e[q])){if(o=e[q](),!p(o.next))throw new TypeError(s("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(i?u=pr(o,i,r):u=W(o),u instanceof Error)throw u;for(f=u.length/2,n=new this(f),o=n._buffer,m=0;m=this._length))return b(this._buffer,e)});j(l.prototype,"buffer",function(){return this._buffer.buffer});j(l.prototype,"byteLength",function(){return this._buffer.byteLength});j(l.prototype,"byteOffset",function(){return this._buffer.byteOffset});h(l.prototype,"BYTES_PER_ELEMENT",l.BYTES_PER_ELEMENT);h(l.prototype,"copyWithin",function(e,r){if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,r*2):this._buffer.copyWithin(e*2,r*2,arguments[2]*2),this});h(l.prototype,"entries",function(){var e,r,t,i,n,o,u;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._buffer,i=this._length,o=-1,u=-2,t={},h(t,"next",c),h(t,"return",f),q&&h(t,q,y),t;function c(){var g;return o+=1,n||o>=i?{done:!0}:(u+=2,g=new Y(e[u],e[u+1]),{value:[o,g],done:!1})}function f(g){return n=!0,arguments.length?{value:g,done:!0}:{done:!0}}function y(){return r.entries()}});h(l.prototype,"every",function(e,r){var t,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!p(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=0;i1){if(!d(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=n,r<0&&(r=0)),arguments.length>2){if(!d(t))throw new TypeError(s("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=n,t<0&&(t=0)),t>n&&(t=n)}else t=n}else r=0,t=n;for(u=x(e),c=V(e),f=r;f=0;i--)if(n=b(t,i),e.call(r,n,i,this))return n});h(l.prototype,"findLastIndex",function(e,r){var t,i,n;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!p(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=b(t,i),e.call(r,n,i,this))return i;return-1});h(l.prototype,"forEach",function(e,r){var t,i,n;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!p(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=0;i=this._length))return b(this._buffer,e)});h(l.prototype,"includes",function(e,r){var t,i,n,o,u;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_(e))throw new TypeError(s("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!d(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length,r<0&&(r=0))}else r=0;for(n=x(e),o=V(e),t=this._buffer,u=r;u1){if(!d(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length,r<0&&(r=0))}else r=0;for(n=x(e),o=V(e),t=this._buffer,u=r;u1){if(!d(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(n=x(e),o=V(e),t=this._buffer,u=r;u>=0;u--)if(i=2*u,n===t[i]&&o===t[i+1])return u;return-1});j(l.prototype,"length",function(){return this._length});h(l.prototype,"map",function(e,r){var t,i,n,o,u;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!p(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,n=new this.constructor(this._length),t=n._buffer,o=0;o1){if(t=arguments[1],!A(t))throw new TypeError(s("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(_(e)){if(t>=this._length)throw new RangeError(s("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));t*=2,i[t]=x(e),i[t+1]=V(e);return}if(v(e)){if(u=e._length,t+u>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,y=i.byteOffset+t*w,r.buffer===i.buffer&&r.byteOffsety){for(n=new T(r.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e,y=i.byteOffset+t*w,r.buffer===i.buffer&&r.byteOffsety){for(n=new T(u),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fn&&(r=n)}}return e>=n?(n=0,t=i.byteLength):e>=r?(n=0,t=i.byteOffset+e*w):(n=r-e,t=i.byteOffset+e*w),new this.constructor(i.buffer,t,n<0?0:n)});h(l.prototype,"toString",function(){var e,r,t;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t=2)e.push(t[0],t[1]);else if(Q(t))e.push(U(t),X(t));else return new TypeError(Z("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",t));return e}S.exports=$});var B=L(function(dr,C){"use strict";var I=require("@stdlib/assert-is-array-like-object"),rr=require("@stdlib/assert-is-complex-like"),er=require("@stdlib/complex-realf"),tr=require("@stdlib/complex-imagf"),ir=require("@stdlib/string-format");function nr(a,e,r){var t,i,n,o;for(t=[],o=-1;i=a.next(),!i.done;)if(o+=1,n=e.call(r,i.value,o),I(n)&&n.length>=2)t.push(n[0],n[1]);else if(rr(n))t.push(er(n),tr(n));else return new TypeError(ir("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return t}C.exports=nr});var N=L(function(Vr,M){"use strict";var ar=require("@stdlib/assert-is-complex-like"),or=require("@stdlib/complex-realf"),ur=require("@stdlib/complex-imagf");function sr(a,e){var r,t,i,n;for(r=e.length,n=0,i=0;ir.byteLength-a)throw new RangeError(s("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",t*w));r=new T(r,a,t*2)}}return h(this,"_buffer",r),h(this,"_length",r.length/2),this}h(l,"BYTES_PER_ELEMENT",w);h(l,"name","Complex64Array");h(l,"from",function(e){var r,t,i,n,o,u,c,f,y,v,m,E;if(!p(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(t=arguments.length,t>1){if(i=arguments[1],!p(i))throw new TypeError(s("invalid argument. Second argument must be a function. Value: `%s`.",i));t>2&&(r=arguments[2])}if(g(e)){if(f=e.length,i){for(n=new this(f),o=n._buffer,E=0,m=0;m=2)o[E]=v[0],o[E+1]=v[1];else throw new TypeError(s("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",v));E+=2}return n}return new this(e)}if(O(e)){if(i){for(f=e.length,e.get&&e.set?c=yr("default"):c=vr("default"),m=0;m=2)o[E]=v[0],o[E+1]=v[1];else throw new TypeError(s("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",v));E+=2}return n}return new this(e)}if(P(e)&&G&&p(e[q])){if(o=e[q](),!p(o.next))throw new TypeError(s("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(i?u=pr(o,i,r):u=W(o),u instanceof Error)throw u;for(f=u.length/2,n=new this(f),o=n._buffer,m=0;m=this._length))return b(this._buffer,e)});j(l.prototype,"buffer",function(){return this._buffer.buffer});j(l.prototype,"byteLength",function(){return this._buffer.byteLength});j(l.prototype,"byteOffset",function(){return this._buffer.byteOffset});h(l.prototype,"BYTES_PER_ELEMENT",l.BYTES_PER_ELEMENT);h(l.prototype,"copyWithin",function(e,r){if(!g(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,r*2):this._buffer.copyWithin(e*2,r*2,arguments[2]*2),this});h(l.prototype,"entries",function(){var e,r,t,i,n,o,u;if(!g(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._buffer,i=this._length,o=-1,u=-2,t={},h(t,"next",c),h(t,"return",f),q&&h(t,q,y),t;function c(){var v;return o+=1,n||o>=i?{done:!0}:(u+=2,v=new Y(e[u],e[u+1]),{value:[o,v],done:!1})}function f(v){return n=!0,arguments.length?{value:v,done:!0}:{done:!0}}function y(){return r.entries()}});h(l.prototype,"every",function(e,r){var t,i;if(!g(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!p(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=0;i1){if(!d(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=n,r<0&&(r=0)),arguments.length>2){if(!d(t))throw new TypeError(s("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=n,t<0&&(t=0)),t>n&&(t=n)}else t=n}else r=0,t=n;for(u=V(e),c=x(e),f=r;f=0;i--)if(n=b(t,i),e.call(r,n,i,this))return n});h(l.prototype,"findLastIndex",function(e,r){var t,i,n;if(!g(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!p(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=b(t,i),e.call(r,n,i,this))return i;return-1});h(l.prototype,"forEach",function(e,r){var t,i,n;if(!g(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!p(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=0;i=this._length))return b(this._buffer,e)});h(l.prototype,"includes",function(e,r){var t,i,n,o,u;if(!g(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_(e))throw new TypeError(s("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!d(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length,r<0&&(r=0))}else r=0;for(n=V(e),o=x(e),t=this._buffer,u=r;u1){if(!d(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length,r<0&&(r=0))}else r=0;for(n=V(e),o=x(e),t=this._buffer,u=r;u1){if(!d(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(n=V(e),o=x(e),t=this._buffer,u=r;u>=0;u--)if(i=2*u,n===t[i]&&o===t[i+1])return u;return-1});j(l.prototype,"length",function(){return this._length});h(l.prototype,"map",function(e,r){var t,i,n,o,u;if(!g(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!p(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,n=new this.constructor(this._length),t=n._buffer,o=0;o1){if(t=arguments[1],!A(t))throw new TypeError(s("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(_(e)){if(t>=this._length)throw new RangeError(s("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));t*=2,i[t]=V(e),i[t+1]=x(e);return}if(g(e)){if(u=e._length,t+u>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,y=i.byteOffset+t*w,r.buffer===i.buffer&&r.byteOffsety){for(n=new T(r.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e,y=i.byteOffset+t*w,r.buffer===i.buffer&&r.byteOffsety){for(n=new T(u),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fn&&(r=n)}}return e>=n?(n=0,t=i.byteLength):e>=r?(n=0,t=i.byteOffset+e*w):(n=r-e,t=i.byteOffset+e*w),new this.constructor(i.buffer,t,n<0?0:n)});h(l.prototype,"toString",function(){var e,r,t;if(!g(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t=n)throw new RangeError(s("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!_(r))throw new TypeError(s("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return i=new this.constructor(this._buffer),t=i._buffer,t[2*e]=V(r),t[2*e+1]=x(r),i});D.exports=l});var Er=J();module.exports=Er;
/**
* @license Apache-2.0
*
diff --git a/dist/index.js.map b/dist/index.js.map
index b11fbcb..6df8ea9 100644
--- a/dist/index.js.map
+++ b/dist/index.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
"sources": ["../lib/from_iterator.js", "../lib/from_iterator_map.js", "../lib/from_array.js", "../lib/main.js", "../lib/index.js"],
- "sourcesContent": ["/**\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( '@stdlib/array-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( '@stdlib/array-base-getter' );\nvar accessorGetter = require( '@stdlib/array-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"],
- "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,EAAoB,QAAS,qCAAsC,EACnEC,EAA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,CACN,GAAK,CAAC9B,EAAWiD,CAAI,EACpB,MAAM,IAAI,UAAW1C,EAAQ,qEAAsE0C,CAAI,CAAE,EAErGA,EAAM,GACVA,GAAOnB,EACFmB,EAAM,IACVA,EAAM,IAEIA,EAAMnB,IACjBmB,EAAMnB,EAER,CACD,CACA,OAAKiC,GAASjC,GACbA,EAAM,EACNkC,EAAStC,EAAI,YACFqC,GAASd,GACpBnB,EAAM,EACNkC,EAAStC,EAAI,WAAcqC,EAAM9C,IAEjCa,EAAMmB,EAAMc,EACZC,EAAStC,EAAI,WAAeqC,EAAM9C,GAE5B,IAAI,KAAK,YAAaS,EAAI,OAAQsC,EAAUlC,EAAM,EAAM,EAAIA,CAAI,CACxE,CAAC,EAoBD3B,EAAakB,EAAe,UAAW,WAAY,UAAoB,CACtE,IAAIa,EACAR,EACAa,EACJ,GAAK,CAACpB,EAAgB,IAAK,EAC1B,MAAM,IAAI,UAAW,2DAA4D,EAIlF,IAFAe,EAAM,CAAC,EACPR,EAAM,KAAK,QACLa,EAAI,EAAGA,EAAI,KAAK,QAASA,IAC9BL,EAAI,KAAMT,EAAcC,EAAKa,CAAE,EAAE,SAAS,CAAE,EAE7C,OAAOL,EAAI,KAAM,GAAI,CACtB,CAAC,EAKD7C,EAAO,QAAUgC,ICx/DjB,IAAI4C,GAAO,IAKX,OAAO,QAAUA",
- "names": ["require_from_iterator", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isComplexLike", "realf", "imagf", "format", "fromIterator", "it", "out", "v", "z", "require_from_iterator_map", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isComplexLike", "realf", "imagf", "format", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "z", "i", "require_from_array", "__commonJSMin", "exports", "module", "isComplexLike", "realf", "imagf", "fromArray", "buf", "arr", "len", "v", "j", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isArrayLikeObject", "isCollection", "isArrayBuffer", "isObject", "isArray", "isString", "isFunction", "isComplexLike", "isEven", "isInteger", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "setReadOnlyAccessor", "Float32Array", "Complex64", "format", "realf", "imagf", "reinterpret64", "reinterpret128", "getter", "accessorGetter", "fromIterator", "fromIteratorMap", "fromArray", "BYTES_PER_ELEMENT", "HAS_ITERATOR_SYMBOL", "isComplexArray", "value", "Complex64Array", "isComplexArrayConstructor", "isComplex64Array", "isComplex128Array", "getComplex64", "buf", "idx", "byteOffset", "nargs", "len", "src", "thisArg", "clbk", "out", "tmp", "get", "flg", "v", "i", "j", "args", "target", "start", "buffer", "self", "iter", "FLG", "next", "end", "factory", "z", "predicate", "re", "im", "fcn", "searchElement", "fromIndex", "separator", "sep", "outbuf", "sbuf", "N", "begin", "offset", "main"]
+ "sourcesContent": ["/**\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( '@stdlib/array-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( '@stdlib/array-base-getter' );\nvar accessorGetter = require( '@stdlib/array-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* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex64Array} new typed array\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* 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.with( 0, new Complex64( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 4.0\n*\n* var im = imagf( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex64Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = realf( value );\n\tbuf[ (2*index)+1 ] = imagf( value );\n\treturn out;\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"],
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,EAAoB,QAAS,qCAAsC,EACnEC,EAAgB,QAAS,gCAAiC,EAC1DC,EAAQ,QAAS,uBAAwB,EACzCC,EAAQ,QAAS,uBAAwB,EACzCC,EAAS,QAAS,uBAAwB,EAY9C,SAASC,EAAcC,EAAK,CAC3B,IAAIC,EACAC,EACAC,EAGJ,IADAF,EAAM,CAAC,EAENC,EAAIF,EAAG,KAAK,EACP,CAAAE,EAAE,MAIP,GADAC,EAAID,EAAE,MACDR,EAAmBS,CAAE,GAAKA,EAAE,QAAU,EAC1CF,EAAI,KAAME,EAAG,CAAE,EAAGA,EAAG,CAAE,CAAE,UACdR,EAAeQ,CAAE,EAC5BF,EAAI,KAAML,EAAOO,CAAE,EAAGN,EAAOM,CAAE,CAAE,MAEjC,QAAO,IAAI,UAAWL,EAAQ,kJAAmJK,CAAE,CAAE,EAGvL,OAAOF,CACR,CAKAR,EAAO,QAAUM,IChEjB,IAAAK,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,EAAoB,QAAS,qCAAsC,EACnEC,GAAgB,QAAS,gCAAiC,EAC1DC,GAAQ,QAAS,uBAAwB,EACzCC,GAAQ,QAAS,uBAAwB,EACzCC,GAAS,QAAS,uBAAwB,EAc9C,SAASC,GAAiBC,EAAIC,EAAMC,EAAU,CAC7C,IAAIC,EACAC,EACAC,EACAC,EAIJ,IAFAH,EAAM,C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Q,CAChF,IAAIM,EACAQ,EACAJ,EACJ,GAAK,CAACX,EAAgB,IAAK,EAC1B,MAAM,IAAI,UAAW,2DAA4D,EAElF,GAAK,CAACnB,EAAWiE,CAAM,EACtB,MAAM,IAAI,UAAW1D,EAAQ,oEAAqE0D,CAAM,CAAE,EAM3G,GAJAnC,EAAM,KAAK,QACNmC,EAAQ,IACZA,GAASnC,GAELmC,EAAQ,GAAKA,GAASnC,EAC1B,MAAM,IAAI,WAAYvB,EAAQ,kEAAmE0D,CAAM,CAAE,EAE1G,GAAK,CAACnE,EAAesB,CAAM,EAC1B,MAAM,IAAI,UAAWb,EAAQ,2EAA4Ea,CAAM,CAAE,EAElH,OAAAc,EAAM,IAAI,KAAK,YAAa,KAAK,OAAQ,EACzCR,EAAMQ,EAAI,QACVR,EAAK,EAAEuC,CAAM,EAAIzD,EAAOY,CAAM,EAC9BM,EAAM,EAAEuC,EAAO,CAAE,EAAIxD,EAAOW,CAAM,EAC3Bc,CACR,CAAC,EAKD7C,EAAO,QAAUgC,ICxjEjB,IAAI6C,GAAO,IAKX,OAAO,QAAUA",
+ "names": ["require_from_iterator", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isComplexLike", "realf", "imagf", "format", "fromIterator", "it", "out", "v", "z", "require_from_iterator_map", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isComplexLike", "realf", "imagf", "format", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "z", "i", "require_from_array", "__commonJSMin", "exports", "module", "isComplexLike", "realf", "imagf", "fromArray", "buf", "arr", "len", "v", "j", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isArrayLikeObject", "isCollection", "isArrayBuffer", "isObject", "isArray", "isString", "isFunction", "isComplexLike", "isEven", "isInteger", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "setReadOnlyAccessor", "Float32Array", "Complex64", "format", "realf", "imagf", "reinterpret64", "reinterpret128", "getter", "accessorGetter", "fromIterator", "fromIteratorMap", "fromArray", "BYTES_PER_ELEMENT", "HAS_ITERATOR_SYMBOL", "isComplexArray", "value", "Complex64Array", "isComplexArrayConstructor", "isComplex64Array", "isComplex128Array", "getComplex64", "buf", "idx", "byteOffset", "nargs", "len", "src", "thisArg", "clbk", "out", "tmp", "get", "flg", "i", "j", "args", "target", "start", "buffer", "self", "iter", "FLG", "next", "end", "factory", "z", "predicate", "re", "im", "fcn", "searchElement", "fromIndex", "separator", "sep", "outbuf", "v", "sbuf", "N", "begin", "offset", "index", "main"]
}
diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts
index 39b302f..07e407e 100644
--- a/docs/types/index.d.ts
+++ b/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/lib/main.js b/lib/main.js
index 0ec972c..96c79a4 100644
--- a/lib/main.js
+++ b/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/test/test.with.js b/test/test.with.js
new file mode 100644
index 0000000..84e72ff
--- /dev/null
+++ b/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( '@stdlib/array-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();
+});