-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
2030 lines (1928 loc) · 56.3 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// TypeScript Version: 4.1
/* eslint-disable max-lines */
import base = require( './../../base' );
import BooleanArray = require( './../../bool' );
import ArrayBuffer = require( './../../buffer' );
import byteOrders = require( './../../byte-orders' );
import cartesianPower = require( './../../cartesian-power' );
import cartesianProduct = require( './../../cartesian-product' );
import cartesianSquare = require( './../../cartesian-square' );
import Complex64Array = require( './../../complex64' );
import Complex128Array = require( './../../complex128' );
import convert = require( './../../convert' );
import convertSame = require( './../../convert-same' );
import ctors = require( './../../ctors' );
import DataView = require( './../../dataview' );
import datespace = require( './../../datespace' );
import defaults = require( './../../defaults' );
import dtype = require( './../../dtype' );
import dtypes = require( './../../dtypes' );
import empty = require( './../../empty' );
import emptyLike = require( './../../empty-like' );
import filled = require( './../../filled' );
import filledBy = require( './../../filled-by' );
import Float32Array = require( './../../float32' );
import Float64Array = require( './../../float64' );
import iterator2array = require( './../../from-iterator' );
import scalar2array = require( './../../from-scalar' );
import full = require( './../../full' );
import fullLike = require( './../../full-like' );
import incrspace = require( './../../incrspace' );
import ArrayIndex = require( './../../index' );
import Int8Array = require( './../../int8' );
import Int16Array = require( './../../int16' );
import Int32Array = require( './../../int32' );
import linspace = require( './../../linspace' );
import logspace = require( './../../logspace' );
import minDataType = require( './../../min-dtype' );
import mostlySafeCasts = require( './../../mostly-safe-casts' );
import mskfilter = require( './../../mskfilter' );
import mskput = require( './../../mskput' );
import mskreject = require( './../../mskreject' );
import nans = require( './../../nans' );
import nansLike = require( './../../nans-like' );
import nextDataType = require( './../../next-dtype' );
import oneTo = require( './../../one-to' );
import oneToLike = require( './../../one-to-like' );
import ones = require( './../../ones' );
import onesLike = require( './../../ones-like' );
import place = require( './../../place' );
import typedarraypool = require( './../../pool' );
import promotionRules = require( './../../promotion-rules' );
import put = require( './../../put' );
import typedarrayReviver = require( './../../reviver' );
import safeCasts = require( './../../safe-casts' );
import sameKindCasts = require( './../../same-kind-casts' );
import shape = require( './../../shape' );
import SharedArrayBuffer = require( './../../shared-buffer' );
import slice = require( './../../slice' );
import take = require( './../../take' );
import circarray2iterator = require( './../../to-circular-iterator' );
import array2fancy = require( './../../to-fancy' );
import array2iterator = require( './../../to-iterator' );
import array2iteratorRight = require( './../../to-iterator-right' );
import typedarray2json = require( './../../to-json' );
import sparsearray2iterator = require( './../../to-sparse-iterator' );
import sparsearray2iteratorRight = require( './../../to-sparse-iterator-right' );
import stridedarray2iterator = require( './../../to-strided-iterator' );
import arrayview2iterator = require( './../../to-view-iterator' );
import arrayview2iteratorRight = require( './../../to-view-iterator-right' );
import typedarray = require( './../../typed' );
import complexarray = require( './../../typed-complex' );
import complexarrayCtors = require( './../../typed-complex-ctors' );
import complexarrayDataTypes = require( './../../typed-complex-dtypes' );
import typedarrayCtors = require( './../../typed-ctors' );
import typedarrayDataTypes = require( './../../typed-dtypes' );
import floatarrayCtors = require( './../../typed-float-ctors' );
import floatarrayDataTypes = require( './../../typed-float-dtypes' );
import intarrayCtors = require( './../../typed-integer-ctors' );
import intarrayDataTypes = require( './../../typed-integer-dtypes' );
import realarray = require( './../../typed-real' );
import realarrayCtors = require( './../../typed-real-ctors' );
import realarrayDataTypes = require( './../../typed-real-dtypes' );
import realarrayFloatCtors = require( './../../typed-real-float-ctors' );
import realarrayFloatDataTypes = require( './../../typed-real-float-dtypes' );
import intarraySignedCtors = require( './../../typed-signed-integer-ctors' );
import intarraySignedDataTypes = require( './../../typed-signed-integer-dtypes' );
import intarrayUnsignedCtors = require( './../../typed-unsigned-integer-ctors' );
import intarrayUnsignedDataTypes = require( './../../typed-unsigned-integer-dtypes' );
import Uint8Array = require( './../../uint8' );
import Uint8ClampedArray = require( './../../uint8c' );
import Uint16Array = require( './../../uint16' );
import Uint32Array = require( './../../uint32' );
import zeroTo = require( './../../zero-to' );
import zeroToLike = require( './../../zero-to-like' );
import zeros = require( './../../zeros' );
import zerosLike = require( './../../zeros-like' );
import constants = require( '@stdlib/constants/array' );
/**
* Interface describing the `array` namespace.
*/
interface Namespace {
/**
* Base (i.e., lower-level) array utilities.
*/
base: typeof base;
/**
* Boolean array constructor.
*
* @param arg - length, typed array, array-like object, or buffer
* @param byteOffset - byte offset (default: 0)
* @param length - view length
* @throws if provided only a single argument, must provide a valid argument
* @throws byte offset must be a nonnegative integer
* @throws must provide sufficient memory to accommodate byte offset and view length requirements
* @returns boolean array
*
* @example
* var arr = new ns.BooleanArray();
* // returns <ns.BooleanArray>
*
* var len = arr.length;
* // returns 0
*
* @example
* var arr = new ns.BooleanArray( 2 );
* // returns <ns.BooleanArray>
*
* var len = arr.length;
* // returns 2
*
* @example
* var arr = new ns.BooleanArray( [ true, false ] );
* // returns <ns.BooleanArray>
*
* var len = arr.length;
* // returns 2
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 16 );
* var arr = new ns.BooleanArray( buf );
* // returns <ns.BooleanArray>
*
* var len = arr.length;
* // returns 16
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 16 );
* var arr = new ns.BooleanArray( buf, 8 );
* // returns <ns.BooleanArray>
*
* var len = arr.length;
* // returns 8
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 32 );
* var arr = new ns.BooleanArray( buf, 8, 2 );
* // returns <ns.BooleanArray>
*
* var len = arr.length;
* // returns 2
*/
BooleanArray: typeof BooleanArray;
/**
* Constructor which returns an object used to represent a generic, fixed-length raw binary data buffer.
*/
ArrayBuffer: typeof ArrayBuffer;
/**
* Returns a list of byte orders.
*
* ## Notes
*
* - The output array contains the following orders:
*
* - little-endian: bytes are ordered from least-to-most significant byte.
* - big-endian: bytes are ordered from most-to-least significant byte.
*
* @returns list of byte orders
*
* @example
* var list = ns.byteOrders();
* // e.g., returns [ 'little-endian', 'big-endian' ]
*/
byteOrders: typeof byteOrders;
/**
* Returns the Cartesian power.
*
* ## Notes
*
* - If provided an empty array, the function returns an empty array.
* - If `n` is less than or equal to zero, the function returns an empty array.
*
* @param x - input array
* @param n - power
* @returns Cartesian product
*
* @example
* var x = [ 1, 2 ];
*
* var out = ns.cartesianPower( x, 2 );
* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]
*/
cartesianPower: typeof cartesianPower;
/**
* Returns the Cartesian product.
*
* ## Notes
*
* - If provided one or more empty arrays, the function returns an empty array.
*
* @param x1 - first input array
* @param x2 - second input array
* @returns Cartesian product
*
* @example
* var x1 = [ 1, 2, 3 ];
* var x2 = [ 4, 5 ];
*
* var out = ns.cartesianProduct( x1, x2 );
* // returns [ [ 1, 4 ], [ 1, 5 ], [ 2, 4 ], [ 2, 5 ], [ 3, 4 ], [ 3, 5 ] ]
*/
cartesianProduct: typeof cartesianProduct;
/**
* Returns the Cartesian square.
*
* ## Notes
*
* - If provided an empty array, the function returns an empty array.
*
* @param x - input array
* @returns Cartesian product
*
* @example
* var x = [ 1, 2 ];
*
* var out = ns.cartesianSquare( x );
* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]
*/
cartesianSquare: typeof cartesianSquare;
/**
* 64-bit complex number array constructor.
*
* @param arg - length, typed array, array-like object, or buffer
* @param byteOffset - byte offset (default: 0)
* @param length - view length
* @throws ArrayBuffer byte length must be a multiple of `8`
* @throws array-like object and typed array input arguments must have a length which is a multiple of two
* @throws if provided only a single argument, must provide a valid argument
* @throws byte offset must be a nonnegative integer
* @throws byte offset must be a multiple of `8`
* @throws view length must be a positive multiple of `8`
* @throws must provide sufficient memory to accommodate byte offset and view length requirements
* @throws an iterator must return either a two element array containing real and imaginary components or a complex number
* @returns complex number array
*
* @example
* var arr = new ns.Complex64Array();
* // returns <ns.Complex64Array>
*
* var len = arr.length;
* // returns 0
*
* @example
* var arr = new ns.Complex64Array( 2 );
* // returns <ns.Complex64Array>
*
* var len = arr.length;
* // returns 2
*
* @example
* var arr = new ns.Complex64Array( [ 1.0, -1.0 ] );
* // returns <ns.Complex64Array>
*
* var len = arr.length;
* // returns 1
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 16 );
* var arr = new ns.Complex64Array( buf );
* // returns <ns.Complex64Array>
*
* var len = arr.length;
* // returns 2
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 16 );
* var arr = new ns.Complex64Array( buf, 8 );
* // returns <ns.Complex64Array>
*
* var len = arr.length;
* // returns 1
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 32 );
* var arr = new ns.Complex64Array( buf, 8, 2 );
* // returns <ns.Complex64Array>
*
* var len = arr.length;
* // returns 2
*/
Complex64Array: typeof Complex64Array;
/**
* 128-bit complex number array constructor.
*
* @param arg - length, typed array, array-like object, or buffer
* @param byteOffset - byte offset (default: 0)
* @param length - view length
* @throws ArrayBuffer byte length must be a multiple of `8`
* @throws array-like object and typed array input arguments must have a length which is a multiple of two
* @throws if provided only a single argument, must provide a valid argument
* @throws byte offset must be a nonnegative integer
* @throws byte offset must be a multiple of `8`
* @throws view length must be a positive multiple of `8`
* @throws must provide sufficient memory to accommodate byte offset and view length requirements
* @throws an iterator must return either a two element array containing real and imaginary components or a complex number
* @returns complex number array
*
* @example
* var arr = new ns.Complex128Array();
* // returns <ns.Complex128Array>
*
* var len = arr.length;
* // returns 0
*
* @example
* var arr = new ns.Complex128Array( 2 );
* // returns <ns.Complex128Array>
*
* var len = arr.length;
* // returns 2
*
* @example
* var arr = new ns.Complex128Array( [ 1.0, -1.0 ] );
* // returns <ns.Complex128Array>
*
* var len = arr.length;
* // returns 1
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 16 );
* var arr = new ns.Complex128Array( buf );
* // returns <ns.Complex128Array>
*
* var len = arr.length;
* // returns 2
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 16 );
* var arr = new ns.Complex128Array( buf, 8 );
* // returns <ns.Complex128Array>
*
* var len = arr.length;
* // returns 1
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 32 );
* var arr = new ns.Complex128Array( buf, 8, 2 );
* // returns <ns.Complex128Array>
*
* var len = arr.length;
* // returns 2
*/
Complex128Array: typeof Complex128Array;
/**
* Converts an array to an array of a different data type.
*
* @param x - array to convert
* @param dtype - output data type
* @returns output array
*
* @example
* var arr = [ 1.0, 2.0, 3.0, 4.0 ];
* var out = ns.convert( arr, 'float64' );
* // returns <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]
*/
convert: typeof convert;
/**
* Converts an array to the same data type as a second input array.
*
* @param x - array to convert
* @param y - array having the desired output data type
* @returns output array
*
* @example
* var Float64Array = require( './../../float64' );
*
* var x = [ 1.0, 2.0, 3.0, 4.0 ];
* var y = new Float64Array( 0 );
*
* var out = ns.convertSame( x, y );
* // returns <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]
*/
convertSame: typeof convertSame;
/**
* Returns an array constructor.
*
* @param dtype - data type
* @returns constructor or null
*
* @example
* var ctor = ns.ctors( 'float64' );
* // returns <Function>
*
* @example
* var ctor = ns.ctors( 'float' );
* // returns null
*/
ctors: typeof ctors;
/**
* Constructor which returns a data view representing a provided array buffer.
*/
DataView: typeof DataView;
/**
* Generates an array of linearly spaced dates.
*
* @param start - start time as either a `Date` object, Unix timestamp, JavaScript timestamp, or date string
* @param stop - stop time as either a `Date` object, Unix timestamp, JavaScript timestamp, or date string
* @param length - output array length (default: 100)
* @param options - function options
* @param options.round - specifies how sub-millisecond times should be rounded: [ 'floor', 'ceil', 'round' ] (default: 'floor' )
* @throws length argument must a positive integer
* @throws must provide valid options
* @returns array of dates
*
* @example
* var stop = '2014-12-02T07:00:54.973Z';
* var start = new Date( stop ) - 60000;
*
* var arr = ns.datespace( start, stop, 6 );
* // returns [...]
*
* @example
* // Equivalent of Math.ceil():
* var arr = ns.datespace( 1417503655000, 1417503655001, 3, { 'round': 'ceil' } );
* // returns [...]
*
* // Equivalent of Math.round():
* var arr = ns.datespace( 1417503655000, 1417503655001, 3, { 'round': 'round' } );
* // returns [...]
*/
datespace: typeof datespace;
/**
* Returns default ndarray settings.
*
* @returns default settings
*
* @example
* var o = ns.defaults();
* // returns {...}
*/
defaults: typeof defaults;
/**
* Returns the data type of an array.
*
* ## Notes
*
* - If provided an argument having an unknown or unsupported type, the function returns `null`.
*
* @param value - input value
* @returns data type
*
* @example
* var dt = ns.dtype( [ 1, 2, 3 ] );
* // returns 'generic'
*
* var dt = ns.dtype( 'beep' );
* // returns null
*/
dtype: typeof dtype;
/**
* Returns a list of array data types.
*
* @param kind - data type kind
* @returns list of array data types
*
* @example
* var list = ns.dtypes();
* // e.g., returns [ 'float32', 'float64', ... ]
*
* @example
* var list = ns.dtypes( 'floating_point' );
* // returns [...]
*/
dtypes: typeof dtypes;
/**
* Creates an uninitialized array having a specified length.
*
* ## Notes
*
* - In browser environments, the function always returns zero-filled arrays.
* - If `dtype` is `'generic'`, the function always returns a zero-filled array.
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
*
* @param length - array length
* @param dtype - data type (default: 'float64')
* @returns empty array
*
* @example
* var arr = ns.empty( 2 );
* // returns <Float64Array>
*
* @example
* var arr = ns.empty( 2, 'float32' );
* // returns <Float32Array>
*/
empty: typeof empty;
/**
* Creates an uninitialized array having the same length as a provided input array.
*
* ## Notes
*
* - In browser environments, the function always returns zero-filled arrays.
* - If `dtype` is `'generic'`, the function always returns a zero-filled array.
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
*
* @param x - input array from which to derive the output array length
* @param dtype - data type
* @returns empty array
*
* @example
* var zeros = require( './../../zeros' );
*
* var x = zeros( 2, 'float64' );
* // returns <Float32Array>[ 0.0, 0.0 ]
*
* var arr = ns.emptyLike( x, 'float32' );
* // returns <Float32Array>
*/
emptyLike: typeof emptyLike;
/**
* Returns a filled typed array view of an `ArrayBuffer`.
*
* ## Notes
*
* - Creating a generic array from an `ArrayBuffer` is **not** supported.
*
* @param value - fill value
* @param buffer - `ArrayBuffer`
* @param dtype - data type (default: 'float64')
* @returns filled array
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 32 );
* var arr = ns.filled( 1.0, buf );
* // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0 ]
*
* @example
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 32 );
* var arr = ns.filled( 1.0, buf, 'float32' );
* // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
*/
filled: typeof filled;
/**
* Returns a filled typed array view of an `ArrayBuffer` according to a provided callback function.
*
* ## Notes
*
* - Creating a generic array from an `ArrayBuffer` is **not** supported.
*
* @param buffer - `ArrayBuffer`
* @param dtype - data type
* @param clbk - callback function
* @param thisArg - callback function execution context
* @returns filled array
*
* @example
* var constantFunction = require( '@stdlib/utils/constant-function' );
* var ArrayBuffer = require( './../../buffer' );
*
* var buf = new ArrayBuffer( 32 );
* var arr = ns.filledBy( buf, 'float64', constantFunction( 1.0 ) );
* // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0 ]
*/
filledBy: typeof filledBy;
/**
* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.
*/
Float32Array: typeof Float32Array;
/**
* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.
*/
Float64Array: typeof Float64Array;
/**
* Fills an array from an iterator.
*
* @param iterator - source iterator
* @param out - output array
* @param mapFcn - function to invoke for each iterated value
* @param thisArg - execution context
* @returns output array
*
* @example
* var Float64Array = require( './../../float64' );
* var randu = require( '@stdlib/random/iter/randu' );
*
* function scale( v ) {
* return v * 2.0;
* }
*
* var iter = randu({
* 'iter': 10
* });
*
* var out = new Float64Array( 10 );
* var arr = ns.iterator2array( iter, out, scale );
* // returns <Array>
*/
iterator2array: typeof iterator2array;
/**
* Returns a single-element array containing a provided scalar value.
*
* ## Notes
*
* - If a `dtype` argument is not provided and `value`
*
* - is a number, the default data type is the default real-valued floating-point data type.
* - is a boolean, the default data type is the default boolean data type.
* - is a complex number object of a known complex data type, the data type is the same as the provided value.
* - is a complex number object of an unknown complex data type, the default data type is the default complex-valued floating-point data type.
* - is any other value type, the default data type is `'generic'`.
*
* @param value - scalar value
* @param dtype - output array data type
* @returns output array
*
* @example
* var x = ns.scalar2array( 1.0, generic' );
* // returns [ 1.0 ]
*/
scalar2array: typeof scalar2array;
/**
* Creates a filled array having a specified length.
*
* @param length - array length
* @param value - fill value
* @param dtype - data type (default: 'float64')
* @returns filled array
*
* @example
* var arr = ns.full( 2, 1.0 );
* // returns <Float64Array>[ 1.0, 1.0 ]
*
* @example
* var arr = ns.full( 2, 1.0, 'float32' );
* // returns <Float32Array>[ 1.0, 1.0 ]
*/
full: typeof full;
/**
* Creates a filled array having the same length and data type as a provided input array.
*
* @param x - input array from which to derive the output array length
* @param value - fill value
* @param dtype - data type
* @returns filled array
*
* @example
* var zeros = require( './../../zeros' );
*
* var x = zeros( 2, 'float64' );
* // returns <Float64Array>[ 0.0, 0.0 ]
*
* var y = ns.fullLike( x, 1.0 );
* // returns <Float64Array>[ 1.0, 1.0 ]
*
* @example
* var zeros = require( './../../zeros' );
*
* var x = zeros( 2, 'float64' );
* // returns <Float64Array>[ 0.0, 0.0 ]
*
* var y = ns.fullLike( x, 1.0, 'float32' );
* // returns <Float32Array>[ 1.0, 1.0 ]
*/
fullLike: typeof fullLike;
/**
* Generates a linearly spaced numeric array using a provided increment.
*
* @param x1 - first array value
* @param x2 - array element bound
* @param increment - increment (default: 1)
* @throws length of created array must be less than `4294967295` (`2**32 - 1`)
* @returns linearly spaced numeric array
*
* @example
* var arr = ns.incrspace( 0, 11, 2 );
* // returns [ 0, 2, 4, 6, 8, 10 ]
*/
incrspace: typeof incrspace;
/**
* Array index constructor.
*
* @param x - input array
* @param options - function options
* @param options.persist - boolean indicating whether to continue persisting an index object after first usage
* @returns ArrayIndex instance
*
* @example
* var Uint8Array = require( './../../uint8' );
*
* var x = new Uint8Array( [ 1, 0, 1, 0 ] );
*
* var idx = new ns.ArrayIndex( x );
* // returns <ns.ArrayIndex>
*/
ArrayIndex: typeof ArrayIndex;
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.
*/
Int8Array: typeof Int8Array;
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.
*/
Int16Array: typeof Int16Array;
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.
*/
Int32Array: typeof Int32Array;
/**
* Generates a linearly spaced array over a specified interval.
*
* @param start - start of interval
* @param stop - end of interval
* @param len - length of output array
* @param options - function options
* @param options.dtype - output array data type
* @param options.endpoint - `boolean` indicating whether to include the `stop` value in the output array
* @returns linearly spaced array
*
* @example
* var arr = ns.linspace( 0.0, 100.0, 6 );
* // returns <Float64Array>[ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ]
*
* @example
* var Float32Array = require( './../../float32' );
*
* var arr = new Float32Array( 6 );
* var out = ns.linspace.assign( 0.0, 100.0, arr );
* // returns <Float32Array>[ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ]
*
* var bool = ( arr === out );
* // returns true
*/
linspace: typeof linspace;
/**
* Generates a logarithmically spaced numeric array.
*
* @param a - exponent of start value
* @param b - exponent of end value
* @param len - length of output array (default: 10)
* @throws third argument must be a nonnegative integer
* @returns logarithmically spaced numeric array
*
* @example
* var arr = ns.logspace( 0, 2, 6 );
* // returns [ 1, ~2.5, ~6.31, ~15.85, ~39.81, 100 ]
*/
logspace: typeof logspace;
/**
* Returns the minimum array data type of the closest "kind" necessary for storing a provided scalar value.
*
* ## Notes
*
* - The function does *not* provide precision guarantees for non-integer-valued numbers. In other words, the function returns the smallest possible floating-point (i.e., inexact) data type for storing numbers having decimals.
*
* @param value - scalar value
* @returns array data type
*
* @example
* var dt = ns.minDataType( 'beep' );
* // returns 'generic'
*/
minDataType: typeof minDataType;
/**
* Returns a list of array data types to which a provided array data type can be safely cast and, for floating-point data types, can be downcast.
*
* ## Notes
*
* - If not provided an array data type, the function returns a casting table.
* - If provided an unrecognized array data type, the function returns `null`.
*
* @param dtype - array data type value
* @returns list of array data types or null
*
* @example
* var list = ns.mostlySafeCasts( 'float32' );
* // returns [...]
*/
mostlySafeCasts: typeof mostlySafeCasts;
/**
* Returns a new array by applying a mask to a provided input array.
*
* @param x - input array
* @param mask - mask array
* @returns output array
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var y = ns.mskfilter( x, [ 0, 1, 0, 1 ] );
* // returns [ 2, 4 ]
*/
mskfilter: typeof mskfilter;
/**
* Replaces elements of an array with provided values according to a provided mask array.
*
* @param x - input array
* @param mask - mask array
* @param values - values to set
* @param options - function options
* @returns input array
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var mask = [ 1, 0, 0, 1 ];
* var values = [ 20, 30 ];
*
* var out = ns.mskput( x, mask, values );
* // returns [ 1, 20, 30, 4 ]
*
* var bool = ( out === x );
* // returns true
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var out = ns.mskput( x, [ 1, 0, 0, 1 ], [ 30 ] );
* // returns [ 1, 30, 30, 4 ]
*
* var bool = ( out === x );
* // returns true
*/
mskput: typeof mskput;
/**
* Returns a new array by applying a mask to a provided input array.
*
* @param x - input array
* @param mask - mask array
* @returns output array
*
* @example
* var x = [ 1, 2, 3, 4 ];
*
* var y = ns.mskreject( x, [ 0, 1, 0, 1 ] );
* // returns [ 1, 3 ]
*/
mskreject: typeof mskreject;
/**
* Creates an array filled with NaNs and having a specified length.
*
* The function recognizes the following data types:
*
* - `float64`: double-precision floating-point numbers (IEEE 754)
* - `float32`: single-precision floating-point numbers (IEEE 754)
* - `complex128`: double-precision complex floating-point numbers
* - `complex64`: single-precision complex floating-point numbers
* - `generic`: generic JavaScript values
*
* @param length - array length
* @param dtype - data type (default: 'float64')
* @returns filled array
*
* @example
* var arr = ns.nans( 2 );
* // returns <Float64Array>[ NaN, NaN ]
*
* @example
* var arr = ns.nans( 2, 'float32' );
* // returns <Float32Array>[ NaN, NaN ]
*/
nans: typeof nans;
/**
* Creates an array filled with NaNs and having the same length and data type as a provided input array.
*
* The function supports the following data types:
*
* - `float64`: double-precision floating-point numbers (IEEE 754)
* - `float32`: single-precision floating-point numbers (IEEE 754)
* - `complex128`: double-precision complex floating-point numbers
* - `complex64`: single-precision complex floating-point numbers
* - `generic`: generic JavaScript values
*
* @param x - input array from which to derive the output array length
* @param dtype - data type
* @returns filled array
*
* @example
* var zeros = require( './../../zeros' );
*
* var x = zeros( 2, 'float64' );
* // returns <Float64Array>[ 0.0, 0.0 ]
*
* var y = ns.nansLike( x );
* // returns <Float64Array>[ NaN, NaN ]
*
* @example
* var zeros = require( './../../zeros' );
*
* var x = zeros( 2, 'float64' );
* // returns <Float64Array>[ 0.0, 0.0 ]
*
* var y = ns.nansLike( x, 'float32' );
* // returns <Float32Array>[ NaN, NaN ]
*/
nansLike: typeof nansLike;
/**
* Returns the next larger array data type of the same kind.
*
* ## Notes
*
* - If not provided a data type, the function returns a table.
* - If a data type does not have a next larger data type or the next larger type is not supported, the function returns `-1`.
* - If provided an unrecognized data type, the function returns `null`.
*
* @param dtype - array data type
* @returns next larger data type(s) or null
*