@stdlib/array-complex64 0.0.6 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CITATION.cff +30 -0
- package/LICENSE +0 -304
- package/NOTICE +1 -1
- package/README.md +31 -18
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +7 -0
- package/docs/types/index.d.ts +2 -2
- package/lib/from_iterator.js +2 -1
- package/lib/from_iterator_map.js +2 -1
- package/lib/main.js +36 -30
- package/package.json +41 -37
- package/docs/types/test.ts +0 -153
package/CITATION.cff
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
title: stdlib
|
|
3
|
+
message: >-
|
|
4
|
+
If you use this software, please cite it using the
|
|
5
|
+
metadata from this file.
|
|
6
|
+
|
|
7
|
+
type: software
|
|
8
|
+
|
|
9
|
+
authors:
|
|
10
|
+
- name: The Stdlib Authors
|
|
11
|
+
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
+
|
|
13
|
+
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
+
url: https://stdlib.io
|
|
15
|
+
|
|
16
|
+
abstract: |
|
|
17
|
+
Standard library for JavaScript and Node.js.
|
|
18
|
+
|
|
19
|
+
keywords:
|
|
20
|
+
- JavaScript
|
|
21
|
+
- Node.js
|
|
22
|
+
- TypeScript
|
|
23
|
+
- standard library
|
|
24
|
+
- scientific computing
|
|
25
|
+
- numerical computing
|
|
26
|
+
- statistical computing
|
|
27
|
+
|
|
28
|
+
license: Apache-2.0 AND BSL-1.0
|
|
29
|
+
|
|
30
|
+
date-released: 2016
|
package/LICENSE
CHANGED
|
@@ -175,307 +175,3 @@
|
|
|
175
175
|
of your accepting any such warranty or additional liability.
|
|
176
176
|
|
|
177
177
|
END OF TERMS AND CONDITIONS
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Boost Software License - Version 1.0 - August 17th, 2003
|
|
182
|
-
|
|
183
|
-
Permission is hereby granted, free of charge, to any person or organization
|
|
184
|
-
obtaining a copy of the software and accompanying documentation covered by this
|
|
185
|
-
license (the "Software") to use, reproduce, display, distribute, execute, and
|
|
186
|
-
transmit the Software, and to prepare derivative works of the Software, and to
|
|
187
|
-
permit third-parties to whom the Software is furnished to do so, all subject to
|
|
188
|
-
the following:
|
|
189
|
-
|
|
190
|
-
The copyright notices in the Software and this entire statement, including the
|
|
191
|
-
above license grant, this restriction and the following disclaimer, must be
|
|
192
|
-
included in all copies of the Software, in whole or in part, and all derivative
|
|
193
|
-
works of the Software, unless such copies or derivative works are solely in the
|
|
194
|
-
form of machine-executable object code generated by a source language processor.
|
|
195
|
-
|
|
196
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
197
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
198
|
-
FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
199
|
-
COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES
|
|
200
|
-
OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
201
|
-
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
DEPENDENCIES
|
|
207
|
-
|
|
208
|
-
The library links against the following external libraries, which have their own
|
|
209
|
-
licenses:
|
|
210
|
-
|
|
211
|
-
* OpenBLAS <https://raw.githubusercontent.com/xianyi/OpenBLAS/
|
|
212
|
-
def146efed8d5908ea04e22668feeab7099599a0/LICENSE>
|
|
213
|
-
|
|
214
|
-
Copyright (c) 2011-2014, The OpenBLAS Project
|
|
215
|
-
All rights reserved.
|
|
216
|
-
|
|
217
|
-
Redistribution and use in source and binary forms, with or without
|
|
218
|
-
modification, are permitted provided that the following conditions are
|
|
219
|
-
met:
|
|
220
|
-
|
|
221
|
-
1. Redistributions of source code must retain the above copyright
|
|
222
|
-
notice, this list of conditions and the following disclaimer.
|
|
223
|
-
|
|
224
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
225
|
-
notice, this list of conditions and the following disclaimer in
|
|
226
|
-
the documentation and/or other materials provided with the
|
|
227
|
-
distribution.
|
|
228
|
-
|
|
229
|
-
3. Neither the name of the OpenBLAS project nor the names of
|
|
230
|
-
its contributors may be used to endorse or promote products
|
|
231
|
-
derived from this software without specific prior written
|
|
232
|
-
permission.
|
|
233
|
-
|
|
234
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
235
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
236
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
237
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
238
|
-
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
239
|
-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
240
|
-
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
241
|
-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
242
|
-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
|
243
|
-
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
* Electron <https://raw.githubusercontent.com/electron/electron/
|
|
247
|
-
c4cfb3e7110266b9d7ad80e1ae097c4db564501c/LICENSE>
|
|
248
|
-
|
|
249
|
-
Copyright (c) 2013-2017 GitHub Inc.
|
|
250
|
-
|
|
251
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
252
|
-
a copy of this software and associated documentation files (the
|
|
253
|
-
"Software"), to deal in the Software without restriction, including
|
|
254
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
255
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
256
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
257
|
-
the following conditions:
|
|
258
|
-
|
|
259
|
-
The above copyright notice and this permission notice shall be
|
|
260
|
-
included in all copies or substantial portions of the Software.
|
|
261
|
-
|
|
262
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
263
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
264
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
265
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
266
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
267
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
268
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
* Boost <http://www.boost.org/LICENSE_1_0.txt>
|
|
272
|
-
|
|
273
|
-
Boost Software License - Version 1.0 - August 17th, 2003
|
|
274
|
-
|
|
275
|
-
Permission is hereby granted, free of charge, to any person or organization
|
|
276
|
-
obtaining a copy of the software and accompanying documentation covered by
|
|
277
|
-
this license (the "Software") to use, reproduce, display, distribute,
|
|
278
|
-
execute, and transmit the Software, and to prepare derivative works of the
|
|
279
|
-
Software, and to permit third-parties to whom the Software is furnished to
|
|
280
|
-
do so, all subject to the following:
|
|
281
|
-
|
|
282
|
-
The copyright notices in the Software and this entire statement, including
|
|
283
|
-
the above license grant, this restriction and the following disclaimer,
|
|
284
|
-
must be included in all copies of the Software, in whole or in part, and
|
|
285
|
-
all derivative works of the Software, unless such copies or derivative
|
|
286
|
-
works are solely in the form of machine-executable object code generated by
|
|
287
|
-
a source language processor.
|
|
288
|
-
|
|
289
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
290
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
291
|
-
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
|
292
|
-
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
|
293
|
-
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
|
294
|
-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
295
|
-
DEALINGS IN THE SOFTWARE.
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
* Cephes <http://www.netlib.org/cephes/readme>
|
|
299
|
-
|
|
300
|
-
Copyright (c) 1984-2000 Stephen L. Moshier
|
|
301
|
-
|
|
302
|
-
Some software in this archive may be from the book _Methods and Programs for
|
|
303
|
-
Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989)
|
|
304
|
-
or from the Cephes Mathematical Library, a commercial product. In either event,
|
|
305
|
-
it is copyrighted by the author. What you see here may be used freely but it
|
|
306
|
-
comes with no support or guarantee.
|
|
307
|
-
|
|
308
|
-
Stephen L. Moshier
|
|
309
|
-
moshier@na-net.ornl.gov
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
ATTRIBUTION
|
|
314
|
-
|
|
315
|
-
The library contains implementations from the following external libraries,
|
|
316
|
-
which have their own licenses:
|
|
317
|
-
|
|
318
|
-
* FreeBSD <https://svnweb.freebsd.org/>
|
|
319
|
-
|
|
320
|
-
Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved.
|
|
321
|
-
|
|
322
|
-
Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
323
|
-
Permission to use, copy, modify, and distribute this
|
|
324
|
-
software is freely granted, provided that this notice
|
|
325
|
-
is preserved.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
* FDLIBM <http://www.netlib.org/fdlibm/>
|
|
329
|
-
|
|
330
|
-
Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
|
|
331
|
-
|
|
332
|
-
Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
333
|
-
Permission to use, copy, modify, and distribute this
|
|
334
|
-
software is freely granted, provided that this notice
|
|
335
|
-
is preserved.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
* Go <https://raw.githubusercontent.com/golang/go/master/LICENSE>
|
|
339
|
-
|
|
340
|
-
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
341
|
-
|
|
342
|
-
Redistribution and use in source and binary forms, with or without
|
|
343
|
-
modification, are permitted provided that the following conditions are
|
|
344
|
-
met:
|
|
345
|
-
|
|
346
|
-
* Redistributions of source code must retain the above copyright
|
|
347
|
-
notice, this list of conditions and the following disclaimer.
|
|
348
|
-
* Redistributions in binary form must reproduce the above
|
|
349
|
-
copyright notice, this list of conditions and the following disclaimer
|
|
350
|
-
in the documentation and/or other materials provided with the
|
|
351
|
-
distribution.
|
|
352
|
-
* Neither the name of Google Inc. nor the names of its
|
|
353
|
-
contributors may be used to endorse or promote products derived from
|
|
354
|
-
this software without specific prior written permission.
|
|
355
|
-
|
|
356
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
357
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
358
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
359
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
360
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
361
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
362
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
363
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
364
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
365
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
366
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
* SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>
|
|
370
|
-
|
|
371
|
-
Public domain.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
* ESLint <https://raw.githubusercontent.com/eslint/eslint/master/LICENSE>
|
|
375
|
-
|
|
376
|
-
Copyright JS Foundation and other contributors, https://js.foundation
|
|
377
|
-
|
|
378
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
379
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
380
|
-
in the Software without restriction, including without limitation the rights
|
|
381
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
382
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
383
|
-
furnished to do so, subject to the following conditions:
|
|
384
|
-
|
|
385
|
-
The above copyright notice and this permission notice shall be included in
|
|
386
|
-
all copies or substantial portions of the Software.
|
|
387
|
-
|
|
388
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
389
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
390
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
391
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
392
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
393
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
394
|
-
THE SOFTWARE.
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
* StatsFuns.jl <https://raw.githubusercontent.com/JuliaStats/StatsFuns.jl/
|
|
398
|
-
e66dd973650c375bc1739c820e5b96bb5bd000a8/LICENSE.md>
|
|
399
|
-
|
|
400
|
-
Copyright (c) 2015: Dahua Lin.
|
|
401
|
-
|
|
402
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
403
|
-
a copy of this software and associated documentation files (the
|
|
404
|
-
"Software"), to deal in the Software without restriction, including
|
|
405
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
406
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
407
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
408
|
-
the following conditions:
|
|
409
|
-
|
|
410
|
-
The above copyright notice and this permission notice shall be
|
|
411
|
-
included in all copies or substantial portions of the Software.
|
|
412
|
-
|
|
413
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
414
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
415
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
416
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
417
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
418
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
419
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
* SpecialFunctions.jl <https://raw.githubusercontent.com/JuliaMath/
|
|
423
|
-
SpecialFunctions.jl/02a173fbe24a61c4b392aec17a9764ac5727feb1/LICENSE>
|
|
424
|
-
|
|
425
|
-
The MIT License (MIT)
|
|
426
|
-
|
|
427
|
-
Copyright (c) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others:
|
|
428
|
-
|
|
429
|
-
https://github.com/JuliaMath/SpecialFunctions.jl/graphs/contributors
|
|
430
|
-
|
|
431
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
432
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
433
|
-
in the Software without restriction, including without limitation the rights
|
|
434
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
435
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
436
|
-
furnished to do so, subject to the following conditions:
|
|
437
|
-
|
|
438
|
-
The above copyright notice and this permission notice shall be included in all
|
|
439
|
-
copies or substantial portions of the Software.
|
|
440
|
-
|
|
441
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
442
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
443
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
444
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
445
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
446
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
447
|
-
SOFTWARE.
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
* MT19937 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/
|
|
451
|
-
mt19937ar.c>
|
|
452
|
-
|
|
453
|
-
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
|
|
454
|
-
All rights reserved.
|
|
455
|
-
|
|
456
|
-
Redistribution and use in source and binary forms, with or without
|
|
457
|
-
modification, are permitted provided that the following conditions
|
|
458
|
-
are met:
|
|
459
|
-
|
|
460
|
-
1. Redistributions of source code must retain the above copyright
|
|
461
|
-
notice, this list of conditions and the following disclaimer.
|
|
462
|
-
|
|
463
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
464
|
-
notice, this list of conditions and the following disclaimer in the
|
|
465
|
-
documentation and/or other materials provided with the distribution.
|
|
466
|
-
|
|
467
|
-
3. The names of its contributors may not be used to endorse or promote
|
|
468
|
-
products derived from this software without specific prior written
|
|
469
|
-
permission.
|
|
470
|
-
|
|
471
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
472
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
473
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
474
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
475
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
476
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
477
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
478
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
479
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
480
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
481
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2023 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -18,6 +18,17 @@ limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
-->
|
|
20
20
|
|
|
21
|
+
|
|
22
|
+
<details>
|
|
23
|
+
<summary>
|
|
24
|
+
About stdlib...
|
|
25
|
+
</summary>
|
|
26
|
+
<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>
|
|
27
|
+
<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>
|
|
28
|
+
<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>
|
|
29
|
+
<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>
|
|
30
|
+
</details>
|
|
31
|
+
|
|
21
32
|
# Complex64Array
|
|
22
33
|
|
|
23
34
|
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
@@ -963,11 +974,12 @@ A few notes:
|
|
|
963
974
|
```javascript
|
|
964
975
|
var Complex64 = require( '@stdlib/complex-float32' );
|
|
965
976
|
var Float32Array = require( '@stdlib/array-float32' );
|
|
977
|
+
var logEach = require( '@stdlib/console-log-each' );
|
|
966
978
|
var Complex64Array = require( '@stdlib/array-complex64' );
|
|
967
979
|
|
|
968
980
|
// Create a complex array by specifying a length:
|
|
969
981
|
var out = new Complex64Array( 3 );
|
|
970
|
-
|
|
982
|
+
logEach( '%s', out );
|
|
971
983
|
|
|
972
984
|
// Create a complex array from an array of complex numbers:
|
|
973
985
|
var arr = [
|
|
@@ -976,22 +988,22 @@ var arr = [
|
|
|
976
988
|
new Complex64( 0.5, 0.5 )
|
|
977
989
|
];
|
|
978
990
|
out = new Complex64Array( arr );
|
|
979
|
-
|
|
991
|
+
logEach( '%s', out );
|
|
980
992
|
|
|
981
993
|
// Create a complex array from an interleaved typed array:
|
|
982
994
|
arr = new Float32Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] );
|
|
983
995
|
out = new Complex64Array( arr );
|
|
984
|
-
|
|
996
|
+
logEach( '%s', out );
|
|
985
997
|
|
|
986
998
|
// Create a complex array from an array buffer:
|
|
987
999
|
arr = new Float32Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] );
|
|
988
1000
|
out = new Complex64Array( arr.buffer );
|
|
989
|
-
|
|
1001
|
+
logEach( '%s', out );
|
|
990
1002
|
|
|
991
1003
|
// Create a complex array from an array buffer view:
|
|
992
1004
|
arr = new Float32Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] );
|
|
993
1005
|
out = new Complex64Array( arr.buffer, 8, 2 );
|
|
994
|
-
|
|
1006
|
+
logEach( '%s', out );
|
|
995
1007
|
```
|
|
996
1008
|
|
|
997
1009
|
</section>
|
|
@@ -1014,9 +1026,9 @@ console.log( out );
|
|
|
1014
1026
|
|
|
1015
1027
|
## See Also
|
|
1016
1028
|
|
|
1017
|
-
- <span class="package-name">[`@stdlib/array
|
|
1018
|
-
- <span class="package-name">[`@stdlib/complex
|
|
1019
|
-
- <span class="package-name">[`@stdlib/complex
|
|
1029
|
+
- <span class="package-name">[`@stdlib/array-complex128`][@stdlib/array/complex128]</span><span class="delimiter">: </span><span class="description">Complex128Array.</span>
|
|
1030
|
+
- <span class="package-name">[`@stdlib/complex-cmplx`][@stdlib/complex/cmplx]</span><span class="delimiter">: </span><span class="description">create a complex number.</span>
|
|
1031
|
+
- <span class="package-name">[`@stdlib/complex-float32`][@stdlib/complex/float32]</span><span class="delimiter">: </span><span class="description">64-bit complex number.</span>
|
|
1020
1032
|
|
|
1021
1033
|
</section>
|
|
1022
1034
|
|
|
@@ -1048,7 +1060,7 @@ See [LICENSE][stdlib-license].
|
|
|
1048
1060
|
|
|
1049
1061
|
## Copyright
|
|
1050
1062
|
|
|
1051
|
-
Copyright © 2016-
|
|
1063
|
+
Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
1052
1064
|
|
|
1053
1065
|
</section>
|
|
1054
1066
|
|
|
@@ -1061,8 +1073,8 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
1061
1073
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-complex64.svg
|
|
1062
1074
|
[npm-url]: https://npmjs.org/package/@stdlib/array-complex64
|
|
1063
1075
|
|
|
1064
|
-
[test-image]: https://github.com/stdlib-js/array-complex64/actions/workflows/test.yml/badge.svg
|
|
1065
|
-
[test-url]: https://github.com/stdlib-js/array-complex64/actions/workflows/test.yml
|
|
1076
|
+
[test-image]: https://github.com/stdlib-js/array-complex64/actions/workflows/test.yml/badge.svg?branch=v0.1.0
|
|
1077
|
+
[test-url]: https://github.com/stdlib-js/array-complex64/actions/workflows/test.yml?query=branch:v0.1.0
|
|
1066
1078
|
|
|
1067
1079
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-complex64/main.svg
|
|
1068
1080
|
[coverage-url]: https://codecov.io/github/stdlib-js/array-complex64?branch=main
|
|
@@ -1074,19 +1086,20 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
1074
1086
|
|
|
1075
1087
|
-->
|
|
1076
1088
|
|
|
1089
|
+
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
1090
|
+
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
|
|
1091
|
+
|
|
1092
|
+
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
1093
|
+
|
|
1094
|
+
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
1095
|
+
|
|
1077
1096
|
[umd]: https://github.com/umdjs/umd
|
|
1078
1097
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
1079
1098
|
|
|
1080
1099
|
[deno-url]: https://github.com/stdlib-js/array-complex64/tree/deno
|
|
1081
1100
|
[umd-url]: https://github.com/stdlib-js/array-complex64/tree/umd
|
|
1082
1101
|
[esm-url]: https://github.com/stdlib-js/array-complex64/tree/esm
|
|
1083
|
-
|
|
1084
|
-
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
1085
|
-
[chat-url]: https://gitter.im/stdlib-js/stdlib/
|
|
1086
|
-
|
|
1087
|
-
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
1088
|
-
|
|
1089
|
-
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
1102
|
+
[branches-url]: https://github.com/stdlib-js/array-complex64/blob/main/branches.md
|
|
1090
1103
|
|
|
1091
1104
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-complex64/main/LICENSE
|
|
1092
1105
|
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";var q=function(n,t){return function(){return t||n((t={exports:{}}).exports,t),t.exports}};var C=q(function(Er,B){"use strict";var D=require("@stdlib/assert-is-array-like-object"),J=require("@stdlib/assert-is-complex-like"),K=require("@stdlib/complex-realf"),Q=require("@stdlib/complex-imagf"),U=require("@stdlib/string-format");function X(n){var t,r,e;for(t=[];r=n.next(),!r.done;)if(e=r.value,D(e)&&e.length>=2)t.push(e[0],e[1]);else if(J(e))t.push(K(e),Q(e));else return new TypeError(U("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",e));return t}B.exports=X});var O=q(function(dr,V){"use strict";var Z=require("@stdlib/assert-is-array-like-object"),$=require("@stdlib/assert-is-complex-like"),rr=require("@stdlib/complex-realf"),er=require("@stdlib/complex-imagf"),tr=require("@stdlib/string-format");function nr(n,t,r){var e,o,i,u;for(e=[],u=-1;o=n.next(),!o.done;)if(u+=1,i=t.call(r,o.value,u),Z(i)&&i.length>=2)e.push(i[0],i[1]);else if($(i))e.push(rr(i),er(i));else return new TypeError(tr("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));return e}V.exports=nr});var S=q(function(Tr,M){"use strict";var ar=require("@stdlib/assert-is-complex-like"),ir=require("@stdlib/complex-realf"),or=require("@stdlib/complex-imagf");function ur(n,t){var r,e,o,i;for(r=t.length,i=0,o=0;o<r;o++){if(e=t[o],!ar(e))return null;n[i]=ir(e),n[i+1]=or(e),i+=2}return n}M.exports=ur});var H=q(function(_r,G){"use strict";var _=require("@stdlib/assert-is-nonnegative-integer").isPrimitive,I=require("@stdlib/assert-is-array-like-object"),j=require("@stdlib/assert-is-collection"),N=require("@stdlib/assert-is-arraybuffer"),Y=require("@stdlib/assert-is-object"),fr=require("@stdlib/assert-is-array"),b=require("@stdlib/assert-is-function"),E=require("@stdlib/assert-is-complex-like"),x=require("@stdlib/math-base-assert-is-even"),R=require("@stdlib/math-base-assert-is-integer"),sr=require("@stdlib/assert-has-iterator-symbol-support"),d=require("@stdlib/symbol-iterator"),v=require("@stdlib/utils-define-nonenumerable-read-only-property"),k=require("@stdlib/utils-define-nonenumerable-read-only-accessor"),c=require("@stdlib/array-float32"),F=require("@stdlib/complex-float32"),l=require("@stdlib/string-format"),A=require("@stdlib/complex-realf"),L=require("@stdlib/complex-imagf"),lr=require("@stdlib/strided-base-reinterpret-complex64"),mr=require("@stdlib/strided-base-reinterpret-complex128"),gr=require("@stdlib/array-base-getter"),hr=require("@stdlib/array-base-accessor-getter"),P=C(),vr=O(),yr=S(),y=c.BYTES_PER_ELEMENT*2,W=sr();function T(n){return n instanceof g||typeof n=="object"&&n!==null&&(n.constructor.name==="Complex64Array"||n.constructor.name==="Complex128Array")&&typeof n._length=="number"&&typeof n._buffer=="object"}function z(n){return n===g||n.name==="Complex128Array"}function pr(n){return typeof n=="object"&&n!==null&&n.constructor.name==="Complex64Array"&&n.BYTES_PER_ELEMENT===y}function cr(n){return typeof n=="object"&&n!==null&&n.constructor.name==="Complex128Array"&&n.BYTES_PER_ELEMENT===y*2}function g(){var n,t,r,e;if(t=arguments.length,!(this instanceof g))return t===0?new g:t===1?new g(arguments[0]):t===2?new g(arguments[0],arguments[1]):new g(arguments[0],arguments[1],arguments[2]);if(t===0)r=new c(0);else if(t===1)if(_(arguments[0]))r=new c(arguments[0]*2);else if(j(arguments[0]))if(r=arguments[0],e=r.length,e&&fr(r)&&E(r[0])){if(r=yr(new c(e*2),r),r===null){if(!x(e))throw new RangeError(l("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",e));r=new c(arguments[0])}}else{if(pr(r))r=lr(r,0);else if(cr(r))r=mr(r,0);else if(!x(e))throw new RangeError(l("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",e));r=new c(r)}else if(N(arguments[0])){if(r=arguments[0],!R(r.byteLength/y))throw new RangeError(l("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",y,r.byteLength));r=new c(r)}else if(Y(arguments[0])){if(r=arguments[0],W===!1)throw new TypeError(l("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",r));if(!b(r[d]))throw new TypeError(l("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=r[d](),!b(r.next))throw new TypeError(l("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=P(r),r instanceof Error)throw r;r=new c(r)}else throw new TypeError(l("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));else{if(r=arguments[0],!N(r))throw new TypeError(l("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",r));if(n=arguments[1],!_(n))throw new TypeError(l("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",n));if(!R(n/y))throw new RangeError(l("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",y,n));if(t===2){if(e=r.byteLength-n,!R(e/y))throw new RangeError(l("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",y,e));r=new c(r,n)}else{if(e=arguments[2],!_(e))throw new TypeError(l("invalid argument. Length must be a nonnegative integer. Value: `%s`.",e));if(e*y>r.byteLength-n)throw new RangeError(l("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",e*y));r=new c(r,n,e*2)}}return v(this,"_buffer",r),v(this,"_length",r.length/2),this}v(g,"BYTES_PER_ELEMENT",y);v(g,"name","Complex64Array");v(g,"from",function(t){var r,e,o,i,u,f,w,a,h,m,s,p;if(!b(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(e=arguments.length,e>1){if(o=arguments[1],!b(o))throw new TypeError(l("invalid argument. Second argument must be a function. Value: `%s`.",o));e>2&&(r=arguments[2])}if(T(t)){if(a=t.length,o){for(i=new this(a),u=i._buffer,p=0,s=0;s<a;s++){if(m=o.call(r,t.get(s),s),E(m))u[p]=A(m),u[p+1]=L(m);else if(I(m)&&m.length>=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(l("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return i}return new this(t)}if(j(t)){if(o){for(a=t.length,t.get&&t.set?w=hr("default"):w=gr("default"),s=0;s<a;s++)if(!E(w(t,s))){h=!0;break}if(h){if(!x(a))throw new RangeError(l("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,a));for(i=new this(a/2),u=i._buffer,s=0;s<a;s++)u[s]=o.call(r,w(t,s),s);return i}for(i=new this(a),u=i._buffer,p=0,s=0;s<a;s++){if(m=o.call(r,w(t,s),s),E(m))u[p]=A(m),u[p+1]=L(m);else if(I(m)&&m.length>=2)u[p]=m[0],u[p+1]=m[1];else throw new TypeError(l("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",m));p+=2}return i}return new this(t)}if(Y(t)&&W&&b(t[d])){if(u=t[d](),!b(u.next))throw new TypeError(l("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(o?f=vr(u,o,r):f=P(u),f instanceof Error)throw f;for(a=f.length/2,i=new this(a),u=i._buffer,s=0;s<a;s++)u[s]=f[s];return i}throw new TypeError(l("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))});v(g,"of",function(){var t,r;if(!b(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!z(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);return new this(t)});k(g.prototype,"buffer",function(){return this._buffer.buffer});k(g.prototype,"byteLength",function(){return this._buffer.byteLength});k(g.prototype,"byteOffset",function(){return this._buffer.byteOffset});v(g.prototype,"BYTES_PER_ELEMENT",g.BYTES_PER_ELEMENT);v(g.prototype,"copyWithin",function(t,r){if(!T(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(t*2,r*2):this._buffer.copyWithin(t*2,r*2,arguments[2]*2),this});v(g.prototype,"entries",function(){var t,r,e,o,i,u,f;if(!T(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._buffer,o=this._length,u=-1,f=-2,e={},v(e,"next",w),v(e,"return",a),d&&v(e,d,h),e;function w(){var m;return u+=1,i||u>=o?{done:!0}:(f+=2,m=new F(t[f],t[f+1]),{value:[u,m],done:!1})}function a(m){return i=!0,arguments.length?{value:m,done:!0}:{done:!0}}function h(){return r.entries()}});v(g.prototype,"get",function(t){var r;if(!T(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_(t))throw new TypeError(l("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return r=this._buffer,t*=2,new F(r[t],r[t+1])});k(g.prototype,"length",function(){return this._length});v(g.prototype,"set",function(t){var r,e,o,i,u,f,w,a,h;if(!T(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(o=this._buffer,arguments.length>1){if(e=arguments[1],!_(e))throw new TypeError(l("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(E(t)){if(e>=this._length)throw new RangeError(l("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));e*=2,o[e]=A(t),o[e+1]=L(t);return}if(T(t)){if(f=t._length,e+f>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,h=o.byteOffset+e*y,r.buffer===o.buffer&&r.byteOffset<h&&r.byteOffset+r.byteLength>h){for(i=new c(r.length),a=0;a<r.length;a++)i[a]=r[a];r=i}for(e*=2,h=0,a=0;a<f;a++)o[e]=r[h],o[e+1]=r[h+1],e+=2,h+=2;return}if(j(t)){for(f=t.length,a=0;a<f;a++)if(!E(t[a])){u=!0;break}if(u){if(!x(f))throw new RangeError(l("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",f));if(e+f/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,h=o.byteOffset+e*y,r.buffer===o.buffer&&r.byteOffset<h&&r.byteOffset+r.byteLength>h){for(i=new c(f),a=0;a<f;a++)i[a]=r[a];r=i}for(e*=2,f/=2,h=0,a=0;a<f;a++)o[e]=r[h],o[e+1]=r[h+1],e+=2,h+=2;return}if(e+f>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,a=0;a<f;a++)w=t[a],o[e]=A(w),o[e+1]=L(w),e+=2;return}throw new TypeError(l("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",t))});G.exports=g});var wr=H();module.exports=wr;
|
|
2
|
+
/**
|
|
3
|
+
* @license Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2018 The Stdlib Authors.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../lib/from_iterator.js", "../lib/from_iterator_map.js", "../lib/from_array.js", "../lib/main.js", "../lib/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar realf = require( '@stdlib/complex-realf' );\nvar imagf = require( '@stdlib/complex-imagf' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar realf = require( '@stdlib/complex-realf' );\nvar imagf = require( '@stdlib/complex-imagf' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar realf = require( '@stdlib/complex-realf' );\nvar imagf = require( '@stdlib/complex-imagf' );\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float32Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float32Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = realf( v );\n\t\tbuf[ j+1 ] = imagf( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromArray;\n", "/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' );\nvar isObject = require( '@stdlib/assert-is-object' );\nvar isArray = require( '@stdlib/assert-is-array' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar isEven = require( '@stdlib/math-base-assert-is-even' );\nvar isInteger = require( '@stdlib/math-base-assert-is-integer' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert-has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' );\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' );\nvar Float32Array = require( '@stdlib/array-float32' );\nvar Complex64 = require( '@stdlib/complex-float32' );\nvar format = require( '@stdlib/string-format' );\nvar realf = require( '@stdlib/complex-realf' );\nvar imagf = require( '@stdlib/complex-imagf' );\nvar reinterpret64 = require( '@stdlib/strided-base-reinterpret-complex64' );\nvar reinterpret128 = require( '@stdlib/strided-base-reinterpret-complex128' );\nvar getter = require( '@stdlib/array-base-getter' );\nvar accessorGetter = require( '@stdlib/array-base-accessor-getter' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\nvar fromArray = require( './from_array.js' );\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex64Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex64Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex128Array...\n\t\tvalue.name === 'Complex128Array'\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*/\nfunction isComplex64Array( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*/\nfunction isComplex128Array( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT*2\n\t);\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32' );\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32' );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n*\n* function clbk( v ) {\n* return new Complex64( realf(v)*2.0, imagf(v)*2.0 );\n* }\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 64-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex64Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns <ArrayBuffer>\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} modified array\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32' );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n*\n* var arr = new Complex64Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex64( 1.0, 1.0 ), 0 );\n* arr.set( new Complex64( 2.0, 2.0 ), 1 );\n* arr.set( new Complex64( 3.0, 3.0 ), 2 );\n* arr.set( new Complex64( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32' );\n*\n* var arr = [\n* new Complex64( 1.0, 1.0 ),\n* new Complex64( 2.0, 2.0 ),\n* new Complex64( 3.0, 3.0 )\n* ];\n* arr = new Complex64Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, <Complex64> ]\n*\n* v = it.next().value;\n* // returns [ 1, <Complex64> ]\n*\n* v = it.next().value;\n* // returns [ 2, <Complex64> ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex64( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n*\n* var z = arr.get( 0 );\n* // returns <Complex64>\n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns <Complex64>\n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tvar buf;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\tbuf = this._buffer;\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n*\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns <Complex64>\n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns <Complex64>\n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n\n// EXPORTS //\n\nmodule.exports = Complex64Array;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* 64-bit complex number array.\n*\n* @module @stdlib/array-complex64\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n*\n* var arr = new Complex64Array();\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n*\n* var arr = new Complex64Array( 2 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n*\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Complex64Array = require( '@stdlib/array-complex64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Complex64Array = require( '@stdlib/array-complex64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Complex64Array = require( '@stdlib/array-complex64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,EAAoB,QAAS,qCAAsC,EACnEC,EAAgB,QAAS,gCAAiC,EAC1DC,EAAQ,QAAS,uBAAwB,EACzCC,EAAQ,QAAS,uBAAwB,EACzCC,EAAS,QAAS,uBAAwB,EAY9C,SAASC,EAAcC,EAAK,CAC3B,IAAIC,EACAC,EACAC,EAGJ,IADAF,EAAM,CAAC,EAENC,EAAIF,EAAG,KAAK,EACP,CAAAE,EAAE,MAIP,GADAC,EAAID,EAAE,MACDR,EAAmBS,CAAE,GAAKA,EAAE,QAAU,EAC1CF,EAAI,KAAME,EAAG,CAAE,EAAGA,EAAG,CAAE,CAAE,UACdR,EAAeQ,CAAE,EAC5BF,EAAI,KA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Aab,GAClBa,EAAK,WAAWA,EAAK,WAAab,EAElC,CAGD,IADAL,EAAM,IAAI5B,EAAc+C,CAAE,EACpBf,EAAI,EAAGA,EAAIe,EAAGf,IACnBJ,EAAKI,CAAE,EAAIc,EAAMd,CAAE,EAEpBc,EAAOlB,CACR,CAIA,IAHAiB,GAAO,EACPE,GAAK,EACLd,EAAI,EACED,EAAI,EAAGA,EAAIe,EAAGf,IACnBV,EAAKuB,CAAI,EAAIC,EAAMb,CAAE,EACrBX,EAAKuB,EAAI,CAAE,EAAIC,EAAMb,EAAE,CAAE,EACzBY,GAAO,EACPZ,GAAK,EAEN,MACD,CAEA,GAAKY,EAAIE,EAAI,KAAK,QACjB,MAAM,IAAI,WAAY,wFAAyF,EAGhH,IADAF,GAAO,EACDb,EAAI,EAAGA,EAAIe,EAAGf,IACnBD,EAAIhB,EAAOiB,CAAE,EACbV,EAAKuB,CAAI,EAAI1C,EAAO4B,CAAE,EACtBT,EAAKuB,EAAI,CAAE,EAAIzC,EAAO2B,CAAE,EACxBc,GAAO,EAER,MACD,CACA,MAAM,IAAI,UAAW3C,EAAQ,kIAAmIa,CAAM,CAAE,CAGzK,CAAC,EAKD9B,EAAO,QAAU+B,IC58BjB,IAAIgC,GAAO,IAKX,OAAO,QAAUA",
|
|
6
|
+
"names": ["require_from_iterator", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isComplexLike", "realf", "imagf", "format", "fromIterator", "it", "out", "v", "z", "require_from_iterator_map", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isComplexLike", "realf", "imagf", "format", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "z", "i", "require_from_array", "__commonJSMin", "exports", "module", "isComplexLike", "realf", "imagf", "fromArray", "buf", "arr", "len", "v", "i", "j", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isArrayLikeObject", "isCollection", "isArrayBuffer", "isObject", "isArray", "isFunction", "isComplexLike", "isEven", "isInteger", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "setReadOnlyAccessor", "Float32Array", "Complex64", "format", "realf", "imagf", "reinterpret64", "reinterpret128", "getter", "accessorGetter", "fromIterator", "fromIteratorMap", "fromArray", "BYTES_PER_ELEMENT", "HAS_ITERATOR_SYMBOL", "isComplexArray", "value", "Complex64Array", "isComplexArrayConstructor", "isComplex64Array", "isComplex128Array", "byteOffset", "nargs", "buf", "len", "src", "thisArg", "clbk", "out", "tmp", "get", "flg", "v", "i", "j", "args", "target", "start", "buffer", "self", "iter", "FLG", "next", "end", "factory", "z", "idx", "sbuf", "N", "main"]
|
|
7
|
+
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
// TypeScript Version:
|
|
19
|
+
// TypeScript Version: 4.1
|
|
20
20
|
|
|
21
21
|
/// <reference types="@stdlib/types"/>
|
|
22
22
|
|
|
23
23
|
import { Iterator as Iter, IterableIterator } from '@stdlib/types/iter';
|
|
24
24
|
import { ArrayLike, RealOrComplexTypedArray, Complex64Array as Complex64ArrayInterface } from '@stdlib/types/array';
|
|
25
|
-
import { ComplexLike, Complex64 } from '@stdlib/types/
|
|
25
|
+
import { ComplexLike, Complex64 } from '@stdlib/types/complex';
|
|
26
26
|
import ArrayBuffer = require( '@stdlib/array-buffer' );
|
|
27
27
|
|
|
28
28
|
// Define a union type representing both iterable and non-iterable iterators:
|
package/lib/from_iterator.js
CHANGED
|
@@ -24,6 +24,7 @@ var isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );
|
|
|
24
24
|
var isComplexLike = require( '@stdlib/assert-is-complex-like' );
|
|
25
25
|
var realf = require( '@stdlib/complex-realf' );
|
|
26
26
|
var imagf = require( '@stdlib/complex-imagf' );
|
|
27
|
+
var format = require( '@stdlib/string-format' );
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
// MAIN //
|
|
@@ -52,7 +53,7 @@ function fromIterator( it ) {
|
|
|
52
53
|
} else if ( isComplexLike( z ) ) {
|
|
53
54
|
out.push( realf( z ), imagf( z ) );
|
|
54
55
|
} else {
|
|
55
|
-
return new TypeError( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value:
|
|
56
|
+
return new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
return out;
|
package/lib/from_iterator_map.js
CHANGED
|
@@ -24,6 +24,7 @@ var isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );
|
|
|
24
24
|
var isComplexLike = require( '@stdlib/assert-is-complex-like' );
|
|
25
25
|
var realf = require( '@stdlib/complex-realf' );
|
|
26
26
|
var imagf = require( '@stdlib/complex-imagf' );
|
|
27
|
+
var format = require( '@stdlib/string-format' );
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
// MAIN //
|
|
@@ -57,7 +58,7 @@ function fromIteratorMap( it, clbk, thisArg ) {
|
|
|
57
58
|
} else if ( isComplexLike( z ) ) {
|
|
58
59
|
out.push( realf( z ), imagf( z ) );
|
|
59
60
|
} else {
|
|
60
|
-
return new TypeError( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value:
|
|
61
|
+
return new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
return out;
|
package/lib/main.js
CHANGED
|
@@ -38,11 +38,13 @@ var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-propert
|
|
|
38
38
|
var setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' );
|
|
39
39
|
var Float32Array = require( '@stdlib/array-float32' );
|
|
40
40
|
var Complex64 = require( '@stdlib/complex-float32' );
|
|
41
|
+
var format = require( '@stdlib/string-format' );
|
|
41
42
|
var realf = require( '@stdlib/complex-realf' );
|
|
42
43
|
var imagf = require( '@stdlib/complex-imagf' );
|
|
43
44
|
var reinterpret64 = require( '@stdlib/strided-base-reinterpret-complex64' );
|
|
44
45
|
var reinterpret128 = require( '@stdlib/strided-base-reinterpret-complex128' );
|
|
45
|
-
var
|
|
46
|
+
var getter = require( '@stdlib/array-base-getter' );
|
|
47
|
+
var accessorGetter = require( '@stdlib/array-base-accessor-getter' );
|
|
46
48
|
var fromIterator = require( './from_iterator.js' );
|
|
47
49
|
var fromIteratorMap = require( './from_iterator_map.js' );
|
|
48
50
|
var fromArray = require( './from_array.js' );
|
|
@@ -235,7 +237,7 @@ function Complex64Array() {
|
|
|
235
237
|
if ( buf === null ) {
|
|
236
238
|
// We failed and we are now forced to allocate a new array :-(
|
|
237
239
|
if ( !isEven( len ) ) {
|
|
238
|
-
throw new RangeError( 'invalid argument. Array-like object
|
|
240
|
+
throw new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );
|
|
239
241
|
}
|
|
240
242
|
// We failed, so fall back to directly setting values...
|
|
241
243
|
buf = new Float32Array( arguments[0] );
|
|
@@ -246,27 +248,27 @@ function Complex64Array() {
|
|
|
246
248
|
} else if ( isComplex128Array( buf ) ) {
|
|
247
249
|
buf = reinterpret128( buf, 0 );
|
|
248
250
|
} else if ( !isEven( len ) ) {
|
|
249
|
-
throw new RangeError( 'invalid argument. Array-like object and typed array
|
|
251
|
+
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 ) );
|
|
250
252
|
}
|
|
251
253
|
buf = new Float32Array( buf );
|
|
252
254
|
}
|
|
253
255
|
} else if ( isArrayBuffer( arguments[0] ) ) {
|
|
254
256
|
buf = arguments[ 0 ];
|
|
255
257
|
if ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {
|
|
256
|
-
throw new RangeError( 'invalid argument. ArrayBuffer byte length must be a multiple of
|
|
258
|
+
throw new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );
|
|
257
259
|
}
|
|
258
260
|
buf = new Float32Array( buf );
|
|
259
261
|
} else if ( isObject( arguments[0] ) ) {
|
|
260
262
|
buf = arguments[ 0 ];
|
|
261
263
|
if ( HAS_ITERATOR_SYMBOL === false ) {
|
|
262
|
-
throw new TypeError( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value:
|
|
264
|
+
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 ) );
|
|
263
265
|
}
|
|
264
266
|
if ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {
|
|
265
|
-
throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value:
|
|
267
|
+
throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );
|
|
266
268
|
}
|
|
267
269
|
buf = buf[ ITERATOR_SYMBOL ]();
|
|
268
270
|
if ( !isFunction( buf.next ) ) {
|
|
269
|
-
throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable.' );
|
|
271
|
+
throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );
|
|
270
272
|
}
|
|
271
273
|
buf = fromIterator( buf );
|
|
272
274
|
if ( buf instanceof Error ) {
|
|
@@ -274,33 +276,33 @@ function Complex64Array() {
|
|
|
274
276
|
}
|
|
275
277
|
buf = new Float32Array( buf );
|
|
276
278
|
} else {
|
|
277
|
-
throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value:
|
|
279
|
+
throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );
|
|
278
280
|
}
|
|
279
281
|
} else {
|
|
280
282
|
buf = arguments[ 0 ];
|
|
281
283
|
if ( !isArrayBuffer( buf ) ) {
|
|
282
|
-
throw new TypeError( 'invalid argument. First argument must be an
|
|
284
|
+
throw new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );
|
|
283
285
|
}
|
|
284
286
|
byteOffset = arguments[ 1 ];
|
|
285
287
|
if ( !isNonNegativeInteger( byteOffset ) ) {
|
|
286
|
-
throw new TypeError( 'invalid argument. Byte offset must be a nonnegative integer. Value:
|
|
288
|
+
throw new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );
|
|
287
289
|
}
|
|
288
290
|
if ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {
|
|
289
|
-
throw new RangeError( 'invalid argument. Byte offset must be a multiple of
|
|
291
|
+
throw new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );
|
|
290
292
|
}
|
|
291
293
|
if ( nargs === 2 ) {
|
|
292
294
|
len = buf.byteLength - byteOffset;
|
|
293
295
|
if ( !isInteger( len/BYTES_PER_ELEMENT ) ) {
|
|
294
|
-
throw new RangeError( 'invalid arguments. ArrayBuffer view byte length must be a multiple of
|
|
296
|
+
throw new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );
|
|
295
297
|
}
|
|
296
298
|
buf = new Float32Array( buf, byteOffset );
|
|
297
299
|
} else {
|
|
298
300
|
len = arguments[ 2 ];
|
|
299
301
|
if ( !isNonNegativeInteger( len ) ) {
|
|
300
|
-
throw new TypeError( 'invalid argument. Length must be a nonnegative integer. Value:
|
|
302
|
+
throw new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );
|
|
301
303
|
}
|
|
302
304
|
if ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {
|
|
303
|
-
throw new RangeError( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity:
|
|
305
|
+
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 ) );
|
|
304
306
|
}
|
|
305
307
|
buf = new Float32Array( buf, byteOffset, len*2 );
|
|
306
308
|
}
|
|
@@ -397,6 +399,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
|
|
|
397
399
|
var out;
|
|
398
400
|
var buf;
|
|
399
401
|
var tmp;
|
|
402
|
+
var get;
|
|
400
403
|
var len;
|
|
401
404
|
var flg;
|
|
402
405
|
var v;
|
|
@@ -412,7 +415,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
|
|
|
412
415
|
if ( nargs > 1 ) {
|
|
413
416
|
clbk = arguments[ 1 ];
|
|
414
417
|
if ( !isFunction( clbk ) ) {
|
|
415
|
-
throw new TypeError( 'invalid argument. Second argument must be a function. Value:
|
|
418
|
+
throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );
|
|
416
419
|
}
|
|
417
420
|
if ( nargs > 2 ) {
|
|
418
421
|
thisArg = arguments[ 2 ];
|
|
@@ -433,7 +436,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
|
|
|
433
436
|
buf[ j ] = v[ 0 ];
|
|
434
437
|
buf[ j+1 ] = v[ 1 ];
|
|
435
438
|
} else {
|
|
436
|
-
throw new TypeError( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value:
|
|
439
|
+
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 ) );
|
|
437
440
|
}
|
|
438
441
|
j += 2; // stride
|
|
439
442
|
}
|
|
@@ -446,11 +449,14 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
|
|
|
446
449
|
// 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.
|
|
447
450
|
|
|
448
451
|
len = src.length;
|
|
449
|
-
|
|
450
|
-
|
|
452
|
+
if ( src.get && src.set ) {
|
|
453
|
+
get = accessorGetter( 'default' );
|
|
454
|
+
} else {
|
|
455
|
+
get = getter( 'default' );
|
|
456
|
+
}
|
|
451
457
|
// Detect whether we've been provided an array which returns complex number objects...
|
|
452
458
|
for ( i = 0; i < len; i++ ) {
|
|
453
|
-
if ( !isComplexLike(
|
|
459
|
+
if ( !isComplexLike( get( src, i ) ) ) {
|
|
454
460
|
flg = true;
|
|
455
461
|
break;
|
|
456
462
|
}
|
|
@@ -458,12 +464,12 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
|
|
|
458
464
|
// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...
|
|
459
465
|
if ( flg ) {
|
|
460
466
|
if ( !isEven( len ) ) {
|
|
461
|
-
throw new RangeError( 'invalid argument. First argument must have a length which is a multiple of
|
|
467
|
+
throw new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );
|
|
462
468
|
}
|
|
463
469
|
out = new this( len/2 );
|
|
464
470
|
buf = out._buffer; // eslint-disable-line no-underscore-dangle
|
|
465
471
|
for ( i = 0; i < len; i++ ) {
|
|
466
|
-
buf[ i ] = clbk.call( thisArg,
|
|
472
|
+
buf[ i ] = clbk.call( thisArg, get( src, i ), i );
|
|
467
473
|
}
|
|
468
474
|
return out;
|
|
469
475
|
}
|
|
@@ -472,7 +478,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
|
|
|
472
478
|
buf = out._buffer; // eslint-disable-line no-underscore-dangle
|
|
473
479
|
j = 0;
|
|
474
480
|
for ( i = 0; i < len; i++ ) {
|
|
475
|
-
v = clbk.call( thisArg,
|
|
481
|
+
v = clbk.call( thisArg, get( src, i ), i );
|
|
476
482
|
if ( isComplexLike( v ) ) {
|
|
477
483
|
buf[ j ] = realf( v );
|
|
478
484
|
buf[ j+1 ] = imagf( v );
|
|
@@ -480,7 +486,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
|
|
|
480
486
|
buf[ j ] = v[ 0 ];
|
|
481
487
|
buf[ j+1 ] = v[ 1 ];
|
|
482
488
|
} else {
|
|
483
|
-
throw new TypeError( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value:
|
|
489
|
+
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 ) );
|
|
484
490
|
}
|
|
485
491
|
j += 2; // stride
|
|
486
492
|
}
|
|
@@ -491,7 +497,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
|
|
|
491
497
|
if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len
|
|
492
498
|
buf = src[ ITERATOR_SYMBOL ]();
|
|
493
499
|
if ( !isFunction( buf.next ) ) {
|
|
494
|
-
throw new TypeError( 'invalid argument. First argument must be an array-like object or an iterable.' );
|
|
500
|
+
throw new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );
|
|
495
501
|
}
|
|
496
502
|
if ( clbk ) {
|
|
497
503
|
tmp = fromIteratorMap( buf, clbk, thisArg );
|
|
@@ -509,7 +515,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
|
|
|
509
515
|
}
|
|
510
516
|
return out;
|
|
511
517
|
}
|
|
512
|
-
throw new TypeError( 'invalid argument. First argument must be an array-like object or an iterable. Value:
|
|
518
|
+
throw new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );
|
|
513
519
|
});
|
|
514
520
|
|
|
515
521
|
/**
|
|
@@ -829,7 +835,7 @@ setReadOnly( Complex64Array.prototype, 'get', function get( idx ) {
|
|
|
829
835
|
throw new TypeError( 'invalid invocation. `this` is not a complex number array.' );
|
|
830
836
|
}
|
|
831
837
|
if ( !isNonNegativeInteger( idx ) ) {
|
|
832
|
-
throw new TypeError( 'invalid argument. Must provide a nonnegative integer. Value:
|
|
838
|
+
throw new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );
|
|
833
839
|
}
|
|
834
840
|
if ( idx >= this._length ) {
|
|
835
841
|
return;
|
|
@@ -938,14 +944,14 @@ setReadOnly( Complex64Array.prototype, 'set', function set( value ) {
|
|
|
938
944
|
if ( arguments.length > 1 ) {
|
|
939
945
|
idx = arguments[ 1 ];
|
|
940
946
|
if ( !isNonNegativeInteger( idx ) ) {
|
|
941
|
-
throw new TypeError( 'invalid argument. Index argument must be a nonnegative integer. Value:
|
|
947
|
+
throw new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );
|
|
942
948
|
}
|
|
943
949
|
} else {
|
|
944
950
|
idx = 0;
|
|
945
951
|
}
|
|
946
952
|
if ( isComplexLike( value ) ) {
|
|
947
953
|
if ( idx >= this._length ) {
|
|
948
|
-
throw new RangeError( 'invalid argument. Index argument is out-of-bounds. Value:
|
|
954
|
+
throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );
|
|
949
955
|
}
|
|
950
956
|
idx *= 2;
|
|
951
957
|
buf[ idx ] = realf( value );
|
|
@@ -997,7 +1003,7 @@ setReadOnly( Complex64Array.prototype, 'set', function set( value ) {
|
|
|
997
1003
|
// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...
|
|
998
1004
|
if ( flg ) {
|
|
999
1005
|
if ( !isEven( N ) ) {
|
|
1000
|
-
throw new RangeError( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length:
|
|
1006
|
+
throw new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );
|
|
1001
1007
|
}
|
|
1002
1008
|
if ( idx+(N/2) > this._length ) {
|
|
1003
1009
|
throw new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );
|
|
@@ -1044,7 +1050,7 @@ setReadOnly( Complex64Array.prototype, 'set', function set( value ) {
|
|
|
1044
1050
|
}
|
|
1045
1051
|
return;
|
|
1046
1052
|
}
|
|
1047
|
-
throw new TypeError( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value:
|
|
1053
|
+
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 ) );
|
|
1048
1054
|
|
|
1049
1055
|
/* eslint-enable no-underscore-dangle */
|
|
1050
1056
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/array-complex64",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Complex64Array.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -37,45 +37,49 @@
|
|
|
37
37
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@stdlib/array-base-
|
|
41
|
-
"@stdlib/array-
|
|
42
|
-
"@stdlib/
|
|
43
|
-
"@stdlib/assert-
|
|
44
|
-
"@stdlib/assert-is-array
|
|
45
|
-
"@stdlib/assert-is-
|
|
46
|
-
"@stdlib/assert-is-
|
|
47
|
-
"@stdlib/assert-is-
|
|
48
|
-
"@stdlib/assert-is-
|
|
49
|
-
"@stdlib/assert-is-
|
|
50
|
-
"@stdlib/assert-is-
|
|
51
|
-
"@stdlib/
|
|
52
|
-
"@stdlib/complex-
|
|
53
|
-
"@stdlib/complex-
|
|
54
|
-
"@stdlib/
|
|
55
|
-
"@stdlib/math-base-assert-is-
|
|
56
|
-
"@stdlib/
|
|
57
|
-
"@stdlib/strided-base-reinterpret-
|
|
58
|
-
"@stdlib/
|
|
59
|
-
"@stdlib/
|
|
60
|
-
"@stdlib/
|
|
61
|
-
"@stdlib/
|
|
40
|
+
"@stdlib/array-base-accessor-getter": "^0.1.0",
|
|
41
|
+
"@stdlib/array-base-getter": "^0.1.0",
|
|
42
|
+
"@stdlib/array-float32": "^0.1.0",
|
|
43
|
+
"@stdlib/assert-has-iterator-symbol-support": "^0.1.0",
|
|
44
|
+
"@stdlib/assert-is-array": "^0.1.0",
|
|
45
|
+
"@stdlib/assert-is-array-like-object": "^0.1.0",
|
|
46
|
+
"@stdlib/assert-is-arraybuffer": "^0.1.0",
|
|
47
|
+
"@stdlib/assert-is-collection": "^0.1.0",
|
|
48
|
+
"@stdlib/assert-is-complex-like": "^0.1.0",
|
|
49
|
+
"@stdlib/assert-is-function": "^0.1.0",
|
|
50
|
+
"@stdlib/assert-is-nonnegative-integer": "^0.1.0",
|
|
51
|
+
"@stdlib/assert-is-object": "^0.1.0",
|
|
52
|
+
"@stdlib/complex-float32": "^0.1.0",
|
|
53
|
+
"@stdlib/complex-imagf": "^0.1.0",
|
|
54
|
+
"@stdlib/complex-realf": "^0.1.0",
|
|
55
|
+
"@stdlib/math-base-assert-is-even": "^0.1.0",
|
|
56
|
+
"@stdlib/math-base-assert-is-integer": "^0.1.0",
|
|
57
|
+
"@stdlib/strided-base-reinterpret-complex128": "^0.1.0",
|
|
58
|
+
"@stdlib/strided-base-reinterpret-complex64": "^0.1.0",
|
|
59
|
+
"@stdlib/string-format": "^0.1.0",
|
|
60
|
+
"@stdlib/symbol-iterator": "^0.1.0",
|
|
61
|
+
"@stdlib/types": "^0.1.0",
|
|
62
|
+
"@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.1.0",
|
|
63
|
+
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0",
|
|
64
|
+
"@stdlib/error-tools-fmtprodmsg": "^0.1.0"
|
|
62
65
|
},
|
|
63
66
|
"devDependencies": {
|
|
64
|
-
"@stdlib/array-buffer": "^0.0
|
|
65
|
-
"@stdlib/array-complex128": "^0.0.
|
|
66
|
-
"@stdlib/assert-has-own-property": "^0.0
|
|
67
|
-
"@stdlib/assert-is-complex64": "^0.0
|
|
68
|
-
"@stdlib/assert-is-negative-zero": "^0.0
|
|
69
|
-
"@stdlib/assert-is-positive-zero": "^0.0
|
|
70
|
-
"@stdlib/bench": "^0.0
|
|
71
|
-
"@stdlib/complex-imag": "^0.0
|
|
72
|
-
"@stdlib/complex-real": "^0.0
|
|
73
|
-
"@stdlib/
|
|
74
|
-
"@stdlib/
|
|
67
|
+
"@stdlib/array-buffer": "^0.1.0",
|
|
68
|
+
"@stdlib/array-complex128": "^0.0.6",
|
|
69
|
+
"@stdlib/assert-has-own-property": "^0.1.0",
|
|
70
|
+
"@stdlib/assert-is-complex64": "^0.1.0",
|
|
71
|
+
"@stdlib/assert-is-negative-zero": "^0.1.0",
|
|
72
|
+
"@stdlib/assert-is-positive-zero": "^0.1.0",
|
|
73
|
+
"@stdlib/bench": "^0.1.0",
|
|
74
|
+
"@stdlib/complex-imag": "^0.1.0",
|
|
75
|
+
"@stdlib/complex-real": "^0.1.0",
|
|
76
|
+
"@stdlib/console-log-each": "^0.0.2",
|
|
77
|
+
"@stdlib/math-base-special-pow": "^0.1.0",
|
|
78
|
+
"@stdlib/random-base-randu": "^0.0.8",
|
|
75
79
|
"proxyquire": "^2.0.0",
|
|
76
80
|
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
77
81
|
"istanbul": "^0.4.1",
|
|
78
|
-
"tap-
|
|
82
|
+
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
|
|
79
83
|
},
|
|
80
84
|
"engines": {
|
|
81
85
|
"node": ">=0.10.0",
|
|
@@ -114,7 +118,7 @@
|
|
|
114
118
|
"ieee754"
|
|
115
119
|
],
|
|
116
120
|
"funding": {
|
|
117
|
-
"type": "
|
|
118
|
-
"url": "https://
|
|
121
|
+
"type": "opencollective",
|
|
122
|
+
"url": "https://opencollective.com/stdlib"
|
|
119
123
|
}
|
|
120
124
|
}
|
package/docs/types/test.ts
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @license Apache-2.0
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2021 The Stdlib Authors.
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
// tslint:disable:no-unused-expression
|
|
20
|
-
|
|
21
|
-
import Complex64Array = require( './index' );
|
|
22
|
-
import Complex64 = require( '@stdlib/complex-float32' );
|
|
23
|
-
import ArrayBuffer = require( '@stdlib/array-buffer' );
|
|
24
|
-
import realf = require( '@stdlib/complex-realf' );
|
|
25
|
-
import imagf = require( '@stdlib/complex-imagf' );
|
|
26
|
-
|
|
27
|
-
const clbk = ( v: Complex64 ) => {
|
|
28
|
-
return new Complex64( realf( v ) * 2.0, imagf( v ) * 2.0 );
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// TESTS //
|
|
33
|
-
|
|
34
|
-
// The function returns a complex number array...
|
|
35
|
-
{
|
|
36
|
-
new Complex64Array(); // $ExpectType Complex64Array
|
|
37
|
-
Complex64Array(); // $ExpectType Complex64Array
|
|
38
|
-
new Complex64Array( 2 ); // $ExpectType Complex64Array
|
|
39
|
-
Complex64Array( 2 ); // $ExpectType Complex64Array
|
|
40
|
-
new Complex64Array( [ 1.0, -1.0 ] ); // $ExpectType Complex64Array
|
|
41
|
-
Complex64Array( [ 1.0, -1.0 ] ); // $ExpectType Complex64Array
|
|
42
|
-
|
|
43
|
-
const buf = new ArrayBuffer( 16 );
|
|
44
|
-
new Complex64Array( buf ); // $ExpectType Complex64Array
|
|
45
|
-
Complex64Array( buf ); // $ExpectType Complex64Array
|
|
46
|
-
new Complex64Array( buf, 8 ); // $ExpectType Complex64Array
|
|
47
|
-
Complex64Array( buf, 8 ); // $ExpectType Complex64Array
|
|
48
|
-
new Complex64Array( buf, 8, 2 ); // $ExpectType Complex64Array
|
|
49
|
-
Complex64Array( buf, 8, 2 ); // $ExpectType Complex64Array
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// 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...
|
|
53
|
-
{
|
|
54
|
-
new Complex64Array( true ); // $ExpectError
|
|
55
|
-
new Complex64Array( false ); // $ExpectError
|
|
56
|
-
new Complex64Array( null ); // $ExpectError
|
|
57
|
-
new Complex64Array( 'abc' ); // $ExpectError
|
|
58
|
-
new Complex64Array( {} ); // $ExpectError
|
|
59
|
-
new Complex64Array( ( x: number ): number => x ); // $ExpectError
|
|
60
|
-
|
|
61
|
-
Complex64Array( true ); // $ExpectError
|
|
62
|
-
Complex64Array( false ); // $ExpectError
|
|
63
|
-
Complex64Array( null ); // $ExpectError
|
|
64
|
-
Complex64Array( 'abc' ); // $ExpectError
|
|
65
|
-
Complex64Array( {} ); // $ExpectError
|
|
66
|
-
Complex64Array( ( x: number ): number => x ); // $ExpectError
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// The compiler throws an error if the function is provided a second argument that is not a number...
|
|
70
|
-
{
|
|
71
|
-
const buf = new ArrayBuffer( 16 );
|
|
72
|
-
new Complex64Array( buf, true ); // $ExpectError
|
|
73
|
-
new Complex64Array( buf, false ); // $ExpectError
|
|
74
|
-
new Complex64Array( buf, null ); // $ExpectError
|
|
75
|
-
new Complex64Array( buf, 'abc' ); // $ExpectError
|
|
76
|
-
new Complex64Array( buf, {} ); // $ExpectError
|
|
77
|
-
new Complex64Array( buf, ( x: number ): number => x ); // $ExpectError
|
|
78
|
-
|
|
79
|
-
Complex64Array( buf, true ); // $ExpectError
|
|
80
|
-
Complex64Array( buf, false ); // $ExpectError
|
|
81
|
-
Complex64Array( buf, null ); // $ExpectError
|
|
82
|
-
Complex64Array( buf, 'abc' ); // $ExpectError
|
|
83
|
-
Complex64Array( buf, {} ); // $ExpectError
|
|
84
|
-
Complex64Array( buf, ( x: number ): number => x ); // $ExpectError
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// The compiler throws an error if the function is provided a third argument that is not a number...
|
|
88
|
-
{
|
|
89
|
-
const buf = new ArrayBuffer( 16 );
|
|
90
|
-
new Complex64Array( buf, 8, true ); // $ExpectError
|
|
91
|
-
new Complex64Array( buf, 8, false ); // $ExpectError
|
|
92
|
-
new Complex64Array( buf, 8, null ); // $ExpectError
|
|
93
|
-
new Complex64Array( buf, 8, 'abc' ); // $ExpectError
|
|
94
|
-
new Complex64Array( buf, 8, {} ); // $ExpectError
|
|
95
|
-
new Complex64Array( buf, 8, ( x: number ): number => x ); // $ExpectError
|
|
96
|
-
|
|
97
|
-
Complex64Array( buf, 8, true ); // $ExpectError
|
|
98
|
-
Complex64Array( buf, 8, false ); // $ExpectError
|
|
99
|
-
Complex64Array( buf, 8, null ); // $ExpectError
|
|
100
|
-
Complex64Array( buf, 8, 'abc' ); // $ExpectError
|
|
101
|
-
Complex64Array( buf, 8, {} ); // $ExpectError
|
|
102
|
-
Complex64Array( buf, 8, ( x: number ): number => x ); // $ExpectError
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// The `from` method returns a complex number array...
|
|
106
|
-
{
|
|
107
|
-
Complex64Array.from( [ 1.0, 1.0 ] ); // $ExpectType Complex64Array
|
|
108
|
-
Complex64Array.from( [ 1.0, 1.0 ], ( x: number ): number => x * x ); // $ExpectType Complex64Array
|
|
109
|
-
Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk, {} ); // $ExpectType Complex64Array
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// The compiler throws an error if the `from` method is provided a first argument which is not array-like or iterable...
|
|
113
|
-
{
|
|
114
|
-
Complex64Array.from( true ); // $ExpectError
|
|
115
|
-
Complex64Array.from( false ); // $ExpectError
|
|
116
|
-
Complex64Array.from( 123 ); // $ExpectError
|
|
117
|
-
Complex64Array.from( null ); // $ExpectError
|
|
118
|
-
Complex64Array.from( {} ); // $ExpectError
|
|
119
|
-
|
|
120
|
-
Complex64Array.from( true, clbk ); // $ExpectError
|
|
121
|
-
Complex64Array.from( false, clbk ); // $ExpectError
|
|
122
|
-
Complex64Array.from( 123, clbk ); // $ExpectError
|
|
123
|
-
Complex64Array.from( null, clbk ); // $ExpectError
|
|
124
|
-
Complex64Array.from( {}, clbk ); // $ExpectError
|
|
125
|
-
|
|
126
|
-
Complex64Array.from( true, clbk, {} ); // $ExpectError
|
|
127
|
-
Complex64Array.from( false, clbk, {} ); // $ExpectError
|
|
128
|
-
Complex64Array.from( 123, clbk, {} ); // $ExpectError
|
|
129
|
-
Complex64Array.from( null, clbk, {} ); // $ExpectError
|
|
130
|
-
Complex64Array.from( {}, clbk, {} ); // $ExpectError
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// The compiler throws an error if the `from` method is provided a second argument which is not a function with a supported signature...
|
|
134
|
-
{
|
|
135
|
-
Complex64Array.from( [ 1, 1 ], true ); // $ExpectError
|
|
136
|
-
Complex64Array.from( [ 1, 1 ], false ); // $ExpectError
|
|
137
|
-
Complex64Array.from( [ 1, 1 ], 123 ); // $ExpectError
|
|
138
|
-
Complex64Array.from( [ 1, 1 ], null ); // $ExpectError
|
|
139
|
-
Complex64Array.from( [ 1, 1 ], {} ); // $ExpectError
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// The `of` method returns a complex number array...
|
|
143
|
-
{
|
|
144
|
-
Complex64Array.of( 1.0, 1.0, 1.0, 1.0 ); // $ExpectType Complex64Array
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// The compiler throws an error if the `of` method is provided arguments that are not numbers...
|
|
148
|
-
{
|
|
149
|
-
Complex64Array.of( 'abc', 'def' ); // $ExpectError
|
|
150
|
-
Complex64Array.of( true, false ); // $ExpectError
|
|
151
|
-
Complex64Array.of( {}, [] ); // $ExpectError
|
|
152
|
-
Complex64Array.of( null, null ); // $ExpectError
|
|
153
|
-
}
|