@stdlib/array-complex64 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@
22
22
 
23
23
  /// <reference types="@stdlib/types"/>
24
24
 
25
- import { Iterator as Iter, IterableIterator } from '@stdlib/types/iter';
25
+ import { Iterator as Iter, IterableIterator, TypedIterator } from '@stdlib/types/iter';
26
26
  import { ArrayLike, RealOrComplexTypedArray, Complex64Array as Complex64ArrayInterface } from '@stdlib/types/array';
27
27
  import { ComplexLike, Complex64 } from '@stdlib/types/complex';
28
28
  import ArrayBuffer = require( '@stdlib/array-buffer' );
@@ -30,6 +30,16 @@ import ArrayBuffer = require( '@stdlib/array-buffer' );
30
30
  // Define a union type representing both iterable and non-iterable iterators:
31
31
  type Iterator = Iter | IterableIterator;
32
32
 
33
+ /**
34
+ * Locale-specific configuration options.
35
+ */
36
+ interface LocaleOptions<T = unknown> {
37
+ /**
38
+ * Configuration property.
39
+ */
40
+ [ key: string | symbol | number ]: T | undefined;
41
+ };
42
+
33
43
  /**
34
44
  * Callback invoked for each element in a source object.
35
45
  *
@@ -195,6 +205,69 @@ type TernaryMapFcn<U> = ( this: U, value: Complex64, index: number, arr: Complex
195
205
  */
196
206
  type MapFcn<U> = NullaryMapFcn<U> | UnaryMapFcn<U> | BinaryMapFcn<U> | TernaryMapFcn<U>;
197
207
 
208
+ /**
209
+ * Reducer function invoked for each element in an array.
210
+ *
211
+ * @returns accumulated result
212
+ */
213
+ type NullaryReducer<U> = () => U;
214
+
215
+ /**
216
+ * Reducer function invoked for each element in an array.
217
+ *
218
+ * @param acc - accumulated result
219
+ * @returns accumulated result
220
+ */
221
+ type UnaryReducer<U> = ( acc: U ) => U;
222
+
223
+ /**
224
+ * Reducer function invoked for each element in an array.
225
+ *
226
+ * @param acc - accumulated result
227
+ * @param value - current array element
228
+ * @returns accumulated result
229
+ */
230
+ type BinaryReducer<U> = ( acc: U, value: Complex64 ) => U;
231
+
232
+ /**
233
+ * Reducer function invoked for each element in an array.
234
+ *
235
+ * @param acc - accumulated result
236
+ * @param value - current array element
237
+ * @param index - current array element index
238
+ * @returns accumulated result
239
+ */
240
+ type TernaryReducer<U> = ( acc: U, value: Complex64, index: number ) => U;
241
+
242
+ /**
243
+ * @param acc - accumulated result
244
+ * @param value - current array element
245
+ * @param index - current array element index
246
+ * @param arr - array on which the method was called
247
+ * @returns accumulated result
248
+ */
249
+ type QuaternaryReducer<U> = ( acc: U, value: Complex64, index: number, arr: Complex64Array ) => U;
250
+
251
+ /**
252
+ * Reducer function invoked for each element in an array.
253
+ *
254
+ * @param acc - accumulated result
255
+ * @param value - current array element
256
+ * @param index - current array element index
257
+ * @param arr - array on which the method was called
258
+ * @returns accumulated result
259
+ */
260
+ type Reducer<U> = NullaryReducer<U> | UnaryReducer<U> | BinaryReducer<U> | TernaryReducer<U> | QuaternaryReducer<U>;
261
+
262
+ /**
263
+ * Comparator function.
264
+ *
265
+ * @param a - first value for comparison
266
+ * @param b - second value for comparison
267
+ * @returns number indicating comparison result
268
+ */
269
+ type CompareFcn = ( a: Complex64, b: Complex64 ) => number;
270
+
198
271
  /**
199
272
  * Class for creating a 64-bit complex number array.
200
273
  */
