@stdlib/array-complex128
Advanced tools
Sorry, the diff of this file is not supported yet
| /// <reference path="../docs/types/index.d.ts" /> | ||
| import ctor from '../docs/types/index'; | ||
| export = ctor; |
| "use strict";var q=function(n,t){return function(){return t||n((t={exports:{}}).exports,t),t.exports}};var C=q(function(Er,B){ | ||
| var D=require('@stdlib/assert-is-array-like-object/dist'),J=require('@stdlib/assert-is-complex-like/dist'),K=require('@stdlib/error-tools-fmtprodmsg/dist'),Q=require('@stdlib/complex-real/dist'),U=require('@stdlib/complex-imag/dist');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(Q(e),U(e));else return new TypeError(K('00P24',e));return t}B.exports=X | ||
| });var O=q(function(dr,V){ | ||
| var Z=require('@stdlib/assert-is-array-like-object/dist'),$=require('@stdlib/assert-is-complex-like/dist'),rr=require('@stdlib/error-tools-fmtprodmsg/dist'),er=require('@stdlib/complex-real/dist'),tr=require('@stdlib/complex-imag/dist');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(er(i),tr(i));else return new TypeError(rr('00P25',i));return e}V.exports=nr | ||
| });var S=q(function(Tr,M){ | ||
| var ar=require('@stdlib/assert-is-complex-like/dist'),ir=require('@stdlib/complex-real/dist'),or=require('@stdlib/complex-imag/dist');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){ | ||
| var _=require('@stdlib/assert-is-nonnegative-integer/dist').isPrimitive,I=require('@stdlib/assert-is-array-like-object/dist'),j=require('@stdlib/assert-is-collection/dist'),N=require('@stdlib/assert-is-arraybuffer/dist'),Y=require('@stdlib/assert-is-object/dist'),sr=require('@stdlib/assert-is-array/dist'),b=require('@stdlib/assert-is-function/dist'),E=require('@stdlib/assert-is-complex-like/dist'),x=require('@stdlib/math-base-assert-is-even/dist'),R=require('@stdlib/math-base-assert-is-integer/dist'),fr=require('@stdlib/assert-has-iterator-symbol-support/dist'),d=require('@stdlib/symbol-iterator/dist'),v=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),k=require('@stdlib/utils-define-nonenumerable-read-only-accessor/dist'),c=require('@stdlib/array-float64/dist'),F=require('@stdlib/complex-float64/dist'),A=require('@stdlib/complex-real/dist'),L=require('@stdlib/complex-imag/dist'),lr=require('@stdlib/strided-base-reinterpret-complex64/dist'),mr=require('@stdlib/strided-base-reinterpret-complex128/dist'),gr=require('@stdlib/array-base-getter/dist'),hr=require('@stdlib/array-base-accessor-getter/dist'),l=require('@stdlib/error-tools-fmtprodmsg/dist'),P=C(),vr=O(),yr=S(),y=c.BYTES_PER_ELEMENT*2,W=fr();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==="Complex64Array"}function pr(n){return typeof n=="object"&&n!==null&&n.constructor.name==="Complex64Array"&&n.BYTES_PER_ELEMENT===y/2}function cr(n){return typeof n=="object"&&n!==null&&n.constructor.name==="Complex128Array"&&n.BYTES_PER_ELEMENT===y}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&&sr(r)&&E(r[0])){if(r=yr(new c(e*2),r),r===null){if(!x(e))throw new RangeError(l('00P26',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('00P27',e));r=new c(r)}else if(N(arguments[0])){if(r=arguments[0],!R(r.byteLength/y))throw new RangeError(l('00PE9',y,r.byteLength));r=new c(r)}else if(Y(arguments[0])){if(r=arguments[0],W===!1)throw new TypeError(l('00P29',r));if(!b(r[d]))throw new TypeError(l('00P2A',r));if(r=r[d](),!b(r.next))throw new TypeError(l('00P2A',r));if(r=P(r),r instanceof Error)throw r;r=new c(r)}else throw new TypeError(l('00P2A',arguments[0]));else{if(r=arguments[0],!N(r))throw new TypeError(l('00P2B',r));if(n=arguments[1],!_(n))throw new TypeError(l('00P2C',n));if(!R(n/y))throw new RangeError(l('00PEA',y,n));if(t===2){if(e=r.byteLength-n,!R(e/y))throw new RangeError(l('00P2E',y,e));r=new c(r,n)}else{if(e=arguments[2],!_(e))throw new TypeError(l('00P2F',e));if(e*y>r.byteLength-n)throw new RangeError(l('00P2G',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","Complex128Array");v(g,"from",function(t){var r,e,o,i,u,s,w,a,h,m,f,p;if(!b(this))throw new TypeError(format('00P01'));if(!z(this))throw new TypeError(format('00P02'));if(e=arguments.length,e>1){if(o=arguments[1],!b(o))throw new TypeError(l('00P2H',o));e>2&&(r=arguments[2])}if(T(t)){if(a=t.length,o){for(i=new this(a),u=i._buffer,p=0,f=0;f<a;f++){if(m=o.call(r,t.get(f),f),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('00P25',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"),f=0;f<a;f++)if(!E(w(t,f))){h=!0;break}if(h){if(!x(a))throw new RangeError(l('00P2I',a));for(i=new this(a/2),u=i._buffer,f=0;f<a;f++)u[f]=o.call(r,w(t,f),f);return i}for(i=new this(a),u=i._buffer,p=0,f=0;f<a;f++){if(m=o.call(r,w(t,f),f),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('00P25',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('00P2J',t));if(o?s=vr(u,o,r):s=P(u),s instanceof Error)throw s;for(a=s.length/2,i=new this(a),u=i._buffer,f=0;f<a;f++)u[f]=s[f];return i}throw new TypeError(l('00P2J',t))});v(g,"of",function(){var t,r;if(!b(this))throw new TypeError(format('00P01'));if(!z(this))throw new TypeError(format('00P02'));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(format('00P02'));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,s;if(!T(this))throw new TypeError(format('00P02'));return r=this,t=this._buffer,o=this._length,u=-1,s=-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}:(s+=2,m=new F(t[s],t[s+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(format('00P02'));if(!_(t))throw new TypeError(l('00P2K',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,s,w,a,h;if(!T(this))throw new TypeError(format('00P02'));if(o=this._buffer,arguments.length>1){if(e=arguments[1],!_(e))throw new TypeError(l('00P2L',e))}else e=0;if(E(t)){if(e>=this._length)throw new RangeError(l('00P2M',e));e*=2,o[e]=A(t),o[e+1]=L(t);return}if(T(t)){if(s=t._length,e+s>this._length)throw new RangeError(format('00P03'));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<s;a++)o[e]=r[h],o[e+1]=r[h+1],e+=2,h+=2;return}if(j(t)){for(s=t.length,a=0;a<s;a++)if(!E(t[a])){u=!0;break}if(u){if(!x(s))throw new RangeError(l('00P26',s));if(e+s/2>this._length)throw new RangeError(format('00P03'));if(r=t,h=o.byteOffset+e*y,r.buffer===o.buffer&&r.byteOffset<h&&r.byteOffset+r.byteLength>h){for(i=new c(s),a=0;a<s;a++)i[a]=r[a];r=i}for(e*=2,s/=2,h=0,a=0;a<s;a++)o[e]=r[h],o[e+1]=r[h+1],e+=2,h+=2;return}if(e+s>this._length)throw new RangeError(format('00P03'));for(e*=2,a=0;a<s;a++)w=t[a],o[e]=A(w),o[e+1]=L(w),e+=2;return}throw new TypeError(l('00P2N',t))});G.exports=g | ||
| });var wr=H();module.exports=wr; | ||
| /** @license Apache-2.0 */ | ||
| //# sourceMappingURL=index.js.map |
| { | ||
| "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 format = require( '@stdlib/string-format' );\nvar real = require( '@stdlib/complex-real' );\nvar imag = require( '@stdlib/complex-imag' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar format = require( '@stdlib/string-format' );\nvar real = require( '@stdlib/complex-real' );\nvar imag = require( '@stdlib/complex-imag' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar real = require( '@stdlib/complex-real' );\nvar imag = require( '@stdlib/complex-imag' );\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float64Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float64Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = real( v );\n\t\tbuf[ j+1 ] = imag( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromArray;\n", "/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' );\nvar isObject = require( '@stdlib/assert-is-object' );\nvar isArray = require( '@stdlib/assert-is-array' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar isEven = require( '@stdlib/math-base-assert-is-even' );\nvar isInteger = require( '@stdlib/math-base-assert-is-integer' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert-has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' );\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' );\nvar Float64Array = require( '@stdlib/array-float64' );\nvar Complex128 = require( '@stdlib/complex-float64' );\nvar real = require( '@stdlib/complex-real' );\nvar imag = require( '@stdlib/complex-imag' );\nvar reinterpret64 = require( '@stdlib/strided-base-reinterpret-complex64' );\nvar reinterpret128 = require( '@stdlib/strided-base-reinterpret-complex128' );\nvar getter = require( '@stdlib/array-base-getter' );\nvar accessorGetter = require( '@stdlib/array-base-accessor-getter' );\nvar format = require( '@stdlib/string-format' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\nvar fromArray = require( './from_array.js' );\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float64Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex128Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex128Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex64Array...\n\t\tvalue.name === 'Complex64Array'\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*/\nfunction isComplex64Array( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT/2\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*/\nfunction isComplex128Array( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// MAIN //\n\n/**\n* 128-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `16`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `16`\n* @throws {TypeError} view length must be a positive multiple of `16`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array();\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex128Array( 2 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex128Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex128Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex128Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex128Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex128Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex128Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float64Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float64Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float64Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float64Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float64Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var nbytes = Complex128Array.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128Array\n* @readonly\n* @type {string}\n* @default 'Complex128Array'\n*\n* @example\n* var name = Complex128Array.name;\n* // returns 'Complex128Array'\n*/\nsetReadOnly( Complex128Array, 'name', 'Complex128Array' );\n\n/**\n* Creates a new 128-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex128Array\n* @type {Function}\n* @param {(Collection|Object)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.from( [ 1.0, -1.0 ] );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64' );\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ] );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64' );\n* var real = require( '@stdlib/complex-real' );\n* var imag = require( '@stdlib/complex-imag' );\n*\n* function clbk( v ) {\n* return new Complex128( real(v)*2.0, imag(v)*2.0 );\n* }\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex128Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 128-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex128Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex128Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns <ArrayBuffer>\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 160\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array.prototype, 'BYTES_PER_ELEMENT', Complex128Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} modified array\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64' );\n* var real = require( '@stdlib/complex-real' );\n* var imag = require( '@stdlib/complex-imag' );\n*\n* var arr = new Complex128Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex128( 1.0, 1.0 ), 0 );\n* arr.set( new Complex128( 2.0, 2.0 ), 1 );\n* arr.set( new Complex128( 3.0, 3.0 ), 2 );\n* arr.set( new Complex128( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64' );\n*\n* var arr = [\n* new Complex128( 1.0, 1.0 ),\n* new Complex128( 2.0, 2.0 ),\n* new Complex128( 3.0, 3.0 )\n* ];\n* arr = new Complex128Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, <Complex128> ]\n*\n* v = it.next().value;\n* // returns [ 1, <Complex128> ]\n*\n* v = it.next().value;\n* // returns [ 2, <Complex128> ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex128( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n* var real = require( '@stdlib/complex-real' );\n* var imag = require( '@stdlib/complex-imag' );\n*\n* var z = arr.get( 0 );\n* // returns <Complex128>\n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns <Complex128>\n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'get', function get( idx ) {\n\tvar buf;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\tbuf = this._buffer;\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n*\n* @name set\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var real = require( '@stdlib/complex-real' );\n* var imag = require( '@stdlib/complex-imag' );\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns <Complex128>\n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns <Complex128>\n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = real( value );\n\t\tbuf[ idx+1 ] = imag( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float64Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float64Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = real( v );\n\t\t\tbuf[ idx+1 ] = imag( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n\n// EXPORTS //\n\nmodule.exports = Complex128Array;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* 128-bit complex number array.\n*\n* @module @stdlib/array-complex128\n*\n* @example\n* var Complex128Array = require( '@stdlib/array-complex128' );\n*\n* var arr = new Complex128Array();\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Complex128Array = require( '@stdlib/array-complex128' );\n*\n* var arr = new Complex128Array( 2 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Complex128Array = require( '@stdlib/array-complex128' );\n*\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Complex128Array = require( '@stdlib/array-complex128' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Complex128Array = require( '@stdlib/array-complex128' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Complex128Array = require( '@stdlib/array-complex128' );\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns <Complex128Array>\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,EAAS,QAAS,uBAAwB,EAC1CC,EAAO,QAAS,sBAAuB,EACvCC,EAAO,QAAS,sBAAuB,EAY3C,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,KAAMJ,EAAMM,CAAE,EAAGL,EAAMK,CAAE,CAAE,MAE/B,QAAO,IAAI,UAAWP,EAAQ,kJAAmJO,CAAE,CAAE,EAGvL,OAAOF,CACR,CAKAR,EAAO,QAAUM,IChEjB,IAAAK,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,EAAoB,QAAS,qC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AGA,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,EAAI3C,EAAM6B,CAAE,EACrBT,EAAKuB,EAAI,CAAE,EAAI1C,EAAM4B,CAAE,EACvBc,GAAO,EAER,MACD,CACA,MAAM,IAAI,UAAWrC,EAAQ,kIAAmIO,CAAM,CAAE,CAGzK,CAAC,EAKD9B,EAAO,QAAU+B,IC58BjB,IAAIgC,GAAO,IAKX,OAAO,QAAUA", | ||
| "names": ["require_from_iterator", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isComplexLike", "format", "real", "imag", "fromIterator", "it", "out", "v", "z", "require_from_iterator_map", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isComplexLike", "format", "real", "imag", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "z", "i", "require_from_array", "__commonJSMin", "exports", "module", "isComplexLike", "real", "imag", "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", "Float64Array", "Complex128", "real", "imag", "reinterpret64", "reinterpret128", "getter", "accessorGetter", "format", "fromIterator", "fromIteratorMap", "fromArray", "BYTES_PER_ELEMENT", "HAS_ITERATOR_SYMBOL", "isComplexArray", "value", "Complex128Array", "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"] | ||
| } |
@@ -19,3 +19,3 @@ /* | ||
| // TypeScript Version: 2.0 | ||
| // TypeScript Version: 4.1 | ||
@@ -26,3 +26,3 @@ /// <reference types="@stdlib/types"/> | ||
| import { ArrayLike, RealOrComplexTypedArray, Complex128Array as Complex128ArrayInterface } from '@stdlib/types/array'; | ||
| import { ComplexLike, Complex128 } from '@stdlib/types/object'; | ||
| import { ComplexLike, Complex128 } from '@stdlib/types/complex'; | ||
| import ArrayBuffer = require( '@stdlib/array-buffer' ); | ||
@@ -29,0 +29,0 @@ |
@@ -25,2 +25,3 @@ /** | ||
| var isComplexLike = require( '@stdlib/assert-is-complex-like' ); | ||
| var format = require( '@stdlib/string-format' ); | ||
| var real = require( '@stdlib/complex-real' ); | ||
@@ -61,3 +62,3 @@ var imag = require( '@stdlib/complex-imag' ); | ||
| } else { | ||
| return new TypeError( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `'+z+'`.' ); | ||
| 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 ) ); | ||
| } | ||
@@ -64,0 +65,0 @@ } |
@@ -25,2 +25,3 @@ /** | ||
| var isComplexLike = require( '@stdlib/assert-is-complex-like' ); | ||
| var format = require( '@stdlib/string-format' ); | ||
| var real = require( '@stdlib/complex-real' ); | ||
@@ -56,3 +57,3 @@ var imag = require( '@stdlib/complex-imag' ); | ||
| } else { | ||
| 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+'`.' ); | ||
| 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 ) ); | ||
| } | ||
@@ -59,0 +60,0 @@ } |
+36
-30
@@ -45,3 +45,5 @@ /* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */ | ||
| var reinterpret128 = require( '@stdlib/strided-base-reinterpret-complex128' ); | ||
| var arraylike2object = require( '@stdlib/array-base-arraylike2object' ); | ||
| var getter = require( '@stdlib/array-base-getter' ); | ||
| var accessorGetter = require( '@stdlib/array-base-accessor-getter' ); | ||
| var format = require( '@stdlib/string-format' ); | ||
| var fromIterator = require( './from_iterator.js' ); | ||
@@ -239,3 +241,3 @@ var fromIteratorMap = require( './from_iterator_map.js' ); | ||
| if ( !isEven( len ) ) { | ||
| throw new RangeError( 'invalid argument. Array-like object input arguments must have a length which is a multiple of two. Length: `'+len+'`.' ); | ||
| throw new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) ); | ||
| } | ||
@@ -251,3 +253,3 @@ // We failed, so fall back to directly setting values... | ||
| } else if ( !isEven( len ) ) { | ||
| throw new RangeError( 'invalid argument. Array-like object and typed array input arguments must have a length which is a multiple of two. Length: `'+len+'`.' ); | ||
| throw 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 ) ); | ||
| } | ||
@@ -259,3 +261,3 @@ buf = new Float64Array( buf ); | ||
| if ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) { | ||
| throw new RangeError( 'invalid argument. ArrayBuffer byte length must be a multiple of '+BYTES_PER_ELEMENT+'. Byte length: `'+buf.byteLength+'`.' ); | ||
| throw new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) ); | ||
| } | ||
@@ -266,10 +268,10 @@ buf = new Float64Array( buf ); | ||
| if ( HAS_ITERATOR_SYMBOL === false ) { | ||
| throw new TypeError( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `'+buf+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) ); | ||
| } | ||
| if ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) { | ||
| throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `'+buf+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); | ||
| } | ||
| buf = buf[ ITERATOR_SYMBOL ](); | ||
| if ( !isFunction( buf.next ) ) { | ||
| throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable.' ); | ||
| throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); | ||
| } | ||
@@ -282,3 +284,3 @@ buf = fromIterator( buf ); | ||
| } else { | ||
| throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `'+arguments[0]+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) ); | ||
| } | ||
@@ -288,10 +290,10 @@ } else { | ||
| if ( !isArrayBuffer( buf ) ) { | ||
| throw new TypeError( 'invalid argument. First argument must be an array buffer. Value: `'+buf+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) ); | ||
| } | ||
| byteOffset = arguments[ 1 ]; | ||
| if ( !isNonNegativeInteger( byteOffset ) ) { | ||
| throw new TypeError( 'invalid argument. Byte offset must be a nonnegative integer. Value: `'+byteOffset+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) ); | ||
| } | ||
| if ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) { | ||
| throw new RangeError( 'invalid argument. Byte offset must be a multiple of '+BYTES_PER_ELEMENT+'. Value: `'+byteOffset+'`.' ); | ||
| throw new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) ); | ||
| } | ||
@@ -301,3 +303,3 @@ if ( nargs === 2 ) { | ||
| if ( !isInteger( len/BYTES_PER_ELEMENT ) ) { | ||
| throw new RangeError( 'invalid arguments. ArrayBuffer view byte length must be a multiple of '+BYTES_PER_ELEMENT+'. View byte length: `'+len+'`.' ); | ||
| throw new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) ); | ||
| } | ||
@@ -308,6 +310,6 @@ buf = new Float64Array( buf, byteOffset ); | ||
| if ( !isNonNegativeInteger( len ) ) { | ||
| throw new TypeError( 'invalid argument. Length must be a nonnegative integer. Value: `'+len+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) ); | ||
| } | ||
| if ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) { | ||
| throw new RangeError( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `'+(len*BYTES_PER_ELEMENT)+'`.' ); | ||
| throw 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 ) ); | ||
| } | ||
@@ -409,2 +411,3 @@ buf = new Float64Array( buf, byteOffset, len*2 ); | ||
| var tmp; | ||
| var get; | ||
| var len; | ||
@@ -425,3 +428,3 @@ var flg; | ||
| if ( !isFunction( clbk ) ) { | ||
| throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+clbk+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) ); | ||
| } | ||
@@ -447,3 +450,3 @@ if ( nargs > 2 ) { | ||
| } else { | ||
| throw new TypeError( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `'+v+'`.' ); | ||
| throw 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 ) ); | ||
| } | ||
@@ -461,7 +464,10 @@ j += 2; // stride | ||
| len = src.length; | ||
| tmp = arraylike2object( src ); | ||
| if ( src.get && src.set ) { | ||
| get = accessorGetter( 'default' ); | ||
| } else { | ||
| get = getter( 'default' ); | ||
| } | ||
| // Detect whether we've been provided an array which returns complex number objects... | ||
| for ( i = 0; i < len; i++ ) { | ||
| if ( !isComplexLike( tmp.getter( src, i ) ) ) { | ||
| if ( !isComplexLike( get( src, i ) ) ) { | ||
| flg = true; | ||
@@ -474,3 +480,3 @@ break; | ||
| if ( !isEven( len ) ) { | ||
| throw new RangeError( 'invalid argument. First argument must have a length which is a multiple of two. Length: `'+len+'`.' ); | ||
| throw new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) ); | ||
| } | ||
@@ -480,3 +486,3 @@ out = new this( len/2 ); | ||
| for ( i = 0; i < len; i++ ) { | ||
| buf[ i ] = clbk.call( thisArg, tmp.getter( src, i ), i ); | ||
| buf[ i ] = clbk.call( thisArg, get( src, i ), i ); | ||
| } | ||
@@ -490,3 +496,3 @@ return out; | ||
| for ( i = 0; i < len; i++ ) { | ||
| v = clbk.call( thisArg, tmp.getter( src, i ), i ); | ||
| v = clbk.call( thisArg, get( src, i ), i ); | ||
| if ( isComplexLike( v ) ) { | ||
@@ -499,3 +505,3 @@ buf[ j ] = real( v ); | ||
| } else { | ||
| throw new TypeError( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `'+v+'`.' ); | ||
| throw 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 ) ); | ||
| } | ||
@@ -511,3 +517,3 @@ j += 2; // stride | ||
| if ( !isFunction( buf.next ) ) { | ||
| throw new TypeError( 'invalid argument. First argument must be an array-like object or an iterable.' ); | ||
| throw new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) ); | ||
| } | ||
@@ -530,3 +536,3 @@ if ( clbk ) { | ||
| } | ||
| throw new TypeError( 'invalid argument. First argument must be an array-like object or an iterable. Value: `'+src+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) ); | ||
| }); | ||
@@ -851,3 +857,3 @@ | ||
| if ( !isNonNegativeInteger( idx ) ) { | ||
| throw new TypeError( 'invalid argument. Must provide a nonnegative integer. Value: `'+idx+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) ); | ||
| } | ||
@@ -961,3 +967,3 @@ if ( idx >= this._length ) { | ||
| if ( !isNonNegativeInteger( idx ) ) { | ||
| throw new TypeError( 'invalid argument. Index argument must be a nonnegative integer. Value: `'+idx+'`.' ); | ||
| throw new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) ); | ||
| } | ||
@@ -969,3 +975,3 @@ } else { | ||
| if ( idx >= this._length ) { | ||
| throw new RangeError( 'invalid argument. Index argument is out-of-bounds. Value: `'+idx+'`.' ); | ||
| throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) ); | ||
| } | ||
@@ -1022,3 +1028,3 @@ idx *= 2; | ||
| if ( !isEven( N ) ) { | ||
| throw new RangeError( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `'+N+'`.' ); | ||
| throw new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) ); | ||
| } | ||
@@ -1070,3 +1076,3 @@ if ( idx+(N/2) > this._length ) { | ||
| } | ||
| throw new TypeError( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `'+value+'`.' ); | ||
| throw 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 ) ); | ||
@@ -1073,0 +1079,0 @@ /* eslint-enable no-underscore-dangle */ |
+0
-304
@@ -178,305 +178,1 @@ | ||
| END OF TERMS AND CONDITIONS | ||
| Boost Software License - Version 1.0 - August 17th, 2003 | ||
| Permission is hereby granted, free of charge, to any person or organization | ||
| obtaining a copy of the software and accompanying documentation covered by this | ||
| license (the "Software") to use, reproduce, display, distribute, execute, and | ||
| transmit the Software, and to prepare derivative works of the Software, and to | ||
| permit third-parties to whom the Software is furnished to do so, all subject to | ||
| the following: | ||
| The copyright notices in the Software and this entire statement, including the | ||
| above license grant, this restriction and the following disclaimer, must be | ||
| included in all copies of the Software, in whole or in part, and all derivative | ||
| works of the Software, unless such copies or derivative works are solely in the | ||
| form of machine-executable object code generated by a source language processor. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
| COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES | ||
| OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF | ||
| OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| DEPENDENCIES | ||
| The library links against the following external libraries, which have their own | ||
| licenses: | ||
| * OpenBLAS <https://raw.githubusercontent.com/xianyi/OpenBLAS/ | ||
| def146efed8d5908ea04e22668feeab7099599a0/LICENSE> | ||
| Copyright (c) 2011-2014, The OpenBLAS Project | ||
| All rights reserved. | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are | ||
| met: | ||
| 1. Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in | ||
| the documentation and/or other materials provided with the | ||
| distribution. | ||
| 3. Neither the name of the OpenBLAS project nor the names of | ||
| its contributors may be used to endorse or promote products | ||
| derived from this software without specific prior written | ||
| permission. | ||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE | ||
| GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | ||
| THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| * Electron <https://raw.githubusercontent.com/electron/electron/ | ||
| c4cfb3e7110266b9d7ad80e1ae097c4db564501c/LICENSE> | ||
| Copyright (c) 2013-2017 GitHub Inc. | ||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of this software and associated documentation files (the | ||
| "Software"), to deal in the Software without restriction, including | ||
| without limitation the rights to use, copy, modify, merge, publish, | ||
| distribute, sublicense, and/or sell copies of the Software, and to | ||
| permit persons to whom the Software is furnished to do so, subject to | ||
| the following conditions: | ||
| The above copyright notice and this permission notice shall be | ||
| included in all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| * Boost <http://www.boost.org/LICENSE_1_0.txt> | ||
| Boost Software License - Version 1.0 - August 17th, 2003 | ||
| Permission is hereby granted, free of charge, to any person or organization | ||
| obtaining a copy of the software and accompanying documentation covered by | ||
| this license (the "Software") to use, reproduce, display, distribute, | ||
| execute, and transmit the Software, and to prepare derivative works of the | ||
| Software, and to permit third-parties to whom the Software is furnished to | ||
| do so, all subject to the following: | ||
| The copyright notices in the Software and this entire statement, including | ||
| the above license grant, this restriction and the following disclaimer, | ||
| must be included in all copies of the Software, in whole or in part, and | ||
| all derivative works of the Software, unless such copies or derivative | ||
| works are solely in the form of machine-executable object code generated by | ||
| a source language processor. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT | ||
| SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE | ||
| FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, | ||
| ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| DEALINGS IN THE SOFTWARE. | ||
| * Cephes <http://www.netlib.org/cephes/readme> | ||
| Copyright (c) 1984-2000 Stephen L. Moshier | ||
| Some software in this archive may be from the book _Methods and Programs for | ||
| Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989) | ||
| or from the Cephes Mathematical Library, a commercial product. In either event, | ||
| it is copyrighted by the author. What you see here may be used freely but it | ||
| comes with no support or guarantee. | ||
| Stephen L. Moshier | ||
| moshier@na-net.ornl.gov | ||
| ATTRIBUTION | ||
| The library contains implementations from the following external libraries, | ||
| which have their own licenses: | ||
| * FreeBSD <https://svnweb.freebsd.org/> | ||
| Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. | ||
| Developed at SunPro, a Sun Microsystems, Inc. business. | ||
| Permission to use, copy, modify, and distribute this | ||
| software is freely granted, provided that this notice | ||
| is preserved. | ||
| * FDLIBM <http://www.netlib.org/fdlibm/> | ||
| Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. | ||
| Developed at SunPro, a Sun Microsystems, Inc. business. | ||
| Permission to use, copy, modify, and distribute this | ||
| software is freely granted, provided that this notice | ||
| is preserved. | ||
| * Go <https://raw.githubusercontent.com/golang/go/master/LICENSE> | ||
| Copyright (c) 2009 The Go Authors. All rights reserved. | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are | ||
| met: | ||
| * Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| * Redistributions in binary form must reproduce the above | ||
| copyright notice, this list of conditions and the following disclaimer | ||
| in the documentation and/or other materials provided with the | ||
| distribution. | ||
| * Neither the name of Google Inc. nor the names of its | ||
| contributors may be used to endorse or promote products derived from | ||
| this software without specific prior written permission. | ||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| * SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/> | ||
| Public domain. | ||
| * ESLint <https://raw.githubusercontent.com/eslint/eslint/master/LICENSE> | ||
| Copyright JS Foundation and other contributors, https://js.foundation | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. | ||
| * StatsFuns.jl <https://raw.githubusercontent.com/JuliaStats/StatsFuns.jl/ | ||
| e66dd973650c375bc1739c820e5b96bb5bd000a8/LICENSE.md> | ||
| Copyright (c) 2015: Dahua Lin. | ||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of this software and associated documentation files (the | ||
| "Software"), to deal in the Software without restriction, including | ||
| without limitation the rights to use, copy, modify, merge, publish, | ||
| distribute, sublicense, and/or sell copies of the Software, and to | ||
| permit persons to whom the Software is furnished to do so, subject to | ||
| the following conditions: | ||
| The above copyright notice and this permission notice shall be | ||
| included in all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
| IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
| CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
| TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
| SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| * SpecialFunctions.jl <https://raw.githubusercontent.com/JuliaMath/ | ||
| SpecialFunctions.jl/02a173fbe24a61c4b392aec17a9764ac5727feb1/LICENSE> | ||
| The MIT License (MIT) | ||
| Copyright (c) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others: | ||
| https://github.com/JuliaMath/SpecialFunctions.jl/graphs/contributors | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. | ||
| * MT19937 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/ | ||
| mt19937ar.c> | ||
| Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, | ||
| All rights reserved. | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions | ||
| are met: | ||
| 1. Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in the | ||
| documentation and/or other materials provided with the distribution. | ||
| 3. The names of its contributors may not be used to endorse or promote | ||
| products derived from this software without specific prior written | ||
| permission. | ||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+1
-1
@@ -1,1 +0,1 @@ | ||
| Copyright (c) 2016-2022 The Stdlib Authors. | ||
| Copyright (c) 2016-2023 The Stdlib Authors. |
+39
-35
| { | ||
| "name": "@stdlib/array-complex128", | ||
| "version": "0.0.6", | ||
| "version": "0.1.0", | ||
| "description": "Complex128Array.", | ||
@@ -38,39 +38,43 @@ "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@stdlib/array-base-arraylike2object": "^0.0.x", | ||
| "@stdlib/array-float64": "^0.0.x", | ||
| "@stdlib/assert-has-iterator-symbol-support": "^0.0.x", | ||
| "@stdlib/assert-is-array": "^0.0.x", | ||
| "@stdlib/assert-is-array-like-object": "^0.0.x", | ||
| "@stdlib/assert-is-arraybuffer": "^0.0.x", | ||
| "@stdlib/assert-is-collection": "^0.0.x", | ||
| "@stdlib/assert-is-complex-like": "^0.0.x", | ||
| "@stdlib/assert-is-function": "^0.0.x", | ||
| "@stdlib/assert-is-nonnegative-integer": "^0.0.x", | ||
| "@stdlib/assert-is-object": "^0.0.x", | ||
| "@stdlib/complex-float64": "^0.0.x", | ||
| "@stdlib/complex-imag": "^0.0.x", | ||
| "@stdlib/complex-real": "^0.0.x", | ||
| "@stdlib/math-base-assert-is-even": "^0.0.x", | ||
| "@stdlib/math-base-assert-is-integer": "^0.0.x", | ||
| "@stdlib/strided-base-reinterpret-complex128": "^0.0.x", | ||
| "@stdlib/strided-base-reinterpret-complex64": "^0.0.x", | ||
| "@stdlib/symbol-iterator": "^0.0.x", | ||
| "@stdlib/types": "^0.0.x", | ||
| "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.0.x", | ||
| "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" | ||
| "@stdlib/array-base-accessor-getter": "^0.1.0", | ||
| "@stdlib/array-base-getter": "^0.1.0", | ||
| "@stdlib/array-float64": "^0.1.0", | ||
| "@stdlib/assert-has-iterator-symbol-support": "^0.1.0", | ||
| "@stdlib/assert-is-array": "^0.1.0", | ||
| "@stdlib/assert-is-array-like-object": "^0.1.0", | ||
| "@stdlib/assert-is-arraybuffer": "^0.1.0", | ||
| "@stdlib/assert-is-collection": "^0.1.0", | ||
| "@stdlib/assert-is-complex-like": "^0.1.0", | ||
| "@stdlib/assert-is-function": "^0.1.0", | ||
| "@stdlib/assert-is-nonnegative-integer": "^0.1.0", | ||
| "@stdlib/assert-is-object": "^0.1.0", | ||
| "@stdlib/complex-float64": "^0.1.0", | ||
| "@stdlib/complex-imag": "^0.1.0", | ||
| "@stdlib/complex-real": "^0.1.0", | ||
| "@stdlib/math-base-assert-is-even": "^0.1.0", | ||
| "@stdlib/math-base-assert-is-integer": "^0.1.0", | ||
| "@stdlib/strided-base-reinterpret-complex128": "^0.1.0", | ||
| "@stdlib/strided-base-reinterpret-complex64": "^0.1.0", | ||
| "@stdlib/string-format": "^0.1.0", | ||
| "@stdlib/symbol-iterator": "^0.1.0", | ||
| "@stdlib/types": "^0.1.0", | ||
| "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.1.0", | ||
| "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0", | ||
| "@stdlib/error-tools-fmtprodmsg": "^0.1.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@stdlib/array-buffer": "^0.0.x", | ||
| "@stdlib/array-complex64": "^0.0.x", | ||
| "@stdlib/assert-has-own-property": "^0.0.x", | ||
| "@stdlib/assert-is-complex128": "^0.0.x", | ||
| "@stdlib/assert-is-negative-zero": "^0.0.x", | ||
| "@stdlib/assert-is-positive-zero": "^0.0.x", | ||
| "@stdlib/complex-float32": "^0.0.x", | ||
| "@stdlib/complex-imagf": "^0.0.x", | ||
| "@stdlib/complex-realf": "^0.0.x", | ||
| "@stdlib/array-buffer": "^0.1.0", | ||
| "@stdlib/array-complex64": "^0.1.0", | ||
| "@stdlib/assert-has-own-property": "^0.1.0", | ||
| "@stdlib/assert-is-complex128": "^0.1.0", | ||
| "@stdlib/assert-is-negative-zero": "^0.1.0", | ||
| "@stdlib/assert-is-positive-zero": "^0.1.0", | ||
| "@stdlib/complex-float32": "^0.1.0", | ||
| "@stdlib/complex-imagf": "^0.1.0", | ||
| "@stdlib/complex-realf": "^0.1.0", | ||
| "@stdlib/console-log-each": "^0.0.2", | ||
| "proxyquire": "^2.0.0", | ||
| "tape": "git+https://github.com/kgryte/tape.git#fix/globby", | ||
| "istanbul": "^0.4.1", | ||
| "tap-spec": "5.x.x" | ||
| "tap-min": "git+https://github.com/Planeshifter/tap-min.git" | ||
| }, | ||
@@ -115,5 +119,5 @@ "engines": { | ||
| "funding": { | ||
| "type": "patreon", | ||
| "url": "https://www.patreon.com/athan" | ||
| "type": "opencollective", | ||
| "url": "https://opencollective.com/stdlib" | ||
| } | ||
| } |
+31
-18
@@ -21,2 +21,13 @@ <!-- | ||
| <details> | ||
| <summary> | ||
| About stdlib... | ||
| </summary> | ||
| <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p> | ||
| <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p> | ||
| <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p> | ||
| <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p> | ||
| </details> | ||
| # Complex128Array | ||
@@ -967,2 +978,3 @@ | ||
| var Float64Array = require( '@stdlib/array-float64' ); | ||
| var logEach = require( '@stdlib/console-log-each' ); | ||
| var Complex128Array = require( '@stdlib/array-complex128' ); | ||
@@ -972,3 +984,3 @@ | ||
| var out = new Complex128Array( 3 ); | ||
| console.log( out ); | ||
| logEach( '%s', out ); | ||
@@ -982,3 +994,3 @@ // Create a complex array from an array of complex numbers: | ||
| out = new Complex128Array( arr ); | ||
| console.log( out ); | ||
| logEach( '%s', out ); | ||
@@ -988,3 +1000,3 @@ // Create a complex array from an interleaved typed array: | ||
| out = new Complex128Array( arr ); | ||
| console.log( out ); | ||
| logEach( '%s', out ); | ||
@@ -994,3 +1006,3 @@ // Create a complex array from an array buffer: | ||
| out = new Complex128Array( arr.buffer ); | ||
| console.log( out ); | ||
| logEach( '%s', out ); | ||
@@ -1000,3 +1012,3 @@ // Create a complex array from an array buffer view: | ||
| out = new Complex128Array( arr.buffer, 16, 2 ); | ||
| console.log( out ); | ||
| logEach( '%s', out ); | ||
| ``` | ||
@@ -1024,5 +1036,5 @@ | ||
| - <span class="package-name">[`@stdlib/array/complex64`][@stdlib/array/complex64]</span><span class="delimiter">: </span><span class="description">Complex64Array.</span> | ||
| - <span class="package-name">[`@stdlib/complex/cmplx`][@stdlib/complex/cmplx]</span><span class="delimiter">: </span><span class="description">create a complex number.</span> | ||
| - <span class="package-name">[`@stdlib/complex/float64`][@stdlib/complex/float64]</span><span class="delimiter">: </span><span class="description">128-bit complex number.</span> | ||
| - <span class="package-name">[`@stdlib/array-complex64`][@stdlib/array/complex64]</span><span class="delimiter">: </span><span class="description">Complex64Array.</span> | ||
| - <span class="package-name">[`@stdlib/complex-cmplx`][@stdlib/complex/cmplx]</span><span class="delimiter">: </span><span class="description">create a complex number.</span> | ||
| - <span class="package-name">[`@stdlib/complex-float64`][@stdlib/complex/float64]</span><span class="delimiter">: </span><span class="description">128-bit complex number.</span> | ||
@@ -1059,3 +1071,3 @@ </section> | ||
| Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors]. | ||
| Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors]. | ||
@@ -1073,4 +1085,4 @@ </section> | ||
| [test-image]: https://github.com/stdlib-js/array-complex128/actions/workflows/test.yml/badge.svg | ||
| [test-url]: https://github.com/stdlib-js/array-complex128/actions/workflows/test.yml | ||
| [test-image]: https://github.com/stdlib-js/array-complex128/actions/workflows/test.yml/badge.svg?branch=v0.1.0 | ||
| [test-url]: https://github.com/stdlib-js/array-complex128/actions/workflows/test.yml?query=branch:v0.1.0 | ||
@@ -1087,2 +1099,9 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-complex128/main.svg | ||
| [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
| [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im | ||
| [stdlib]: https://github.com/stdlib-js/stdlib | ||
| [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors | ||
| [umd]: https://github.com/umdjs/umd | ||
@@ -1094,10 +1113,4 @@ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules | ||
| [esm-url]: https://github.com/stdlib-js/array-complex128/tree/esm | ||
| [branches-url]: https://github.com/stdlib-js/array-complex128/blob/main/branches.md | ||
| [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
| [chat-url]: https://gitter.im/stdlib-js/stdlib/ | ||
| [stdlib]: https://github.com/stdlib-js/stdlib | ||
| [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors | ||
| [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-complex128/main/LICENSE | ||
@@ -1104,0 +1117,0 @@ |
| /* | ||
| * @license Apache-2.0 | ||
| * | ||
| * Copyright (c) 2021 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. | ||
| */ | ||
| // tslint:disable:no-unused-expression | ||
| import Complex128Array = require( './index' ); | ||
| import Complex128 = require( '@stdlib/complex-float64' ); | ||
| import ArrayBuffer = require( '@stdlib/array-buffer' ); | ||
| import real = require( '@stdlib/complex-real' ); | ||
| import imag = require( '@stdlib/complex-imag' ); | ||
| const clbk = ( v: Complex128 ) => { | ||
| return new Complex128( real( v ) * 2.0, imag( v ) * 2.0 ); | ||
| }; | ||
| // TESTS // | ||
| // The function returns a complex number array... | ||
| { | ||
| new Complex128Array(); // $ExpectType Complex128Array | ||
| Complex128Array(); // $ExpectType Complex128Array | ||
| new Complex128Array( 2 ); // $ExpectType Complex128Array | ||
| Complex128Array( 2 ); // $ExpectType Complex128Array | ||
| new Complex128Array( [ 1.0, -1.0 ] ); // $ExpectType Complex128Array | ||
| Complex128Array( [ 1.0, -1.0 ] ); // $ExpectType Complex128Array | ||
| const buf = new ArrayBuffer( 16 ); | ||
| new Complex128Array( buf ); // $ExpectType Complex128Array | ||
| Complex128Array( buf ); // $ExpectType Complex128Array | ||
| new Complex128Array( buf, 8 ); // $ExpectType Complex128Array | ||
| Complex128Array( buf, 8 ); // $ExpectType Complex128Array | ||
| new Complex128Array( buf, 8, 2 ); // $ExpectType Complex128Array | ||
| Complex128Array( buf, 8, 2 ); // $ExpectType Complex128Array | ||
| } | ||
| // The compiler throws an error if the function is provided a first argument that is not a number, typed array, array-like object, or array buffer... | ||
| { | ||
| new Complex128Array( true ); // $ExpectError | ||
| new Complex128Array( false ); // $ExpectError | ||
| new Complex128Array( null ); // $ExpectError | ||
| new Complex128Array( 'abc' ); // $ExpectError | ||
| new Complex128Array( {} ); // $ExpectError | ||
| new Complex128Array( ( x: number ): number => x ); // $ExpectError | ||
| Complex128Array( true ); // $ExpectError | ||
| Complex128Array( false ); // $ExpectError | ||
| Complex128Array( null ); // $ExpectError | ||
| Complex128Array( 'abc' ); // $ExpectError | ||
| Complex128Array( {} ); // $ExpectError | ||
| Complex128Array( ( x: number ): number => x ); // $ExpectError | ||
| } | ||
| // The compiler throws an error if the function is provided a second argument that is not a number... | ||
| { | ||
| const buf = new ArrayBuffer( 16 ); | ||
| new Complex128Array( buf, true ); // $ExpectError | ||
| new Complex128Array( buf, false ); // $ExpectError | ||
| new Complex128Array( buf, null ); // $ExpectError | ||
| new Complex128Array( buf, 'abc' ); // $ExpectError | ||
| new Complex128Array( buf, {} ); // $ExpectError | ||
| new Complex128Array( buf, ( x: number ): number => x ); // $ExpectError | ||
| Complex128Array( buf, true ); // $ExpectError | ||
| Complex128Array( buf, false ); // $ExpectError | ||
| Complex128Array( buf, null ); // $ExpectError | ||
| Complex128Array( buf, 'abc' ); // $ExpectError | ||
| Complex128Array( buf, {} ); // $ExpectError | ||
| Complex128Array( buf, ( x: number ): number => x ); // $ExpectError | ||
| } | ||
| // The compiler throws an error if the function is provided a third argument that is not a number... | ||
| { | ||
| const buf = new ArrayBuffer( 16 ); | ||
| new Complex128Array( buf, 8, true ); // $ExpectError | ||
| new Complex128Array( buf, 8, false ); // $ExpectError | ||
| new Complex128Array( buf, 8, null ); // $ExpectError | ||
| new Complex128Array( buf, 8, 'abc' ); // $ExpectError | ||
| new Complex128Array( buf, 8, {} ); // $ExpectError | ||
| new Complex128Array( buf, 8, ( x: number ): number => x ); // $ExpectError | ||
| Complex128Array( buf, 8, true ); // $ExpectError | ||
| Complex128Array( buf, 8, false ); // $ExpectError | ||
| Complex128Array( buf, 8, null ); // $ExpectError | ||
| Complex128Array( buf, 8, 'abc' ); // $ExpectError | ||
| Complex128Array( buf, 8, {} ); // $ExpectError | ||
| Complex128Array( buf, 8, ( x: number ): number => x ); // $ExpectError | ||
| } | ||
| // The `from` method returns a complex number array... | ||
| { | ||
| Complex128Array.from( [ 1.0, 1.0 ] ); // $ExpectType Complex128Array | ||
| Complex128Array.from( [ 1.0, 1.0 ], ( x: number ): number => x * x ); // $ExpectType Complex128Array | ||
| Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk, {} ); // $ExpectType Complex128Array | ||
| } | ||
| // The compiler throws an error if the `from` method is provided a first argument which is not array-like or iterable... | ||
| { | ||
| Complex128Array.from( true ); // $ExpectError | ||
| Complex128Array.from( false ); // $ExpectError | ||
| Complex128Array.from( 123 ); // $ExpectError | ||
| Complex128Array.from( null ); // $ExpectError | ||
| Complex128Array.from( {} ); // $ExpectError | ||
| Complex128Array.from( true, clbk ); // $ExpectError | ||
| Complex128Array.from( false, clbk ); // $ExpectError | ||
| Complex128Array.from( 123, clbk ); // $ExpectError | ||
| Complex128Array.from( null, clbk ); // $ExpectError | ||
| Complex128Array.from( {}, clbk ); // $ExpectError | ||
| Complex128Array.from( true, clbk, {} ); // $ExpectError | ||
| Complex128Array.from( false, clbk, {} ); // $ExpectError | ||
| Complex128Array.from( 123, clbk, {} ); // $ExpectError | ||
| Complex128Array.from( null, clbk, {} ); // $ExpectError | ||
| Complex128Array.from( {}, clbk, {} ); // $ExpectError | ||
| } | ||
| // The compiler throws an error if the `from` method is provided a second argument which is not a function with a supported signature... | ||
| { | ||
| Complex128Array.from( [ 1, 1 ], true ); // $ExpectError | ||
| Complex128Array.from( [ 1, 1 ], false ); // $ExpectError | ||
| Complex128Array.from( [ 1, 1 ], 123 ); // $ExpectError | ||
| Complex128Array.from( [ 1, 1 ], null ); // $ExpectError | ||
| Complex128Array.from( [ 1, 1 ], {} ); // $ExpectError | ||
| } | ||
| // The `of` method returns a complex number array... | ||
| { | ||
| Complex128Array.of( 1.0, 1.0, 1.0, 1.0 ); // $ExpectType Complex128Array | ||
| } | ||
| // The compiler throws an error if the `of` method is provided arguments that are not numbers... | ||
| { | ||
| Complex128Array.of( 'abc', 'def' ); // $ExpectError | ||
| Complex128Array.of( true, false ); // $ExpectError | ||
| Complex128Array.of( {}, [] ); // $ExpectError | ||
| Complex128Array.of( null, null ); // $ExpectError | ||
| } |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Mixed license
LicensePackage contains multiple licenses.
Found 1 instance in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
161911
40.05%14
27.27%0
-100%1123
1.17%25
13.64%14
7.69%1875
-4.19%2
100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated