@stdlib/array-complex64 0.0.5 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import ctor from '../docs/types/index';
3
+ export = ctor;
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";var q=function(n,t){return function(){return t||n((t={exports:{}}).exports,t),t.exports}};var C=q(function(Er,B){"use strict";var D=require("@stdlib/assert-is-array-like-object"),J=require("@stdlib/assert-is-complex-like"),K=require("@stdlib/complex-realf"),Q=require("@stdlib/complex-imagf"),U=require("@stdlib/string-format");function X(n){var t,r,e;for(t=[];r=n.next(),!r.done;)if(e=r.value,D(e)&&e.length>=2)t.push(e[0],e[1]);else if(J(e))t.push(K(e),Q(e));else return new TypeError(U("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",e));return t}B.exports=X});var O=q(function(dr,V){"use strict";var Z=require("@stdlib/assert-is-array-like-object"),$=require("@stdlib/assert-is-complex-like"),rr=require("@stdlib/complex-realf"),er=require("@stdlib/complex-imagf"),tr=require("@stdlib/string-format");function nr(n,t,r){var e,o,i,u;for(e=[],u=-1;o=n.next(),!o.done;)if(u+=1,i=t.call(r,o.value,u),Z(i)&&i.length>=2)e.push(i[0],i[1]);else if($(i))e.push(rr(i),er(i));else return new TypeError(tr("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));return e}V.exports=nr});var S=q(function(Tr,M){"use strict";var ar=require("@stdlib/assert-is-complex-like"),ir=require("@stdlib/complex-realf"),or=require("@stdlib/complex-imagf");function ur(n,t){var r,e,o,i;for(r=t.length,i=0,o=0;o<r;o++){if(e=t[o],!ar(e))return null;n[i]=ir(e),n[i+1]=or(e),i+=2}return n}M.exports=ur});var H=q(function(_r,G){"use strict";var _=require("@stdlib/assert-is-nonnegative-integer").isPrimitive,I=require("@stdlib/assert-is-array-like-object"),j=require("@stdlib/assert-is-collection"),N=require("@stdlib/assert-is-arraybuffer"),Y=require("@stdlib/assert-is-object"),fr=require("@stdlib/assert-is-array"),b=require("@stdlib/assert-is-function"),E=require("@stdlib/assert-is-complex-like"),x=require("@stdlib/math-base-assert-is-even"),R=require("@stdlib/math-base-assert-is-integer"),sr=require("@stdlib/assert-has-iterator-symbol-support"),d=require("@stdlib/symbol-iterator"),v=require("@stdlib/utils-define-nonenumerable-read-only-property"),k=require("@stdlib/utils-define-nonenumerable-read-only-accessor"),c=require("@stdlib/array-float32"),F=require("@stdlib/complex-float32"),l=require("@stdlib/string-format"),A=require("@stdlib/complex-realf"),L=require("@stdlib/complex-imagf"),lr=require("@stdlib/strided-base-reinterpret-complex64"),mr=require("@stdlib/strided-base-reinterpret-complex128"),gr=require("@stdlib/array-base-getter"),hr=require("@stdlib/array-base-accessor-getter"),P=C(),vr=O(),yr=S(),y=c.BYTES_PER_ELEMENT*2,W=sr();function T(n){return n instanceof g||typeof n=="object"&&n!==null&&(n.constructor.name==="Complex64Array"||n.constructor.name==="Complex128Array")&&typeof n._length=="number"&&typeof n._buffer=="object"}function z(n){return n===g||n.name==="Complex128Array"}function pr(n){return typeof n=="object"&&n!==null&&n.constructor.name==="Complex64Array"&&n.BYTES_PER_ELEMENT===y}function cr(n){return typeof n=="object"&&n!==null&&n.constructor.name==="Complex128Array"&&n.BYTES_PER_ELEMENT===y*2}function g(){var n,t,r,e;if(t=arguments.length,!(this instanceof g))return t===0?new g:t===1?new g(arguments[0]):t===2?new g(arguments[0],arguments[1]):new g(arguments[0],arguments[1],arguments[2]);if(t===0)r=new c(0);else if(t===1)if(_(arguments[0]))r=new c(arguments[0]*2);else if(j(arguments[0]))if(r=arguments[0],e=r.length,e&&fr(r)&&E(r[0])){if(r=yr(new c(e*2),r),r===null){if(!x(e))throw new RangeError(l("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",e));r=new c(arguments[0])}}else{if(pr(r))r=lr(r,0);else if(cr(r))r=mr(r,0);else if(!x(e))throw new RangeError(l("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",e));r=new c(r)}else if(N(arguments[0])){if(r=arguments[0],!R(r.byteLength/y))throw new RangeError(l("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",y,r.byteLength));r=new c(r)}else if(Y(arguments[0])){if(r=arguments[0],W===!1)throw new TypeError(l("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",r));if(!b(r[d]))throw new TypeError(l("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=r[d](),!b(r.next))throw new TypeError(l("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=P(r),r instanceof Error)throw r;r=new c(r)}else throw new TypeError(l("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));else{if(r=arguments[0],!N(r))throw new TypeError(l("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",r));if(n=arguments[1],!_(n))throw new TypeError(l("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",n));if(!R(n/y))throw new RangeError(l("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",y,n));if(t===2){if(e=r.byteLength-n,!R(e/y))throw new RangeError(l("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",y,e));r=new c(r,n)}else{if(e=arguments[2],!_(e))throw new TypeError(l("invalid argument. Length must be a nonnegative integer. Value: `%s`.",e));if(e*y>r.byteLength-n)throw new RangeError(l("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",e*y));r=new c(r,n,e*2)}}return v(this,"_buffer",r),v(this,"_length",r.length/2),this}v(g,"BYTES_PER_ELEMENT",y);v(g,"name","Complex64Array");v(g,"from",function(t){var r,e,o,i,u,f,w,a,h,m,s,p;if(!b(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(e=arguments.length,e>1){if(o=arguments[1],!b(o))throw new TypeError(l("invalid argument. Second argument must be a function. Value: `%s`.",o));e>2&&(r=arguments[2])}if(T(t)){if(a=t.length,o){for(i=new this(a),u=i._buffer,p=0,s=0;s<a;s++){if(m=o.call(r,t.get(s),s),E(m))u[p]=A(m),u[p+1]=L(m);else if(I(m)&&m.length>=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(l("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return i}return new this(t)}if(j(t)){if(o){for(a=t.length,t.get&&t.set?w=hr("default"):w=gr("default"),s=0;s<a;s++)if(!E(w(t,s))){h=!0;break}if(h){if(!x(a))throw new RangeError(l("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,a));for(i=new this(a/2),u=i._buffer,s=0;s<a;s++)u[s]=o.call(r,w(t,s),s);return i}for(i=new this(a),u=i._buffer,p=0,s=0;s<a;s++){if(m=o.call(r,w(t,s),s),E(m))u[p]=A(m),u[p+1]=L(m);else if(I(m)&&m.length>=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(l("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return i}return new this(t)}if(Y(t)&&W&&b(t[d])){if(u=t[d](),!b(u.next))throw new TypeError(l("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(o?f=vr(u,o,r):f=P(u),f instanceof Error)throw f;for(a=f.length/2,i=new this(a),u=i._buffer,s=0;s<a;s++)u[s]=f[s];return i}throw new TypeError(l("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))});v(g,"of",function(){var t,r;if(!b(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);return new this(t)});k(g.prototype,"buffer",function(){return this._buffer.buffer});k(g.prototype,"byteLength",function(){return this._buffer.byteLength});k(g.prototype,"byteOffset",function(){return this._buffer.byteOffset});v(g.prototype,"BYTES_PER_ELEMENT",g.BYTES_PER_ELEMENT);v(g.prototype,"copyWithin",function(t,r){if(!T(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(t*2,r*2):this._buffer.copyWithin(t*2,r*2,arguments[2]*2),this});v(g.prototype,"entries",function(){var t,r,e,o,i,u,f;if(!T(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._buffer,o=this._length,u=-1,f=-2,e={},v(e,"next",w),v(e,"return",a),d&&v(e,d,h),e;function w(){var m;return u+=1,i||u>=o?{done:!0}:(f+=2,m=new F(t[f],t[f+1]),{value:[u,m],done:!1})}function a(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function h(){return r.entries()}});v(g.prototype,"get",function(t){var r;if(!T(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_(t))throw new TypeError(l("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return r=this._buffer,t*=2,new F(r[t],r[t+1])});k(g.prototype,"length",function(){return this._length});v(g.prototype,"set",function(t){var r,e,o,i,u,f,w,a,h;if(!T(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(o=this._buffer,arguments.length>1){if(e=arguments[1],!_(e))throw new TypeError(l("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(E(t)){if(e>=this._length)throw new RangeError(l("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));e*=2,o[e]=A(t),o[e+1]=L(t);return}if(T(t)){if(f=t._length,e+f>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,h=o.byteOffset+e*y,r.buffer===o.buffer&&r.byteOffset<h&&r.byteOffset+r.byteLength>h){for(i=new c(r.length),a=0;a<r.length;a++)i[a]=r[a];r=i}for(e*=2,h=0,a=0;a<f;a++)o[e]=r[h],o[e+1]=r[h+1],e+=2,h+=2;return}if(j(t)){for(f=t.length,a=0;a<f;a++)if(!E(t[a])){u=!0;break}if(u){if(!x(f))throw new RangeError(l("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",f));if(e+f/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,h=o.byteOffset+e*y,r.buffer===o.buffer&&r.byteOffset<h&&r.byteOffset+r.byteLength>h){for(i=new c(f),a=0;a<f;a++)i[a]=r[a];r=i}for(e*=2,f/=2,h=0,a=0;a<f;a++)o[e]=r[h],o[e+1]=r[h+1],e+=2,h+=2;return}if(e+f>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,a=0;a<f;a++)w=t[a],o[e]=A(w),o[e+1]=L(w),e+=2;return}throw new TypeError(l("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",t))});G.exports=g});var wr=H();module.exports=wr;
2
+ /**
3
+ * @license Apache-2.0
4
+ *
5
+ * Copyright (c) 2018 The Stdlib Authors.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/from_iterator.js", "../lib/from_iterator_map.js", "../lib/from_array.js", "../lib/main.js", "../lib/index.js"],
4
+ "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 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 ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*/\nfunction isComplex128Array( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT*2\n\t);\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns <Complex64Array>\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 <Complex64Array>\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 <Complex64Array>\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 <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns <Complex64Array>\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 <Complex64Array>\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 <Complex64Array>\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 <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns <ArrayBuffer>\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, <Complex64> ]\n*\n* v = it.next().value;\n* // returns [ 1, <Complex64> ]\n*\n* v = it.next().value;\n* // returns [ 2, <Complex64> ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex64( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n*\n* var z = arr.get( 0 );\n* // returns <Complex64>\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 <Complex64>\n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tvar buf;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\tbuf = this._buffer;\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n*\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns <Complex64>\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 <Complex64>\n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n\n// EXPORTS //\n\nmodule.exports = Complex64Array;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* 64-bit complex number array.\n*\n* @module @stdlib/array-complex64\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n*\n* var arr = new Complex64Array();\n* // returns <Complex64Array>\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 <Complex64Array>\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 <Complex64Array>\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 <Complex64Array>\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 <Complex64Array>\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 <Complex64Array>\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"],
5
+ "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,GADA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,KAAK,QACrB,MAAM,IAAI,WAAY,wFAAyF,EAMhH,GAJAD,EAAO/B,EAGPkB,EAAIX,EAAI,WAAcuB,EAAIjC,EAEzBkC,EAAK,SAAWxB,EAAI,QAEnBwB,EAAK,WAAab,GAClBa,EAAK,WAAWA,EAAK,WAAab,EAElC,CAGD,IADAL,EAAM,IAAI5B,EAAc+C,CAAE,EACpBf,EAAI,EAAGA,EAAIe,EAAGf,IACnBJ,EAAKI,CAAE,EAAIc,EAAMd,CAAE,EAEpBc,EAAOlB,CACR,CAIA,IAHAiB,GAAO,EACPE,GAAK,EACLd,EAAI,EACED,EAAI,EAAGA,EAAIe,EAAGf,IACnBV,EAAKuB,CAAI,EAAIC,EAAMb,CAAE,EACrBX,EAAKuB,EAAI,CAAE,EAAIC,EAAMb,EAAE,CAAE,EACzBY,GAAO,EACPZ,GAAK,EAEN,MACD,CAEA,GAAKY,EAAIE,EAAI,KAAK,QACjB,MAAM,IAAI,WAAY,wFAAyF,EAGhH,IADAF,GAAO,EACDb,EAAI,EAAGA,EAAIe,EAAGf,IACnBD,EAAIhB,EAAOiB,CAAE,EACbV,EAAKuB,CAAI,EAAI1C,EAAO4B,CAAE,EACtBT,EAAKuB,EAAI,CAAE,EAAIzC,EAAO2B,CAAE,EACxBc,GAAO,EAER,MACD,CACA,MAAM,IAAI,UAAW3C,EAAQ,kIAAmIa,CAAM,CAAE,CAGzK,CAAC,EAKD9B,EAAO,QAAU+B,IC58BjB,IAAIgC,GAAO,IAKX,OAAO,QAAUA",
6
+ "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", "i", "j", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isArrayLikeObject", "isCollection", "isArrayBuffer", "isObject", "isArray", "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", "byteOffset", "nargs", "buf", "len", "src", "thisArg", "clbk", "out", "tmp", "get", "flg", "v", "i", "j", "args", "target", "start", "buffer", "self", "iter", "FLG", "next", "end", "factory", "z", "idx", "sbuf", "N", "main"]
7
+ }
@@ -16,15 +16,14 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // TypeScript Version: 2.0
19
+ // TypeScript Version: 4.1
20
20
 
21
21
  /// <reference types="@stdlib/types"/>
22
22
 
23
23
  import { Iterator as Iter, IterableIterator } from '@stdlib/types/iter';
24
- import { ArrayLike, TypedArray } from '@stdlib/types/array';
25
- import { ComplexLike } from '@stdlib/types/object';
24
+ import { ArrayLike, RealOrComplexTypedArray, Complex64Array as Complex64ArrayInterface } from '@stdlib/types/array';
25
+ import { ComplexLike, Complex64 } from '@stdlib/types/complex';
26
26
  import ArrayBuffer = require( '@stdlib/array-buffer' );
27
- import Complex64 = require( '@stdlib/complex-float32' );
28
27
 
29
28
  // Define a union type representing both iterable and non-iterable iterators:
30
29
  type Iterator = Iter | IterableIterator;
@@ -32,7 +31,7 @@ type Iterator = Iter | IterableIterator;
32
31
  /**
33
32
  * Class for creating a 64-bit complex number array.
34
33
  */
35
- declare class Complex64Array {
34
+ declare class Complex64Array implements Complex64ArrayInterface {
36
35
  /**
37
36
  * 64-bit complex number array constructor.
38
37
  *
@@ -100,7 +99,7 @@ declare class Complex64Array {
100
99
  * var len = arr.length;
101
100
  * // returns 2
102
101
  */
103
- constructor( arg?: number | TypedArray | ArrayLike<number | ComplexLike> | ArrayBuffer | Iterable<number | ComplexLike>, byteOffset?: number, length?: number ); // tslint:disable-line:max-line-length
102
+ constructor( arg?: number | RealOrComplexTypedArray | ArrayLike<number | ComplexLike> | ArrayBuffer | Iterable<number | ComplexLike>, byteOffset?: number, length?: number ); // tslint:disable-line:max-line-length
104
103
 
105
104
  /**
106
105
  * Length (in bytes) of the array.
@@ -133,7 +132,7 @@ declare class Complex64Array {
133
132
  * var nbytes = arr.BYTES_PER_ELEMENT;
134
133
  * // returns 8
135
134
  */
136
- readonly BYTES_PER_ELEMENT: number;
135
+ readonly BYTES_PER_ELEMENT: 8;
137
136
 
138
137
  /**
139
138
  * Number of array elements.
@@ -156,8 +155,8 @@ declare class Complex64Array {
156
155
  *
157
156
  * @example
158
157
  * var Complex64 = require( `@stdlib/complex/float32` );
159
- * var real = require( `@stdlib/complex/real` );
160
- * var imag = require( `@stdlib/complex/imag` );
158
+ * var realf = require( `@stdlib/complex/realf` );
159
+ * var imagf = require( `@stdlib/complex/imagf` );
161
160
  *
162
161
  * var arr = new Complex64Array( 4 );
163
162
  *
@@ -173,10 +172,10 @@ declare class Complex64Array {
173
172
  * // Get the last array element:
174
173
  * var z = arr.get( 3 );
175
174
  *
176
- * var re = real( z );
175
+ * var re = realf( z );
177
176
  * // returns 2.0
178
177
  *
179
- * var im = imag( z );
178
+ * var im = imagf( z );
180
179
  * // returns 2.0
181
180
  */
182
181
  copyWithin( target: number, start: number, end?: number ): Complex64Array;
@@ -234,27 +233,6 @@ declare class Complex64Array {
234
233
  */
235
234
  get( i: number ): Complex64 | void;
236
235
 
237
- /**
238
- * Returns an array element.
239
- *
240
- * @param out - output array
241
- * @param i - element index
242
- * @throws index argument must be a nonnegative integer
243
- * @returns array element
244
- *
245
- * @example
246
- * var arr = new Complex64Array( 10 );
247
- *
248
- * var z = arr.get( 0 );
249
- * // returns <Complex64>
250
- *
251
- * arr.set( [ 1.0, -1.0 ], 0 );
252
- *
253
- * z = arr.get( [ 0.0, 0.0 ], 0 );
254
- * // returns [ 1.0, -1.0 ]
255
- */
256
- get( out: ArrayLike<number>, i: number ): ArrayLike<number> | void;
257
-
258
236
  /**
259
237
  * Sets an array element.
260
238
  *
@@ -287,18 +265,18 @@ declare class Complex64Array {
287
265
  * @throws target array lacks sufficient storage to accommodate source values
288
266
  *
289
267
  * @example
290
- * var real = require( `@stdlib/complex/real` );
291
- * var imag = require( `@stdlib/complex/imag` );
268
+ * var realf = require( `@stdlib/complex/realf` );
269
+ * var imagf = require( `@stdlib/complex/imagf` );
292
270
  *
293
271
  * var arr = new Complex64Array( 10 );
294
272
  *
295
273
  * var z = arr.get( 0 );
296
274
  * // returns <Complex64>
297
275
  *
298
- * var re = real( z );
276
+ * var re = realf( z );
299
277
  * // returns 0.0
300
278
  *
301
- * var im = imag( z );
279
+ * var im = imagf( z );
302
280
  * // returns 0.0
303
281
  *
304
282
  * arr.set( [ 1.0, -1.0 ], 0 );
@@ -306,19 +284,19 @@ declare class Complex64Array {
306
284
  * z = arr.get( 0 );
307
285
  * // returns <Complex64>
308
286
  *
309
- * re = real( z );
287
+ * re = realf( z );
310
288
  * // returns 1.0
311
289
  *
312
- * im = imag( z );
290
+ * im = imagf( z );
313
291
  * // returns -1.0
314
292
  */
315
- set( value: ArrayLike<number | ComplexLike> | Complex64Array | ComplexLike, i?: number ): void; // tslint:disable-line:max-line-length
293
+ set( value: ArrayLike<number | ComplexLike> | RealOrComplexTypedArray | ComplexLike, i?: number ): void; // tslint:disable-line:max-line-length
316
294
  }
317
295
 
318
296
  /**
319
297
  * Interface defining a 64-bit complex number array constructor which is both "newable" and "callable".
320
298
  */
321
- interface Constructor {
299
+ interface Complex64ArrayConstructor {
322
300
  /**
323
301
  * 64-bit complex number array constructor.
324
302
  *
@@ -386,7 +364,7 @@ interface Constructor {
386
364
  * var len = arr.length;
387
365
  * // returns 2
388
366
  */
389
- new( arg?: number | TypedArray | ArrayLike<number | ComplexLike> | ArrayBuffer | Iterable<number | ComplexLike>, byteOffset?: number, length?: number ): Complex64Array; // tslint-disable-line max-line-length
367
+ new( arg?: number | RealOrComplexTypedArray | ArrayLike<number | ComplexLike> | ArrayBuffer | Iterable<number | ComplexLike>, byteOffset?: number, length?: number ): Complex64Array; // tslint-disable-line max-line-length
390
368
 
391
369
  /**
392
370
  * 64-bit complex number array constructor.
@@ -455,7 +433,7 @@ interface Constructor {
455
433
  * var len = arr.length;
456
434
  * // returns 2
457
435
  */
458
- ( arg?: number | TypedArray | ArrayLike<number | ComplexLike> | ArrayBuffer | Iterable<number | ComplexLike>, byteOffset?: number, length?: number ): Complex64Array; // tslint-disable-line max-line-length
436
+ ( arg?: number | RealOrComplexTypedArray | ArrayLike<number | ComplexLike> | ArrayBuffer | Iterable<number | ComplexLike>, byteOffset?: number, length?: number ): Complex64Array; // tslint-disable-line max-line-length
459
437
 
460
438
  /**
461
439
  * Constructor name.
@@ -464,7 +442,7 @@ interface Constructor {
464
442
  * var str = Complex64Array.name;
465
443
  * // returns 'Complex64Array'
466
444
  */
467
- readonly name: string;
445
+ readonly name: 'Complex64Array';
468
446
 
469
447
  /**
470
448
  * Size (in bytes) of each array element.
@@ -473,7 +451,7 @@ interface Constructor {
473
451
  * var nbytes = Complex64Array.BYTES_PER_ELEMENT;
474
452
  * // returns 8
475
453
  */
476
- readonly BYTES_PER_ELEMENT: number;
454
+ readonly BYTES_PER_ELEMENT: 8;
477
455
 
478
456
  /**
479
457
  * Creates a new 64-bit complex number array from an array-like object or an iterable.
@@ -504,11 +482,11 @@ interface Constructor {
504
482
  *
505
483
  * @example
506
484
  * var Complex64 = require( `@stdlib/complex/float32` );
507
- * var real = require( `@stdlib/complex/real` );
508
- * var imag = require( `@stdlib/complex/imag` );
485
+ * var realf = require( `@stdlib/complex/realf` );
486
+ * var imagf = require( `@stdlib/complex/imagf` );
509
487
  *
510
488
  * function clbk( v ) {
511
- * return new Complex64( real(v)*2.0, imag(v)*2.0 );
489
+ * return new Complex64( realf(v)*2.0, imagf(v)*2.0 );
512
490
  * }
513
491
  *
514
492
  * var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );
@@ -517,7 +495,7 @@ interface Constructor {
517
495
  * var len = arr.length;
518
496
  * // returns 1
519
497
  */
520
- from( src: ArrayLike<number | ComplexLike> | Iterable<number | ComplexLike>, clbk?: Function, thisArg?: any ): Complex64Array; // tslint:disable-line:max-line-length
498
+ from( src: ArrayLike<number | ComplexLike> | RealOrComplexTypedArray | Iterable<number | ComplexLike>, clbk?: Function, thisArg?: any ): Complex64Array; // tslint:disable-line:max-line-length
521
499
 
522
500
  /**
523
501
  * Creates a new 64-bit complex number array from a variable number of arguments.
@@ -602,7 +580,7 @@ interface Constructor {
602
580
  * var len = arr.length;
603
581
  * // returns 2
604
582
  */
605
- declare var ctor: Constructor;
583
+ declare var ctor: Complex64ArrayConstructor;
606
584
 
607
585
 
608
586
  // EXPORTS //
package/lib/from_array.js CHANGED
@@ -21,8 +21,8 @@
21
21
  // MODULES //
22
22
 
23
23
  var isComplexLike = require( '@stdlib/assert-is-complex-like' );
24
- var real = require( '@stdlib/complex-real' );
25
- var imag = require( '@stdlib/complex-imag' );
24
+ var realf = require( '@stdlib/complex-realf' );
25
+ var imagf = require( '@stdlib/complex-imagf' );
26
26
 
27
27
 
28
28
  // MAIN //
@@ -48,8 +48,8 @@ function fromArray( buf, arr ) {
48
48
  if ( !isComplexLike( v ) ) {
49
49
  return null;
50
50
  }
51
- buf[ j ] = real( v );
52
- buf[ j+1 ] = imag( v );
51
+ buf[ j ] = realf( v );
52
+ buf[ j+1 ] = imagf( v );
53
53
  j += 2; // stride
54
54
  }
55
55
  return buf;
@@ -22,8 +22,9 @@
22
22
 
23
23
  var isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );
24
24
  var isComplexLike = require( '@stdlib/assert-is-complex-like' );
25
- var real = require( '@stdlib/complex-real' );
26
- var imag = require( '@stdlib/complex-imag' );
25
+ var realf = require( '@stdlib/complex-realf' );
26
+ var imagf = require( '@stdlib/complex-imagf' );
27
+ var format = require( '@stdlib/string-format' );
27
28
 
28
29
 
29
30
  // MAIN //
@@ -43,19 +44,17 @@ function fromIterator( it ) {
43
44
  out = [];
44
45
  while ( true ) {
45
46
  v = it.next();
46
- z = v.value;
47
- if ( z ) {
48
- if ( isArrayLikeObject( z ) && z.length >= 2 ) {
49
- out.push( z[ 0 ], z[ 1 ] );
50
- } else if ( isComplexLike( z ) ) {
51
- out.push( real( z ), imag( z ) );
52
- } else {
53
- return new TypeError( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `'+z+'`.' );
54
- }
55
- }
56
47
  if ( v.done ) {
57
48
  break;
58
49
  }
50
+ z = v.value;
51
+ if ( isArrayLikeObject( z ) && z.length >= 2 ) {
52
+ out.push( z[ 0 ], z[ 1 ] );
53
+ } else if ( isComplexLike( z ) ) {
54
+ out.push( realf( z ), imagf( z ) );
55
+ } else {
56
+ return 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 ) );
57
+ }
59
58
  }
60
59
  return out;
61
60
  }
@@ -22,8 +22,9 @@
22
22
 
23
23
  var isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );
24
24
  var isComplexLike = require( '@stdlib/assert-is-complex-like' );
25
- var real = require( '@stdlib/complex-real' );
26
- var imag = require( '@stdlib/complex-imag' );
25
+ var realf = require( '@stdlib/complex-realf' );
26
+ var imagf = require( '@stdlib/complex-imagf' );
27
+ var format = require( '@stdlib/string-format' );
27
28
 
28
29
 
29
30
  // MAIN //
@@ -46,22 +47,19 @@ function fromIteratorMap( it, clbk, thisArg ) {
46
47
  out = [];
47
48
  i = -1;
48
49
  while ( true ) {
49
- i += 1;
50
50
  v = it.next();
51
- z = v.value;
52
- if ( z ) {
53
- z = clbk.call( thisArg, z, i );
54
- if ( isArrayLikeObject( z ) && z.length >= 2 ) {
55
- out.push( z[ 0 ], z[ 1 ] );
56
- } else if ( isComplexLike( z ) ) {
57
- out.push( real( z ), imag( z ) );
58
- } else {
59
- return new TypeError( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `'+z+'`.' );
60
- }
61
- }
62
51
  if ( v.done ) {
63
52
  break;
64
53
  }
54
+ i += 1;
55
+ z = clbk.call( thisArg, v.value, i );
56
+ if ( isArrayLikeObject( z ) && z.length >= 2 ) {
57
+ out.push( z[ 0 ], z[ 1 ] );
58
+ } else if ( isComplexLike( z ) ) {
59
+ out.push( realf( z ), imagf( z ) );
60
+ } else {
61
+ return 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 ) );
62
+ }
65
63
  }
66
64
  return out;
67
65
  }
package/lib/index.js CHANGED
@@ -86,9 +86,9 @@
86
86
 
87
87
  // MODULES //
88
88
 
89
- var Complex64Array = require( './main.js' );
89
+ var main = require( './main.js' );
90
90
 
91
91
 
92
92
  // EXPORTS //
93
93
 
94
- module.exports = Complex64Array;
94
+ module.exports = main;