@@ -348,9 +421,9 @@ declare class Complex64Array implements Complex64ArrayInterface {
348
421
  * @returns modified array
349
422
  *
350
423
  * @example
351
- * var Complex64 = require( '@stdlib/complex-float32' );
352
- * var realf = require( '@stdlib/complex-realf' );
353
- * var imagf = require( '@stdlib/complex-imagf' );
424
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
425
+ * var realf = require( '@stdlib/complex-float32-real' );
426
+ * var imagf = require( '@stdlib/complex-float32-imag' );
354
427
  *
355
428
  * var arr = new Complex64Array( 4 );
356
429
  *
@@ -380,7 +453,7 @@ declare class Complex64Array implements Complex64ArrayInterface {
380
453
  * @returns iterator
381
454
  *
382
455
  * @example
383
- * var Complex64 = require( '@stdlib/complex-float32' );
456
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
384
457
  *
385
458
  * var arr = [
386
459
  * new Complex64( 1.0, 1.0 ),
@@ -405,7 +478,7 @@ declare class Complex64Array implements Complex64ArrayInterface {
405
478
  * var bool = it.next().done;
406
479
  * // returns true
407
480
  */
408
- entries(): Iterator;
481
+ entries(): TypedIterator<[number, Complex64]>;
409
482
 
410
483
  /**
411
484
  * Tests whether all elements in an array pass a test implemented by a predicate function.
@@ -415,8 +488,8 @@ declare class Complex64Array implements Complex64ArrayInterface {
415
488
  * @returns boolean indicating whether all elements pass a test
416
489
  *
417
490
  * @example
418
- * var realf = require( '@stdlib/complex-realf' );
419
- * var imagf = require( '@stdlib/complex-imagf' );
491
+ * var realf = require( '@stdlib/complex-float32-real' );
492
+ * var imagf = require( '@stdlib/complex-float32-imag' );
420
493
  *
421
494
  * function predicate( v ) {
422
495
  * return ( realf( v ) === imagf( v ) );
@@ -442,8 +515,8 @@ declare class Complex64Array implements Complex64ArrayInterface {
442
515
  * @returns modified typed array
443
516
  *
444
517
  * @example
445
- * var realf = require( '@stdlib/complex-realf' );
446
- * var imagf = require( '@stdlib/complex-imagf' );
518
+ * var realf = require( '@stdlib/complex-float32-real' );
519
+ * var imagf = require( '@stdlib/complex-float32-imag' );
447
520
  *
448
521
  * var arr = new Complex64Array( 3 );
449
522
  *
@@ -477,8 +550,8 @@ declare class Complex64Array implements Complex64ArrayInterface {
477
550
  * @returns new array containing elements which pass a test implemented by a predicate function
478
551
  *
479
552
  * @example
480
- * var realf = require( '@stdlib/complex-realf' );
481
- * var imagf = require( '@stdlib/complex-imagf' );
553
+ * var realf = require( '@stdlib/complex-float32-real' );
554
+ * var imagf = require( '@stdlib/complex-float32-imag' );
482
555
  *
483
556
  * function predicate( v ) {
484
557
  * return ( realf( v ) === imagf( v ) );
@@ -515,9 +588,9 @@ declare class Complex64Array implements Complex64ArrayInterface {
515
588
  * @returns array element or undefined
516
589
  *
517
590
  * @example
518
- * var realf = require( '@stdlib/complex-realf' );
519
- * var imagf = require( '@stdlib/complex-imagf' );
520
- * var Complex64 = require( '@stdlib/complex-float32' );
591
+ * var realf = require( '@stdlib/complex-float32-real' );
592
+ * var imagf = require( '@stdlib/complex-float32-imag' );
593
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
521
594
  *
522
595
  * function predicate( v ) {
523
596
  * return ( realf( v ) === imagf( v ) );
@@ -548,9 +621,9 @@ declare class Complex64Array implements Complex64ArrayInterface {
548
621
  * @returns index or -1
549
622
  *
550
623
  * @example
551
- * var Complex64 = require( '@stdlib/complex-float32' );
552
- * var realf = require( '@stdlib/complex-realf' );
553
- * var imagf = require( '@stdlib/complex-imagf' );
624
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
625
+ * var realf = require( '@stdlib/complex-float32-real' );
626
+ * var imagf = require( '@stdlib/complex-float32-imag' );
554
627
  *
555
628
  * function predicate( v ) {
556
629
  * return ( realf( v ) === imagf( v ) );
@@ -575,9 +648,9 @@ declare class Complex64Array implements Complex64ArrayInterface {
575
648
  * @returns array element or undefined
576
649
  *
577
650
  * @example
578
- * var realf = require( '@stdlib/complex-realf' );
579
- * var imagf = require( '@stdlib/complex-imagf' );
580
- * var Complex64 = require( '@stdlib/complex-float32' );
651
+ * var realf = require( '@stdlib/complex-float32-real' );
652
+ * var imagf = require( '@stdlib/complex-float32-imag' );
653
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
581
654
  *
582
655
  * function predicate( v ) {
583
656
  * return ( realf( v ) === imagf( v ) );
@@ -608,9 +681,9 @@ declare class Complex64Array implements Complex64ArrayInterface {
608
681
  * @returns index or -1
609
682
  *
610
683
  * @example
611
- * var Complex64 = require( '@stdlib/complex-float32' );
612
- * var realf = require( '@stdlib/complex-realf' );
613
- * var imagf = require( '@stdlib/complex-imagf' );
684
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
685
+ * var realf = require( '@stdlib/complex-float32-real' );
686
+ * var imagf = require( '@stdlib/complex-float32-imag' );
614
687
  *
615
688
  * function predicate( v ) {
616
689
  * return ( realf( v ) === imagf( v ) );
@@ -635,7 +708,7 @@ declare class Complex64Array implements Complex64ArrayInterface {
635
708
  * @returns undefined
636
709
  *
637
710
  * @example
638
- * var Complex64 = require( '@stdlib/complex-float32' );
711
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
639
712
  *
640
713
  * function log( v, i ) {
641
714
  * console.log( '%s: %s', i, v.toString() );
@@ -748,6 +821,30 @@ declare class Complex64Array implements Complex64ArrayInterface {
748
821
  */
749
822
  join( separator?: string ): string;
750
823
 
824
+ /**
825
+ * Returns an iterator for iterating over each index key in a typed array.
826
+ *
827
+ * @returns iterator
828
+ *
829
+ * @example
830
+ * var arr = new Complex64Array( 2 );
831
+ *
832
+ * arr.set( [ 1.0, 1.0 ], 0 );
833
+ * arr.set( [ 2.0, 2.0 ], 1 );
834
+ *
835
+ * var iter = arr.keys();
836
+ *
837
+ * var v = iter.next().value;
838
+ * // returns 0
839
+ *
840
+ * v = iter.next().value;
841
+ * // returns 1
842
+ *
843
+ * var bool = iter.next().done;
844
+ * // returns true
845
+ */
846
+ keys(): TypedIterator<number>;
847
+
751
848
  /**
752
849
  * Returns the last index at which a given element can be found.
753
850
  *
@@ -756,7 +853,7 @@ declare class Complex64Array implements Complex64ArrayInterface {
756
853
  * @returns index or -1
757
854
  *
758
855
  * @example
759
- * var Complex64 = require( '@stdlib/complex-float32' );
856
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
760
857
  *
761
858
  * var arr = new Complex64Array( 5 );
762
859
  *
@@ -785,9 +882,9 @@ declare class Complex64Array implements Complex64ArrayInterface {
785
882
  * @returns new array containing transformed elements
786
883
  *
787
884
  * @example
788
- * var Complex64 = require( '@stdlib/complex-float32' );
789
- * var realf = require( '@stdlib/complex-realf' );
790
- * var imagf = require( '@stdlib/complex-imagf' );
885
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
886
+ * var realf = require( '@stdlib/complex-float32-real' );
887
+ * var imagf = require( '@stdlib/complex-float32-imag' );
791
888
  *
792
889
  * function scale( v, i ) {
793
890
  * return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );
@@ -813,14 +910,72 @@ declare class Complex64Array implements Complex64ArrayInterface {
813
910
  */
814
911
  map<U = unknown>( fcn: MapFcn<U>, thisArg?: ThisParameterType<MapFcn<U>> ): Complex64Array;
815
912
 
913
+ /**
914
+ * Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.
915
+ *
916
+ * @param reducer - callback function
917
+ * @param initialValue - initial value
918
+ * @returns accumulated result
919
+ *
920
+ * @example
921
+ * var realf = require( '@stdlib/complex-float32-real' );
922
+ * var imagf = require( '@stdlib/complex-float32-imag' );
923
+ * var caddf = require( '@stdlib/complex-float32-base-add' );
924
+ *
925
+ * var arr = new Complex64Array( 3 );
926
+ *
927
+ * arr.set( [ 1.0, 1.0 ], 0 );
928
+ * arr.set( [ 2.0, 2.0 ], 1 );
929
+ * arr.set( [ 3.0, 3.0 ], 2 );
930
+ *
931
+ * var z = arr.reduce( caddf );
932
+ * // returns <Complex64>
933
+ *
934
+ * var re = realf( z );
935
+ * // returns 6.0
936
+ *
937
+ * var im = imagf( z );
938
+ * // returns 6.0
939
+ */
940
+ reduce<U = unknown>( reducer: Reducer<U>, initialValue?: U ): U;
941
+
942
+ /**
943
+ * Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the following element and returning the accumulated result upon completion.
944
+ *
945
+ * @param reducer - callback function
946
+ * @param initialValue - initial value
947
+ * @returns accumulated result
948
+ *
949
+ * @example
950
+ * var realf = require( '@stdlib/complex-float32-real' );
951
+ * var imagf = require( '@stdlib/complex-float32-imag' );
952
+ * var caddf = require( '@stdlib/complex-float32-base-add' );
953
+ *
954
+ * var arr = new Complex64Array( 3 );
955
+ *
956
+ * arr.set( [ 1.0, 1.0 ], 0 );
957
+ * arr.set( [ 2.0, 2.0 ], 1 );
958
+ * arr.set( [ 3.0, 3.0 ], 2 );
959
+ *
960
+ * var z = arr.reduceRight( caddf );
961
+ * // returns <Complex64>
962
+ *
963
+ * var re = realf( z );
964
+ * // returns 6.0
965
+ *
966
+ * var im = imagf( z );
967
+ * // returns 6.0
968
+ */
969
+ reduceRight<U = unknown>( reducer: Reducer<U>, initialValue?: U ): U;
970
+
816
971
  /**
817
972
  * Reverses an array in-place.
818
973
  *
819
974
  * @returns reversed array
820
975
  *
821
976
  * @example
822
- * var realf = require( '@stdlib/complex-realf' );
823
- * var imagf = require( '@stdlib/complex-imagf' );
977
+ * var realf = require( '@stdlib/complex-float32-real' );
978
+ * var imagf = require( '@stdlib/complex-float32-imag' );
824
979
  *
825
980
  * var arr = new Complex64Array( 3 );
826
981
  *
@@ -892,8 +1047,8 @@ declare class Complex64Array implements Complex64ArrayInterface {
892
1047
  * @throws target array lacks sufficient storage to accommodate source values
893
1048
  *
894
1049
  * @example
895
- * var realf = require( '@stdlib/complex-realf' );
896
- * var imagf = require( '@stdlib/complex-imagf' );
1050
+ * var realf = require( '@stdlib/complex-float32-real' );
1051
+ * var imagf = require( '@stdlib/complex-float32-imag' );
897
1052
  *
898
1053
  * var arr = new Complex64Array( 10 );
899
1054
  *
@@ -928,8 +1083,8 @@ declare class Complex64Array implements Complex64ArrayInterface {
928
1083
  * @returns output array
929
1084
  *
930
1085
  * @example
931
- * var realf = require( '@stdlib/complex-realf' );
932
- * var imagf = require( '@stdlib/complex-imagf' );
1086
+ * var realf = require( '@stdlib/complex-float32-real' );
1087
+ * var imagf = require( '@stdlib/complex-float32-imag' );
933
1088
  *
934
1089
  * var arr = new Complex64Array( 5 );
935
1090
  *
@@ -997,8 +1152,8 @@ declare class Complex64Array implements Complex64ArrayInterface {
997
1152
  * @returns boolean indicating whether at least one element passes a test
998
1153
  *
999
1154
  * @example
1000
- * var realf = require( '@stdlib/complex-realf' );
1001
- * var imagf = require( '@stdlib/complex-imagf' );
1155
+ * var realf = require( '@stdlib/complex-float32-real' );
1156
+ * var imagf = require( '@stdlib/complex-float32-imag' );
1002
1157
  *
1003
1158
  * function predicate( v ) {
1004
1159
  * return ( realf( v ) === imagf( v ) );
@@ -1015,6 +1170,78 @@ declare class Complex64Array implements Complex64ArrayInterface {
1015
1170
  */
1016
1171
  some<U = unknown>( predicate: Predicate<U>, thisArg?: ThisParameterType<Predicate<U>> ): boolean;
1017
1172
 
1173
+ /**
1174
+ * Sorts an array in-place.
1175
+ *
1176
+ * @param compareFcn - comparison function
1177
+ * @returns sorted array
1178
+ *
1179
+ * @example
1180
+ * var realf = require( '@stdlib/complex-float32-real' );
1181
+ * var imagf = require( '@stdlib/complex-float32-imag' );
1182
+ *
1183
+ * function compare( a, b ) {
1184
+ * var re1;
1185
+ * var re2;
1186
+ * var im1;
1187
+ * var im2;
1188
+ * re1 = realf( a );
1189
+ * re2 = realf( b );
1190
+ * if ( re1 < re2 ) {
1191
+ * return -1;
1192
+ * }
1193
+ * if ( re1 > re2 ) {
1194
+ * return 1;
1195
+ * }
1196
+ * im1 = imagf( a );
1197
+ * im2 = imagf( b );
1198
+ * if ( im1 < im2 ) {
1199
+ * return -1;
1200
+ * }
1201
+ * if ( im1 > im2 ) {
1202
+ * return 1;
1203
+ * }
1204
+ * return 0;
1205
+ * }
1206
+ *
1207
+ * var arr = new Complex64Array( 3 );
1208
+ *
1209
+ * arr.set( [ 3.0, -3.0 ], 0 );
1210
+ * arr.set( [ 1.0, -1.0 ], 1 );
1211
+ * arr.set( [ 2.0, -2.0 ], 2 );
1212
+ *
1213
+ * var out = arr.sort( compare );
1214
+ * // returns <Complex64Array>
1215
+ *
1216
+ * var z = out.get( 0 );
1217
+ * // returns <Complex64>
1218
+ *
1219
+ * var re = realf( z );
1220
+ * // returns 1.0
1221
+ *
1222
+ * var im = imagf( z );
1223
+ * // returns -1.0
1224
+ *
1225
+ * z = out.get( 1 );
1226
+ * // returns <Complex64>
1227
+ *
1228
+ * re = realf( z );
1229
+ * // returns 2.0
1230
+ *
1231
+ * im = imagf( z );
1232
+ * // returns -2.0
1233
+ *
1234
+ * z = out.get( 2 );
1235
+ * // returns <Complex64>
1236
+ *
1237
+ * re = realf( z );
1238
+ * // returns 3.0
1239
+ *
1240
+ * im = imagf( z );
1241
+ * // returns -3.0
1242
+ */
1243
+ sort( compareFcn: CompareFcn ): Complex64Array;
1244
+
1018
1245
  /**
1019
1246
  * Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.
1020
1247
  *
@@ -1024,8 +1251,8 @@ declare class Complex64Array implements Complex64ArrayInterface {
1024
1251
  * @returns subarray
1025
1252
  *
1026
1253
  * @example
1027
- * var realf = require( '@stdlib/complex-realf' );
1028
- * var imagf = require( '@stdlib/complex-imagf' );
1254
+ * var realf = require( '@stdlib/complex-float32-real' );
1255
+ * var imagf = require( '@stdlib/complex-float32-imag' );
1029
1256
  *
1030
1257
  * var arr = new Complex64Array( 5 );
1031
1258
  *
@@ -1085,14 +1312,32 @@ declare class Complex64Array implements Complex64ArrayInterface {
1085
1312
  */
1086
1313
  subarray( begin?: number, end?: number ): Complex64Array;
1087
1314
 
1315
+ /**
1316
+ * Serializes an array as a locale-specific string.
1317
+ *
1318
+ * @param locales - locale identifier(s)
1319
+ * @param options - configuration options
1320
+ * @returns string
1321
+ *
1322
+ * @example
1323
+ * var arr = new Complex64Array( 2 );
1324
+ *
1325
+ * arr.set( [ 1.0, 1.0 ], 0 );
1326
+ * arr.set( [ 2.0, 2.0 ], 1 );
1327
+ *
1328
+ * var str = arr.toLocaleString();
1329
+ * // returns '1 + 1i,2 + 2i'
1330
+ */
1331
+ toLocaleString( locales?: string | Array<string>, options?: LocaleOptions ): string;
1332
+
1088
1333
  /**
1089
1334
  * Returns a new typed array containing the elements in reversed order.
1090
1335
  *
1091
1336
  * @returns reversed array
1092
1337
  *
1093
1338
  * @example
1094
- * var realf = require( '@stdlib/complex-realf' );
1095
- * var imagf = require( '@stdlib/complex-imagf' );
1339
+ * var realf = require( '@stdlib/complex-float32-real' );
1340
+ * var imagf = require( '@stdlib/complex-float32-imag' );
1096
1341
  *
1097
1342
  * var arr = new Complex64Array( 3 );
1098
1343
  *
@@ -1132,6 +1377,78 @@ declare class Complex64Array implements Complex64ArrayInterface {
1132
1377
  */
1133
1378
  toReversed(): Complex64Array;
1134
1379
 
1380
+ /**
1381
+ * Returns a new typed array containing the elements in sorted order.
1382
+ *
1383
+ * @param compareFcn - comparison function
1384
+ * @returns sorted array
1385
+ *
1386
+ * @example
1387
+ * var realf = require( '@stdlib/complex-float32-real' );
1388
+ * var imagf = require( '@stdlib/complex-float32-imag' );
1389
+ *
1390
+ * function compare( a, b ) {
1391
+ * var re1;
1392
+ * var re2;
1393
+ * var im1;
1394
+ * var im2;
1395
+ * re1 = realf( a );
1396
+ * re2 = realf( b );
1397
+ * if ( re1 < re2 ) {
1398
+ * return -1;
1399
+ * }
1400
+ * if ( re1 > re2 ) {
1401
+ * return 1;
1402
+ * }
1403
+ * im1 = imagf( a );
1404
+ * im2 = imagf( b );
1405
+ * if ( im1 < im2 ) {
1406
+ * return -1;
1407
+ * }
1408
+ * if ( im1 > im2 ) {
1409
+ * return 1;
1410
+ * }
1411
+ * return 0;
1412
+ * }
1413
+ *
1414
+ * var arr = new Complex64Array( 3 );
1415
+ *
1416
+ * arr.set( [ 3.0, -3.0 ], 0 );
1417
+ * arr.set( [ 1.0, -1.0 ], 1 );
1418
+ * arr.set( [ 2.0, -2.0 ], 2 );
1419
+ *
1420
+ * var out = arr.toSorted( compare );
1421
+ * // returns <Complex64Array>
1422
+ *
1423
+ * var z = out.get( 0 );
1424
+ * // returns <Complex64>
1425
+ *
1426
+ * var re = realf( z );
1427
+ * // returns 1.0
1428
+ *
1429
+ * var im = imagf( z );
1430
+ * // returns -1.0
1431
+ *
1432
+ * z = out.get( 1 );
1433
+ * // returns <Complex64>
1434
+ *
1435
+ * re = realf( z );
1436
+ * // returns 2.0
1437
+ *
1438
+ * im = imagf( z );
1439
+ * // returns -2.0
1440
+ *
1441
+ * z = out.get( 2 );
1442
+ * // returns <Complex64>
1443
+ *
1444
+ * re = realf( z );
1445
+ * // returns 3.0
1446
+ *
1447
+ * im = imagf( z );
1448
+ * // returns -3.0
1449
+ */
1450
+ toSorted( compareFcn: CompareFcn ): Complex64Array;
1451
+
1135
1452
  /**
1136
1453
  * Serializes an array as a string.
1137
1454
  *
@@ -1148,6 +1465,44 @@ declare class Complex64Array implements Complex64ArrayInterface {
1148
1465
  */
1149
1466
  toString(): string;
1150
1467
 
1468
+ /**
1469
+ * Returns an iterator for iterating over each value in a typed array.
1470
+ *
1471
+ * @returns iterator
1472
+ *
1473
+ * @example
1474
+ * var realf = require( '@stdlib/complex-float32-real' );
1475
+ * var imagf = require( '@stdlib/complex-float32-imag' );
1476
+ * var arr = new Complex64Array( 2 );
1477
+ *
1478
+ * arr.set( [ 1.0, -1.0 ], 0 );
1479
+ * arr.set( [ 2.0, -2.0 ], 1 );
1480
+ *
1481
+ * var iter = arr.values();
1482
+ *
1483
+ * var v = iter.next().value;
1484
+ * // returns <Complex64>
1485
+ *
1486
+ * var re = realf( v );
1487
+ * // returns 1.0
1488
+ *
1489
+ * var im = imagf( v );
1490
+ * // returns -1.0
1491
+ *
1492
+ * v = iter.next().value;
1493
+ * // returns <Complex64>
1494
+ *
1495
+ * re = realf( v );
1496
+ * // returns 2.0
1497
+ *
1498
+ * im = imagf( v );
1499
+ * // returns -2.0
1500
+ *
1501
+ * var bool = iter.next().done;
1502
+ * // returns true
1503
+ */
1504
+ values(): TypedIterator<Complex64>;
1505
+
1151
1506
  /**
1152
1507
  * Returns a new typed array with the element at a provided index replaced with a provided value.
1153
1508
  *
@@ -1159,9 +1514,9 @@ declare class Complex64Array implements Complex64ArrayInterface {
1159
1514
  * @returns modified typed array
1160
1515
  *
1161
1516
  * @example
1162
- * var realf = require( '@stdlib/complex-realf' );
1163
- * var imagf = require( '@stdlib/complex-imagf' );
1164
- * var Complex64 = require( '@stdlib/complex-float32' );
1517
+ * var realf = require( '@stdlib/complex-float32-real' );
1518
+ * var imagf = require( '@stdlib/complex-float32-imag' );
1519
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
1165
1520
  *
1166
1521
  * var arr = new Complex64Array( 3 );
1167
1522
  *
@@ -1363,7 +1718,7 @@ interface Complex64ArrayConstructor {
1363
1718
  * // returns 1
1364
1719
  *
1365
1720
  * @example
1366
- * var Complex64 = require( '@stdlib/complex-float32' );
1721
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
1367
1722
  *
1368
1723
  * var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );
1369
1724
  * // returns <Complex64Array>
@@ -1372,9 +1727,9 @@ interface Complex64ArrayConstructor {
1372
1727
  * // returns 1
1373
1728
  *
1374
1729
  * @example
1375
- * var Complex64 = require( '@stdlib/complex-float32' );
1376
- * var realf = require( '@stdlib/complex-realf' );
1377
- * var imagf = require( '@stdlib/complex-imagf' );
1730
+ * var Complex64 = require( '@stdlib/complex-float32-ctor' );
1731
+ * var realf = require( '@stdlib/complex-float32-real' );
1732
+ * var imagf = require( '@stdlib/complex-float32-imag' );
1378
1733
  *
1379
1734
  * function clbk( v ) {
1380
1735
  * return new Complex64( realf(v)*2.0, imagf(v)*2.0 );
@@ -1386,12 +1741,12 @@ interface Complex64ArrayConstructor {
1386
1741
  * var len = arr.length;
1387
1742
  * // returns 1
1388
1743
  */
1389
- from( src: ArrayLike<number | ComplexLike> | RealOrComplexTypedArray | Iterable<number | ComplexLike>, clbk?: FromCallback<U>, thisArg?: ThisParameterType<FromCallback<U>> ): Complex64Array;
1744
+ from<U = unknown>( src: ArrayLike<number | ComplexLike> | RealOrComplexTypedArray | Iterable<number | ComplexLike>, clbk?: FromCallback<U>, thisArg?: ThisParameterType<FromCallback<U>> ): Complex64Array;
1390
1745
 
1391
1746
  /**
1392
1747
  * Creates a new 64-bit complex number array from a variable number of arguments.
1393
1748
  *
1394
- * @param element - array elements
1749
+ * @param elements - array elements
1395
1750
  * @returns 64-bit complex number array
1396
1751
  *
1397
1752
  * @example
package/lib/from_array.js CHANGED
@@ -21,8 +21,8 @@
21
21
  // MODULES //
22
22
 
23
23
  var isComplexLike = require( '@stdlib/assert-is-complex-like' );
24
- var realf = require( '@stdlib/complex-realf' );
25
- var imagf = require( '@stdlib/complex-imagf' );
24
+ var realf = require( '@stdlib/complex-float32-real' );
25
+ var imagf = require( '@stdlib/complex-float32-imag' );
26
26
 
27
27
 
28
28
  // MAIN //
@@ -22,8 +22,8 @@
22
22
 
23
23
  var isArrayLikeObject = require( '@stdlib/assert-is-array-like-object' );
24
24
  var isComplexLike = require( '@stdlib/assert-is-complex-like' );
25
- var realf = require( '@stdlib/complex-realf' );
26
- var imagf = require( '@stdlib/complex-imagf' );
25
+ var realf = require( '@stdlib/complex-float32-real' );
26
+ var imagf = require( '@stdlib/complex-float32-imag' );
27
27
  var format = require( '@stdlib/string-format' );
28
28
 
29
29