@stdlib/array-complex64 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +443 -121
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/docs/types/index.d.ts +325 -53
- package/lib/from_array.js +2 -2
- package/lib/from_iterator.js +2 -2
- package/lib/from_iterator_map.js +2 -2
- package/lib/main.js +599 -68
- package/package.json +27 -26
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var L=function(u,e){return function(){return e||u((e={exports:{}}).exports,e),e.exports}};var S=L(function(dr,O){"use strict";var K=require("@stdlib/assert-is-array-like-object"),Q=require("@stdlib/assert-is-complex-like"),U=require("@stdlib/complex-realf"),X=require("@stdlib/complex-imagf"),Z=require("@stdlib/string-format");function $(u){var e,r,t;for(e=[];r=u.next(),!r.done;)if(t=r.value,K(t)&&t.length>=2)e.push(t[0],t[1]);else if(Q(t))e.push(U(t),X(t));else return new TypeError(Z("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",t));return e}O.exports=$});var B=L(function(Vr,C){"use strict";var I=require("@stdlib/assert-is-array-like-object"),rr=require("@stdlib/assert-is-complex-like"),er=require("@stdlib/complex-realf"),tr=require("@stdlib/complex-imagf"),ir=require("@stdlib/string-format");function nr(u,e,r){var t,i,n,a;for(t=[],a=-1;i=u.next(),!i.done;)if(a+=1,n=e.call(r,i.value,a),I(n)&&n.length>=2)t.push(n[0],n[1]);else if(rr(n))t.push(er(n),tr(n));else return new TypeError(ir("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return t}C.exports=nr});var z=L(function(xr,M){"use strict";var ar=require("@stdlib/assert-is-complex-like"),or=require("@stdlib/complex-realf"),ur=require("@stdlib/complex-imagf");function sr(u,e){var r,t,i,n;for(r=e.length,n=0,i=0;i<r;i++){if(t=e[i],!ar(t))return null;u[n]=or(t),u[n+1]=ur(t),n+=2}return u}M.exports=sr});var J=L(function(qr,D){"use strict";var A=require("@stdlib/assert-is-nonnegative-integer").isPrimitive,F=require("@stdlib/assert-is-array-like-object"),R=require("@stdlib/assert-is-collection"),N=require("@stdlib/assert-is-arraybuffer"),P=require("@stdlib/assert-is-object"),fr=require("@stdlib/assert-is-array"),lr=require("@stdlib/assert-is-string").isPrimitive,w=require("@stdlib/assert-is-function"),d=require("@stdlib/assert-is-complex-like"),k=require("@stdlib/math-base-assert-is-even"),b=require("@stdlib/math-base-assert-is-integer"),hr=require("@stdlib/array-base-assert-is-complex64array"),mr=require("@stdlib/array-base-assert-is-complex128array"),vr=require("@stdlib/assert-has-iterator-symbol-support"),q=require("@stdlib/symbol-iterator"),h=require("@stdlib/utils-define-nonenumerable-read-only-property"),j=require("@stdlib/utils-define-nonenumerable-read-only-accessor"),_=require("@stdlib/array-float32"),Y=require("@stdlib/complex-float32"),f=require("@stdlib/string-format"),V=require("@stdlib/complex-realf"),x=require("@stdlib/complex-imagf"),gr=require("@stdlib/math-base-special-floor"),yr=require("@stdlib/strided-base-reinterpret-complex64"),pr=require("@stdlib/strided-base-reinterpret-complex128"),wr=require("@stdlib/array-base-getter"),cr=require("@stdlib/array-base-accessor-getter"),W=S(),br=B(),Er=z(),E=_.BYTES_PER_ELEMENT*2,G=vr();function m(u){return u instanceof l||typeof u=="object"&&u!==null&&(u.constructor.name==="Complex64Array"||u.constructor.name==="Complex128Array")&&typeof u._length=="number"&&typeof u._buffer=="object"}function H(u){return u===l||u.name==="Complex128Array"}function c(u,e){return e*=2,new Y(u[e],u[e+1])}function l(){var u,e,r,t;if(e=arguments.length,!(this instanceof l))return e===0?new l:e===1?new l(arguments[0]):e===2?new l(arguments[0],arguments[1]):new l(arguments[0],arguments[1],arguments[2]);if(e===0)r=new _(0);else if(e===1)if(A(arguments[0]))r=new _(arguments[0]*2);else if(R(arguments[0]))if(r=arguments[0],t=r.length,t&&fr(r)&&d(r[0])){if(r=Er(new _(t*2),r),r===null){if(!k(t))throw new RangeError(f("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",t));r=new _(arguments[0])}}else{if(hr(r))r=yr(r,0);else if(mr(r))r=pr(r,0);else if(!k(t))throw new RangeError(f("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",t));r=new _(r)}else if(N(arguments[0])){if(r=arguments[0],!b(r.byteLength/E))throw new RangeError(f("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",E,r.byteLength));r=new _(r)}else if(P(arguments[0])){if(r=arguments[0],G===!1)throw new TypeError(f("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",r));if(!w(r[q]))throw new TypeError(f("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=r[q](),!w(r.next))throw new TypeError(f("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=W(r),r instanceof Error)throw r;r=new _(r)}else throw new TypeError(f("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));else{if(r=arguments[0],!N(r))throw new TypeError(f("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",r));if(u=arguments[1],!A(u))throw new TypeError(f("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",u));if(!b(u/E))throw new RangeError(f("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",E,u));if(e===2){if(t=r.byteLength-u,!b(t/E))throw new RangeError(f("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",E,t));r=new _(r,u)}else{if(t=arguments[2],!A(t))throw new TypeError(f("invalid argument. Length must be a nonnegative integer. Value: `%s`.",t));if(t*E>r.byteLength-u)throw new RangeError(f("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",t*E));r=new _(r,u,t*2)}}return h(this,"_buffer",r),h(this,"_length",r.length/2),this}h(l,"BYTES_PER_ELEMENT",E);h(l,"name","Complex64Array");h(l,"from",function(e){var r,t,i,n,a,o,y,s,p,g,v,T;if(!w(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(t=arguments.length,t>1){if(i=arguments[1],!w(i))throw new TypeError(f("invalid argument. Second argument must be a function. Value: `%s`.",i));t>2&&(r=arguments[2])}if(m(e)){if(s=e.length,i){for(n=new this(s),a=n._buffer,T=0,v=0;v<s;v++){if(g=i.call(r,e.get(v),v),d(g))a[T]=V(g),a[T+1]=x(g);else if(F(g)&&g.length>=2)a[T]=g[0],a[T+1]=g[1];else throw new TypeError(f("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",g));T+=2}return n}return new this(e)}if(R(e)){if(i){for(s=e.length,e.get&&e.set?y=cr("default"):y=wr("default"),v=0;v<s;v++)if(!d(y(e,v))){p=!0;break}if(p){if(!k(s))throw new RangeError(f("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,s));for(n=new this(s/2),a=n._buffer,v=0;v<s;v++)a[v]=i.call(r,y(e,v),v);return n}for(n=new this(s),a=n._buffer,T=0,v=0;v<s;v++){if(g=i.call(r,y(e,v),v),d(g))a[T]=V(g),a[T+1]=x(g);else if(F(g)&&g.length>=2)a[T]=g[0],a[T+1]=g[1];else throw new TypeError(f("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",g));T+=2}return n}return new this(e)}if(P(e)&&G&&w(e[q])){if(a=e[q](),!w(a.next))throw new TypeError(f("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(i?o=br(a,i,r):o=W(a),o instanceof Error)throw o;for(s=o.length/2,n=new this(s),a=n._buffer,v=0;v<s;v++)a[v]=o[v];return n}throw new TypeError(f("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e))});h(l,"of",function(){var e,r;if(!w(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);return new this(e)});h(l.prototype,"at",function(e){if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!b(e))throw new TypeError(f("invalid argument. Must provide an integer. Value: `%s`.",e));if(e<0&&(e+=this._length),!(e<0||e>=this._length))return c(this._buffer,e)});j(l.prototype,"buffer",function(){return this._buffer.buffer});j(l.prototype,"byteLength",function(){return this._buffer.byteLength});j(l.prototype,"byteOffset",function(){return this._buffer.byteOffset});h(l.prototype,"BYTES_PER_ELEMENT",l.BYTES_PER_ELEMENT);h(l.prototype,"copyWithin",function(e,r){if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,r*2):this._buffer.copyWithin(e*2,r*2,arguments[2]*2),this});h(l.prototype,"entries",function(){var e,r,t,i,n,a,o;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._buffer,i=this._length,a=-1,o=-2,t={},h(t,"next",y),h(t,"return",s),q&&h(t,q,p),t;function y(){var g;return a+=1,n||a>=i?{done:!0}:(o+=2,g=new Y(e[o],e[o+1]),{value:[a,g],done:!1})}function s(g){return n=!0,arguments.length?{value:g,done:!0}:{done:!0}}function p(){return r.entries()}});h(l.prototype,"every",function(e,r){var t,i;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=0;i<this._length;i++)if(!e.call(r,c(t,i),i,this))return!1;return!0});h(l.prototype,"fill",function(e,r,t){var i,n,a,o,y,s;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!d(e))throw new TypeError(f("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(i=this._buffer,n=this._length,arguments.length>1){if(!b(r))throw new TypeError(f("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=n,r<0&&(r=0)),arguments.length>2){if(!b(t))throw new TypeError(f("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=n,t<0&&(t=0)),t>n&&(t=n)}else t=n}else r=0,t=n;for(o=V(e),y=x(e),s=r;s<t;s++)a=2*s,i[a]=o,i[a+1]=y;return this});h(l.prototype,"filter",function(e,r){var t,i,n,a;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=[],n=0;n<this._length;n++)a=c(t,n),e.call(r,a,n,this)&&i.push(a);return new this.constructor(i)});h(l.prototype,"find",function(e,r){var t,i,n;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=0;i<this._length;i++)if(n=c(t,i),e.call(r,n,i,this))return n});h(l.prototype,"findIndex",function(e,r){var t,i,n;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=0;i<this._length;i++)if(n=c(t,i),e.call(r,n,i,this))return i;return-1});h(l.prototype,"findLast",function(e,r){var t,i,n;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=c(t,i),e.call(r,n,i,this))return n});h(l.prototype,"findLastIndex",function(e,r){var t,i,n;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=c(t,i),e.call(r,n,i,this))return i;return-1});h(l.prototype,"forEach",function(e,r){var t,i,n;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=0;i<this._length;i++)n=c(t,i),e.call(r,n,i,this)});h(l.prototype,"get",function(e){if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!A(e))throw new TypeError(f("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return c(this._buffer,e)});h(l.prototype,"includes",function(e,r){var t,i,n,a,o;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!d(e))throw new TypeError(f("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!b(r))throw new TypeError(f("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length,r<0&&(r=0))}else r=0;for(n=V(e),a=x(e),t=this._buffer,o=r;o<this._length;o++)if(i=2*o,n===t[i]&&a===t[i+1])return!0;return!1});h(l.prototype,"indexOf",function(e,r){var t,i,n,a,o;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!d(e))throw new TypeError(f("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!b(r))throw new TypeError(f("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length,r<0&&(r=0))}else r=0;for(n=V(e),a=x(e),t=this._buffer,o=r;o<this._length;o++)if(i=2*o,n===t[i]&&a===t[i+1])return o;return-1});h(l.prototype,"join",function(e){var r,t,i,n;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)i=",";else if(lr(e))i=e;else throw new TypeError(f("invalid argument. First argument must be a string. Value: `%s`.",e));for(r=[],t=this._buffer,n=0;n<this._length;n++)r.push(c(t,n).toString());return r.join(i)});h(l.prototype,"lastIndexOf",function(e,r){var t,i,n,a,o;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!d(e))throw new TypeError(f("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!b(r))throw new TypeError(f("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(n=V(e),a=x(e),t=this._buffer,o=r;o>=0;o--)if(i=2*o,n===t[i]&&a===t[i+1])return o;return-1});j(l.prototype,"length",function(){return this._length});h(l.prototype,"map",function(e,r){var t,i,n,a,o;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,n=new this.constructor(this._length),t=n._buffer,a=0;a<this._length;a++)if(o=e.call(r,c(i,a),a,this),d(o))t[2*a]=V(o),t[2*a+1]=x(o);else if(F(o)&&o.length===2)t[2*a]=o[0],t[2*a+1]=o[1];else throw new TypeError(f("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return n});h(l.prototype,"reduce",function(e,r){var t,i,n,a,o;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));if(t=this._buffer,n=this._length,arguments.length>1)i=r,o=0;else{if(n===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=c(t,0),o=1}for(;o<n;o++)a=c(t,o),i=e(i,a,o,this);return i});h(l.prototype,"reverse",function(){var e,r,t,i,n,a;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=this._buffer,i=gr(t/2),n=0;n<i;n++)a=t-n-1,r=e[2*n],e[2*n]=e[2*a],e[2*a]=r,r=e[2*n+1],e[2*n+1]=e[2*a+1],e[2*a+1]=r;return this});h(l.prototype,"set",function(e){var r,t,i,n,a,o,y,s,p;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,arguments.length>1){if(t=arguments[1],!A(t))throw new TypeError(f("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(d(e)){if(t>=this._length)throw new RangeError(f("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));t*=2,i[t]=V(e),i[t+1]=x(e);return}if(m(e)){if(o=e._length,t+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,p=i.byteOffset+t*E,r.buffer===i.buffer&&r.byteOffset<p&&r.byteOffset+r.byteLength>p){for(n=new _(r.length),s=0;s<r.length;s++)n[s]=r[s];r=n}for(t*=2,p=0,s=0;s<o;s++)i[t]=r[p],i[t+1]=r[p+1],t+=2,p+=2;return}if(R(e)){for(o=e.length,s=0;s<o;s++)if(!d(e[s])){a=!0;break}if(a){if(!k(o))throw new RangeError(f("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",o));if(t+o/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e,p=i.byteOffset+t*E,r.buffer===i.buffer&&r.byteOffset<p&&r.byteOffset+r.byteLength>p){for(n=new _(o),s=0;s<o;s++)n[s]=r[s];r=n}for(t*=2,o/=2,p=0,s=0;s<o;s++)i[t]=r[p],i[t+1]=r[p+1],t+=2,p+=2;return}if(t+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,s=0;s<o;s++)y=e[s],i[t]=V(y),i[t+1]=x(y),t+=2;return}throw new TypeError(f("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",e))});h(l.prototype,"slice",function(e,r){var t,i,n,a,o,y,s;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(o=this._buffer,y=this._length,arguments.length===0)e=0,r=y;else{if(!b(e))throw new TypeError(f("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=y,e<0&&(e=0)),arguments.length===1)r=y;else{if(!b(r))throw new TypeError(f("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=y,r<0&&(r=0)):r>y&&(r=y)}}for(e<r?t=r-e:t=0,n=new this.constructor(t),i=n._buffer,s=0;s<t;s++)a=2*(s+e),i[2*s]=o[a],i[2*s+1]=o[a+1];return n});h(l.prototype,"some",function(e,r){var t,i;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(f("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,i=0;i<this._length;i++)if(e.call(r,c(t,i),i,this))return!0;return!1});h(l.prototype,"subarray",function(e,r){var t,i,n;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,n=this._length,arguments.length===0)e=0,r=n;else{if(!b(e))throw new TypeError(f("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=n,e<0&&(e=0)),arguments.length===1)r=n;else{if(!b(r))throw new TypeError(f("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n)}}return e>=n?(n=0,t=i.byteLength):e>=r?(n=0,t=i.byteOffset+e*E):(n=r-e,t=i.byteOffset+e*E),new this.constructor(i.buffer,t,n<0?0:n)});h(l.prototype,"toReversed",function(){var e,r,t,i,n,a;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=new this.constructor(t),i=this._buffer,e=r._buffer,n=0;n<t;n++)a=t-n-1,e[2*n]=i[2*a],e[2*n+1]=i[2*a+1];return r});h(l.prototype,"toString",function(){var e,r,t;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t<this._length;t++)e.push(c(r,t).toString());return e.join(",")});h(l.prototype,"with",function(e,r){var t,i,n;if(!m(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!b(e))throw new TypeError(f("invalid argument. First argument must be an integer. Value: `%s`.",e));if(n=this._length,e<0&&(e+=n),e<0||e>=n)throw new RangeError(f("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!d(r))throw new TypeError(f("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return i=new this.constructor(this._buffer),t=i._buffer,t[2*e]=V(r),t[2*e+1]=x(r),i});D.exports=l});var Tr=J();module.exports=Tr;
|
|
1
|
+
"use strict";var A=function(u,e){return function(){return e||u((e={exports:{}}).exports,e),e.exports}};var C=A(function(xr,O){"use strict";var K=require("@stdlib/assert-is-array-like-object"),Q=require("@stdlib/assert-is-complex-like"),U=require("@stdlib/complex-float32-real"),X=require("@stdlib/complex-float32-imag"),Z=require("@stdlib/string-format");function $(u){var e,r,t;for(e=[];r=u.next(),!r.done;)if(t=r.value,K(t)&&t.length>=2)e.push(t[0],t[1]);else if(Q(t))e.push(U(t),X(t));else return new TypeError(Z("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",t));return e}O.exports=$});var M=A(function(Vr,B){"use strict";var I=require("@stdlib/assert-is-array-like-object"),rr=require("@stdlib/assert-is-complex-like"),er=require("@stdlib/complex-float32-real"),tr=require("@stdlib/complex-float32-imag"),ir=require("@stdlib/string-format");function nr(u,e,r){var t,n,i,a;for(t=[],a=-1;n=u.next(),!n.done;)if(a+=1,i=e.call(r,n.value,a),I(i)&&i.length>=2)t.push(i[0],i[1]);else if(rr(i))t.push(er(i),tr(i));else return new TypeError(ir("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));return t}B.exports=nr});var z=A(function(qr,N){"use strict";var ar=require("@stdlib/assert-is-complex-like"),or=require("@stdlib/complex-float32-real"),ur=require("@stdlib/complex-float32-imag");function sr(u,e){var r,t,n,i;for(r=e.length,i=0,n=0;n<r;n++){if(t=e[n],!ar(t))return null;u[i]=or(t),u[i+1]=ur(t),i+=2}return u}N.exports=sr});var J=A(function(Lr,D){"use strict";var L=require("@stdlib/assert-is-nonnegative-integer").isPrimitive,j=require("@stdlib/assert-is-array-like-object"),F=require("@stdlib/assert-is-collection"),P=require("@stdlib/assert-is-arraybuffer"),R=require("@stdlib/assert-is-object"),fr=require("@stdlib/assert-is-array"),lr=require("@stdlib/assert-is-string-array").primitives,Y=require("@stdlib/assert-is-string").isPrimitive,w=require("@stdlib/assert-is-function"),_=require("@stdlib/assert-is-complex-like"),k=require("@stdlib/math-base-assert-is-even"),b=require("@stdlib/math-base-assert-is-integer"),hr=require("@stdlib/array-base-assert-is-complex64array"),vr=require("@stdlib/array-base-assert-is-complex128array"),mr=require("@stdlib/assert-has-iterator-symbol-support"),q=require("@stdlib/symbol-iterator"),h=require("@stdlib/utils-define-nonenumerable-read-only-property"),S=require("@stdlib/utils-define-nonenumerable-read-only-accessor"),T=require("@stdlib/array-float32"),gr=require("@stdlib/complex-float32-ctor"),s=require("@stdlib/string-format"),x=require("@stdlib/complex-float32-real"),V=require("@stdlib/complex-float32-imag"),pr=require("@stdlib/math-base-special-floor"),yr=require("@stdlib/strided-base-reinterpret-complex64"),wr=require("@stdlib/strided-base-reinterpret-complex128"),cr=require("@stdlib/array-base-getter"),br=require("@stdlib/array-base-accessor-getter"),W=C(),Er=M(),dr=z(),E=T.BYTES_PER_ELEMENT*2,G=mr();function v(u){return u instanceof l||typeof u=="object"&&u!==null&&(u.constructor.name==="Complex64Array"||u.constructor.name==="Complex128Array")&&typeof u._length=="number"&&typeof u._buffer=="object"}function H(u){return u===l||u.name==="Complex128Array"}function p(u,e){return e*=2,new gr(u[e],u[e+1])}function l(){var u,e,r,t;if(e=arguments.length,!(this instanceof l))return e===0?new l:e===1?new l(arguments[0]):e===2?new l(arguments[0],arguments[1]):new l(arguments[0],arguments[1],arguments[2]);if(e===0)r=new T(0);else if(e===1)if(L(arguments[0]))r=new T(arguments[0]*2);else if(F(arguments[0]))if(r=arguments[0],t=r.length,t&&fr(r)&&_(r[0])){if(r=dr(new T(t*2),r),r===null){if(!k(t))throw new RangeError(s("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",t));r=new T(arguments[0])}}else{if(hr(r))r=yr(r,0);else if(vr(r))r=wr(r,0);else if(!k(t))throw new RangeError(s("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",t));r=new T(r)}else if(P(arguments[0])){if(r=arguments[0],!b(r.byteLength/E))throw new RangeError(s("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",E,r.byteLength));r=new T(r)}else if(R(arguments[0])){if(r=arguments[0],G===!1)throw new TypeError(s("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",r));if(!w(r[q]))throw new TypeError(s("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=r[q](),!w(r.next))throw new TypeError(s("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=W(r),r instanceof Error)throw r;r=new T(r)}else throw new TypeError(s("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));else{if(r=arguments[0],!P(r))throw new TypeError(s("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",r));if(u=arguments[1],!L(u))throw new TypeError(s("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",u));if(!b(u/E))throw new RangeError(s("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",E,u));if(e===2){if(t=r.byteLength-u,!b(t/E))throw new RangeError(s("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",E,t));r=new T(r,u)}else{if(t=arguments[2],!L(t))throw new TypeError(s("invalid argument. Length must be a nonnegative integer. Value: `%s`.",t));if(t*E>r.byteLength-u)throw new RangeError(s("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",t*E));r=new T(r,u,t*2)}}return h(this,"_buffer",r),h(this,"_length",r.length/2),this}h(l,"BYTES_PER_ELEMENT",E);h(l,"name","Complex64Array");h(l,"from",function(e){var r,t,n,i,a,o,m,f,y,c,g,d;if(!w(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(t=arguments.length,t>1){if(n=arguments[1],!w(n))throw new TypeError(s("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(r=arguments[2])}if(v(e)){if(f=e.length,n){for(i=new this(f),a=i._buffer,d=0,g=0;g<f;g++){if(c=n.call(r,e.get(g),g),_(c))a[d]=x(c),a[d+1]=V(c);else if(j(c)&&c.length>=2)a[d]=c[0],a[d+1]=c[1];else throw new TypeError(s("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));d+=2}return i}return new this(e)}if(F(e)){if(n){for(f=e.length,e.get&&e.set?m=br("default"):m=cr("default"),g=0;g<f;g++)if(!_(m(e,g))){y=!0;break}if(y){if(!k(f))throw new RangeError(s("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,f));for(i=new this(f/2),a=i._buffer,g=0;g<f;g++)a[g]=n.call(r,m(e,g),g);return i}for(i=new this(f),a=i._buffer,d=0,g=0;g<f;g++){if(c=n.call(r,m(e,g),g),_(c))a[d]=x(c),a[d+1]=V(c);else if(j(c)&&c.length>=2)a[d]=c[0],a[d+1]=c[1];else throw new TypeError(s("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));d+=2}return i}return new this(e)}if(R(e)&&G&&w(e[q])){if(a=e[q](),!w(a.next))throw new TypeError(s("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(n?o=Er(a,n,r):o=W(a),o instanceof Error)throw o;for(f=o.length/2,i=new this(f),a=i._buffer,g=0;g<f;g++)a[g]=o[g];return i}throw new TypeError(s("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e))});h(l,"of",function(){var e,r;if(!w(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!H(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);return new this(e)});h(l.prototype,"at",function(e){if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!b(e))throw new TypeError(s("invalid argument. Must provide an integer. Value: `%s`.",e));if(e<0&&(e+=this._length),!(e<0||e>=this._length))return p(this._buffer,e)});S(l.prototype,"buffer",function(){return this._buffer.buffer});S(l.prototype,"byteLength",function(){return this._buffer.byteLength});S(l.prototype,"byteOffset",function(){return this._buffer.byteOffset});h(l.prototype,"BYTES_PER_ELEMENT",l.BYTES_PER_ELEMENT);h(l.prototype,"copyWithin",function(e,r){if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(e*2,r*2):this._buffer.copyWithin(e*2,r*2,arguments[2]*2),this});h(l.prototype,"entries",function(){var e,r,t,n,i,a;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,n=this._buffer,t=this._length,a=-1,r={},h(r,"next",o),h(r,"return",m),q&&h(r,q,f),r;function o(){return a+=1,i||a>=t?{done:!0}:{value:[a,p(n,a)],done:!1}}function m(y){return i=!0,arguments.length?{value:y,done:!0}:{done:!0}}function f(){return e.entries()}});h(l.prototype,"every",function(e,r){var t,n;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(!e.call(r,p(t,n),n,this))return!1;return!0});h(l.prototype,"fill",function(e,r,t){var n,i,a,o,m,f;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_(e))throw new TypeError(s("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(n=this._buffer,i=this._length,arguments.length>1){if(!b(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i,r<0&&(r=0)),arguments.length>2){if(!b(t))throw new TypeError(s("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i,t<0&&(t=0)),t>i&&(t=i)}else t=i}else r=0,t=i;for(o=x(e),m=V(e),f=r;f<t;f++)a=2*f,n[a]=o,n[a+1]=m;return this});h(l.prototype,"filter",function(e,r){var t,n,i,a;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=[],i=0;i<this._length;i++)a=p(t,i),e.call(r,a,i,this)&&n.push(a);return new this.constructor(n)});h(l.prototype,"find",function(e,r){var t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=p(t,n),e.call(r,i,n,this))return i});h(l.prototype,"findIndex",function(e,r){var t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=p(t,n),e.call(r,i,n,this))return n;return-1});h(l.prototype,"findLast",function(e,r){var t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=p(t,n),e.call(r,i,n,this))return i});h(l.prototype,"findLastIndex",function(e,r){var t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=p(t,n),e.call(r,i,n,this))return n;return-1});h(l.prototype,"forEach",function(e,r){var t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)i=p(t,n),e.call(r,i,n,this)});h(l.prototype,"get",function(e){if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!L(e))throw new TypeError(s("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return p(this._buffer,e)});h(l.prototype,"includes",function(e,r){var t,n,i,a,o;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_(e))throw new TypeError(s("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!b(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length,r<0&&(r=0))}else r=0;for(i=x(e),a=V(e),t=this._buffer,o=r;o<this._length;o++)if(n=2*o,i===t[n]&&a===t[n+1])return!0;return!1});h(l.prototype,"indexOf",function(e,r){var t,n,i,a,o;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_(e))throw new TypeError(s("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!b(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length,r<0&&(r=0))}else r=0;for(i=x(e),a=V(e),t=this._buffer,o=r;o<this._length;o++)if(n=2*o,i===t[n]&&a===t[n+1])return o;return-1});h(l.prototype,"join",function(e){var r,t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)n=",";else if(Y(e))n=e;else throw new TypeError(s("invalid argument. First argument must be a string. Value: `%s`.",e));for(r=[],t=this._buffer,i=0;i<this._length;i++)r.push(p(t,i).toString());return r.join(n)});h(l.prototype,"keys",function(){var e,r,t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,t=this._length,i=-1,r={},h(r,"next",a),h(r,"return",o),q&&h(r,q,m),r;function a(){return i+=1,n||i>=t?{done:!0}:{value:i,done:!1}}function o(f){return n=!0,arguments.length?{value:f,done:!0}:{done:!0}}function m(){return e.keys()}});h(l.prototype,"lastIndexOf",function(e,r){var t,n,i,a,o;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_(e))throw new TypeError(s("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!b(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=x(e),a=V(e),t=this._buffer,o=r;o>=0;o--)if(n=2*o,i===t[n]&&a===t[n+1])return o;return-1});S(l.prototype,"length",function(){return this._length});h(l.prototype,"map",function(e,r){var t,n,i,a,o;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,i=new this.constructor(this._length),t=i._buffer,a=0;a<this._length;a++)if(o=e.call(r,p(n,a),a,this),_(o))t[2*a]=x(o),t[2*a+1]=V(o);else if(j(o)&&o.length===2)t[2*a]=o[0],t[2*a+1]=o[1];else throw new TypeError(s("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return i});h(l.prototype,"reduce",function(e,r){var t,n,i,a,o;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));if(t=this._buffer,i=this._length,arguments.length>1)n=r,o=0;else{if(i===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=p(t,0),o=1}for(;o<i;o++)a=p(t,o),n=e(n,a,o,this);return n});h(l.prototype,"reduceRight",function(e,r){var t,n,i,a,o;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));if(t=this._buffer,i=this._length,arguments.length>1)n=r,o=i-1;else{if(i===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=p(t,i-1),o=i-2}for(;o>=0;o--)a=p(t,o),n=e(n,a,o,this);return n});h(l.prototype,"reverse",function(){var e,r,t,n,i,a;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=this._buffer,n=pr(t/2),i=0;i<n;i++)a=t-i-1,r=e[2*i],e[2*i]=e[2*a],e[2*a]=r,r=e[2*i+1],e[2*i+1]=e[2*a+1],e[2*a+1]=r;return this});h(l.prototype,"set",function(e){var r,t,n,i,a,o,m,f,y;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(t=arguments[1],!L(t))throw new TypeError(s("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(_(e)){if(t>=this._length)throw new RangeError(s("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));t*=2,n[t]=x(e),n[t+1]=V(e);return}if(v(e)){if(o=e._length,t+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,y=n.byteOffset+t*E,r.buffer===n.buffer&&r.byteOffset<y&&r.byteOffset+r.byteLength>y){for(i=new T(r.length),f=0;f<r.length;f++)i[f]=r[f];r=i}for(t*=2,y=0,f=0;f<o;f++)n[t]=r[y],n[t+1]=r[y+1],t+=2,y+=2;return}if(F(e)){for(o=e.length,f=0;f<o;f++)if(!_(e[f])){a=!0;break}if(a){if(!k(o))throw new RangeError(s("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",o));if(t+o/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e,y=n.byteOffset+t*E,r.buffer===n.buffer&&r.byteOffset<y&&r.byteOffset+r.byteLength>y){for(i=new T(o),f=0;f<o;f++)i[f]=r[f];r=i}for(t*=2,o/=2,y=0,f=0;f<o;f++)n[t]=r[y],n[t+1]=r[y+1],t+=2,y+=2;return}if(t+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;f<o;f++)m=e[f],n[t]=x(m),n[t+1]=V(m),t+=2;return}throw new TypeError(s("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",e))});h(l.prototype,"slice",function(e,r){var t,n,i,a,o,m,f;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(o=this._buffer,m=this._length,arguments.length===0)e=0,r=m;else{if(!b(e))throw new TypeError(s("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=m,e<0&&(e=0)),arguments.length===1)r=m;else{if(!b(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=m,r<0&&(r=0)):r>m&&(r=m)}}for(e<r?t=r-e:t=0,i=new this.constructor(t),n=i._buffer,f=0;f<t;f++)a=2*(f+e),n[2*f]=o[a],n[2*f+1]=o[a+1];return i});h(l.prototype,"some",function(e,r){var t,n;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(e.call(r,p(t,n),n,this))return!0;return!1});h(l.prototype,"sort",function(e){var r,t,n,i,a;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length,r=[],i=0;i<n;i++)r.push(p(t,i));for(r.sort(e),i=0;i<n;i++)a=2*i,t[a]=x(r[i]),t[a+1]=V(r[i]);return this});h(l.prototype,"subarray",function(e,r){var t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,arguments.length===0)e=0,r=i;else{if(!b(e))throw new TypeError(s("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i,e<0&&(e=0)),arguments.length===1)r=i;else{if(!b(r))throw new TypeError(s("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i)}}return e>=i?(i=0,t=n.byteLength):e>=r?(i=0,t=n.byteOffset+e*E):(i=r-e,t=n.byteOffset+e*E),new this.constructor(n.buffer,t,i<0?0:i)});h(l.prototype,"toLocaleString",function(e,r){var t,n,i,a,o;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)n=[];else if(Y(e)||lr(e))n=e;else throw new TypeError(s("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",e));if(arguments.length<2)t={};else if(R(r))t=r;else throw new TypeError(s("invalid argument. Options argument must be an object. Value: `%s`.",r));for(a=this._buffer,i=[],o=0;o<this._length;o++)i.push(p(a,o).toLocaleString(n,t));return i.join(",")});h(l.prototype,"toReversed",function(){var e,r,t,n,i,a;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=new this.constructor(t),n=this._buffer,e=r._buffer,i=0;i<t;i++)a=t-i-1,e[2*i]=n[2*a],e[2*i+1]=n[2*a+1];return r});h(l.prototype,"toSorted",function(e){var r,t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!w(e))throw new TypeError(s("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length,r=[],i=0;i<n;i++)r.push(p(t,i));return r.sort(e),new l(r)});h(l.prototype,"toString",function(){var e,r,t;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t<this._length;t++)e.push(p(r,t).toString());return e.join(",")});h(l.prototype,"values",function(){var e,r,t,n,i,a;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,i=this._buffer,t=this._length,a=-1,e={},h(e,"next",o),h(e,"return",m),q&&h(e,q,f),e;function o(){return a+=1,n||a>=t?{done:!0}:{value:p(i,a),done:!1}}function m(y){return n=!0,arguments.length?{value:y,done:!0}:{done:!0}}function f(){return r.values()}});h(l.prototype,"with",function(e,r){var t,n,i;if(!v(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!b(e))throw new TypeError(s("invalid argument. First argument must be an integer. Value: `%s`.",e));if(i=this._length,e<0&&(e+=i),e<0||e>=i)throw new RangeError(s("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!_(r))throw new TypeError(s("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return n=new this.constructor(this._buffer),t=n._buffer,t[2*e]=x(r),t[2*e+1]=V(r),n});D.exports=l});var Tr=J();module.exports=Tr;
|
|
2
2
|
/**
|
|
3
3
|
* @license Apache-2.0
|
|
4
4
|
*
|