@stdlib/ndarray-zeros-like 0.0.1

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.
@@ -0,0 +1,1037 @@
1
+ // tslint:disable:max-file-line-count
2
+
3
+ /*
4
+ * @license Apache-2.0
5
+ *
6
+ * Copyright (c) 2022 The Stdlib Authors.
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+
21
+ // TypeScript Version: 2.0
22
+
23
+ /// <reference types="@stdlib/types"/>
24
+
25
+ import { Shape, Order, ndarray, typedndarray, float64ndarray, float32ndarray, int32ndarray, int16ndarray, int8ndarray, uint32ndarray, uint16ndarray, uint8ndarray, uint8cndarray, complex128ndarray, complex64ndarray, DataType } from '@stdlib/types/ndarray';
26
+
27
+ /**
28
+ * Interface describing function options.
29
+ */
30
+ interface Options {
31
+ /**
32
+ * Array order (either 'row-major' (C-style) or 'column-major' (Fortran-style)).
33
+ *
34
+ * ## Notes
35
+ *
36
+ * - If provided, this option overrides the input array's inferred order.
37
+ */
38
+ order?: Order;
39
+
40
+ /**
41
+ * Array shape.
42
+ *
43
+ * ## Notes
44
+ *
45
+ * - If provided, this option overrides the input array's inferred shape.
46
+ */
47
+ shape?: Shape | number;
48
+ }
49
+
50
+ /**
51
+ * Interface describing function options.
52
+ */
53
+ interface Float64Options extends Options {
54
+ /**
55
+ * Underlying data type.
56
+ *
57
+ * ## Notes
58
+ *
59
+ * - This option overrides the input array's inferred data type.
60
+ */
61
+ dtype: 'float64';
62
+ }
63
+
64
+ /**
65
+ * Interface describing function options.
66
+ */
67
+ interface Float32Options extends Options {
68
+ /**
69
+ * Underlying data type.
70
+ *
71
+ * ## Notes
72
+ *
73
+ * - This option overrides the input array's inferred data type.
74
+ */
75
+ dtype: 'float32';
76
+ }
77
+
78
+ /**
79
+ * Interface describing function options.
80
+ */
81
+ interface Complex128Options extends Options {
82
+ /**
83
+ * Underlying data type.
84
+ *
85
+ * ## Notes
86
+ *
87
+ * - This option overrides the input array's inferred data type.
88
+ */
89
+ dtype: 'complex128';
90
+ }
91
+
92
+ /**
93
+ * Interface describing function options.
94
+ */
95
+ interface Complex64Options extends Options {
96
+ /**
97
+ * Underlying data type.
98
+ *
99
+ * ## Notes
100
+ *
101
+ * - This option overrides the input array's inferred data type.
102
+ */
103
+ dtype: 'complex64';
104
+ }
105
+
106
+ /**
107
+ * Interface describing function options.
108
+ */
109
+ interface Int32Options extends Options {
110
+ /**
111
+ * Underlying data type.
112
+ *
113
+ * ## Notes
114
+ *
115
+ * - This option overrides the input array's inferred data type.
116
+ */
117
+ dtype: 'int32';
118
+ }
119
+
120
+ /**
121
+ * Interface describing function options.
122
+ */
123
+ interface Int16Options extends Options {
124
+ /**
125
+ * Underlying data type.
126
+ *
127
+ * ## Notes
128
+ *
129
+ * - This option overrides the input array's inferred data type.
130
+ */
131
+ dtype: 'int16';
132
+ }
133
+
134
+ /**
135
+ * Interface describing function options.
136
+ */
137
+ interface Int8Options extends Options {
138
+ /**
139
+ * Underlying data type.
140
+ *
141
+ * ## Notes
142
+ *
143
+ * - This option overrides the input array's inferred data type.
144
+ */
145
+ dtype: 'int8';
146
+ }
147
+
148
+ /**
149
+ * Interface describing function options.
150
+ */
151
+ interface Uint32Options extends Options {
152
+ /**
153
+ * Underlying data type.
154
+ *
155
+ * ## Notes
156
+ *
157
+ * - This option overrides the input array's inferred data type.
158
+ */
159
+ dtype: 'uint32';
160
+ }
161
+
162
+ /**
163
+ * Interface describing function options.
164
+ */
165
+ interface Uint16Options extends Options {
166
+ /**
167
+ * Underlying data type.
168
+ *
169
+ * ## Notes
170
+ *
171
+ * - This option overrides the input array's inferred data type.
172
+ */
173
+ dtype: 'uint16';
174
+ }
175
+
176
+ /**
177
+ * Interface describing function options.
178
+ */
179
+ interface Uint8Options extends Options {
180
+ /**
181
+ * Underlying data type.
182
+ *
183
+ * ## Notes
184
+ *
185
+ * - This option overrides the input array's inferred data type.
186
+ */
187
+ dtype: 'uint8';
188
+ }
189
+
190
+ /**
191
+ * Interface describing function options.
192
+ */
193
+ interface Uint8COptions extends Options {
194
+ /**
195
+ * Underlying data type.
196
+ *
197
+ * ## Notes
198
+ *
199
+ * - This option overrides the input array's inferred data type.
200
+ */
201
+ dtype: 'uint8c';
202
+ }
203
+
204
+ /**
205
+ * Interface describing function options.
206
+ */
207
+ interface OptionsWithDType extends Options {
208
+ /**
209
+ * Underlying data type.
210
+ *
211
+ * ## Notes
212
+ *
213
+ * - This option overrides the input array's inferred data type.
214
+ */
215
+ dtype: DataType;
216
+ }
217
+
218
+ /**
219
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
220
+ *
221
+ * @param x - input array
222
+ * @param options - options
223
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
224
+ * @param options.shape - output array shape
225
+ * @returns zero-filled array
226
+ *
227
+ * @example
228
+ * var zeros = require( `@stdlib/ndarray/zeros` );
229
+ *
230
+ * var x = zeros( [ 2, 2 ], {
231
+ * 'dtype': 'float64'
232
+ * });
233
+ * // returns <ndarray>
234
+ *
235
+ * var sh = x.shape;
236
+ * // returns [ 2, 2 ]
237
+ *
238
+ * var dt = x.dtype;
239
+ * // returns 'float64'
240
+ *
241
+ * var y = zerosLike( x );
242
+ * // returns <ndarray>
243
+ *
244
+ * sh = y.shape;
245
+ * // returns [ 2, 2 ]
246
+ *
247
+ * dt = y.dtype;
248
+ * // returns 'float64'
249
+ */
250
+ declare function zerosLike( x: float64ndarray, options?: Options ): float64ndarray; // tslint:disable-line:max-line-length
251
+
252
+ /**
253
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
254
+ *
255
+ * @param x - input array
256
+ * @param options - options
257
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
258
+ * @param options.shape - output array shape
259
+ * @returns zero-filled array
260
+ *
261
+ * @example
262
+ * var zeros = require( `@stdlib/ndarray/zeros` );
263
+ *
264
+ * var x = zeros( [ 2, 2 ], {
265
+ * 'dtype': 'float32'
266
+ * });
267
+ * // returns <ndarray>
268
+ *
269
+ * var sh = x.shape;
270
+ * // returns [ 2, 2 ]
271
+ *
272
+ * var dt = x.dtype;
273
+ * // returns 'float32'
274
+ *
275
+ * var y = zerosLike( x );
276
+ * // returns <ndarray>
277
+ *
278
+ * sh = y.shape;
279
+ * // returns [ 2, 2 ]
280
+ *
281
+ * dt = y.dtype;
282
+ * // returns 'float32'
283
+ */
284
+ declare function zerosLike( x: float32ndarray, options?: Options ): float32ndarray; // tslint:disable-line:max-line-length
285
+
286
+ /**
287
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
288
+ *
289
+ * @param x - input array
290
+ * @param options - options
291
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
292
+ * @param options.shape - output array shape
293
+ * @returns zero-filled array
294
+ *
295
+ * @example
296
+ * var zeros = require( `@stdlib/ndarray/zeros` );
297
+ *
298
+ * var x = zeros( [ 2, 2 ], {
299
+ * 'dtype': 'complex128'
300
+ * });
301
+ * // returns <ndarray>
302
+ *
303
+ * var sh = x.shape;
304
+ * // returns [ 2, 2 ]
305
+ *
306
+ * var dt = x.dtype;
307
+ * // returns 'complex128'
308
+ *
309
+ * var y = zerosLike( x );
310
+ * // returns <ndarray>
311
+ *
312
+ * sh = y.shape;
313
+ * // returns [ 2, 2 ]
314
+ *
315
+ * dt = y.dtype;
316
+ * // returns 'complex128'
317
+ */
318
+ declare function zerosLike( x: complex128ndarray, options?: Options ): complex128ndarray; // tslint:disable-line:max-line-length
319
+
320
+ /**
321
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
322
+ *
323
+ * @param x - input array
324
+ * @param options - options
325
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
326
+ * @param options.shape - output array shape
327
+ * @returns zero-filled array
328
+ *
329
+ * @example
330
+ * var zeros = require( `@stdlib/ndarray/zeros` );
331
+ *
332
+ * var x = zeros( [ 2, 2 ], {
333
+ * 'dtype': 'complex64'
334
+ * });
335
+ * // returns <ndarray>
336
+ *
337
+ * var sh = x.shape;
338
+ * // returns [ 2, 2 ]
339
+ *
340
+ * var dt = x.dtype;
341
+ * // returns 'complex64'
342
+ *
343
+ * var y = zerosLike( x );
344
+ * // returns <ndarray>
345
+ *
346
+ * sh = y.shape;
347
+ * // returns [ 2, 2 ]
348
+ *
349
+ * dt = y.dtype;
350
+ * // returns 'complex64'
351
+ */
352
+ declare function zerosLike( x: complex64ndarray, options?: Options ): complex64ndarray; // tslint:disable-line:max-line-length
353
+
354
+ /**
355
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
356
+ *
357
+ * @param x - input array
358
+ * @param options - options
359
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
360
+ * @param options.shape - output array shape
361
+ * @returns zero-filled array
362
+ *
363
+ * @example
364
+ * var zeros = require( `@stdlib/ndarray/zeros` );
365
+ *
366
+ * var x = zeros( [ 2, 2 ], {
367
+ * 'dtype': 'int32'
368
+ * });
369
+ * // returns <ndarray>
370
+ *
371
+ * var sh = x.shape;
372
+ * // returns [ 2, 2 ]
373
+ *
374
+ * var dt = x.dtype;
375
+ * // returns 'int32'
376
+ *
377
+ * var y = zerosLike( x );
378
+ * // returns <ndarray>
379
+ *
380
+ * sh = y.shape;
381
+ * // returns [ 2, 2 ]
382
+ *
383
+ * dt = y.dtype;
384
+ * // returns 'int32'
385
+ */
386
+ declare function zerosLike( x: int32ndarray, options?: Options ): int32ndarray;
387
+
388
+ /**
389
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
390
+ *
391
+ * @param x - input array
392
+ * @param options - options
393
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
394
+ * @param options.shape - output array shape
395
+ * @returns zero-filled array
396
+ *
397
+ * @example
398
+ * var zeros = require( `@stdlib/ndarray/zeros` );
399
+ *
400
+ * var x = zeros( [ 2, 2 ], {
401
+ * 'dtype': 'int16'
402
+ * });
403
+ * // returns <ndarray>
404
+ *
405
+ * var sh = x.shape;
406
+ * // returns [ 2, 2 ]
407
+ *
408
+ * var dt = x.dtype;
409
+ * // returns 'int16'
410
+ *
411
+ * var y = zerosLike( x );
412
+ * // returns <ndarray>
413
+ *
414
+ * sh = y.shape;
415
+ * // returns [ 2, 2 ]
416
+ *
417
+ * dt = y.dtype;
418
+ * // returns 'int16'
419
+ */
420
+ declare function zerosLike( x: int16ndarray, options?: Options ): int16ndarray;
421
+
422
+ /**
423
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
424
+ *
425
+ * @param x - input array
426
+ * @param options - options
427
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
428
+ * @param options.shape - output array shape
429
+ * @returns zero-filled array
430
+ *
431
+ * @example
432
+ * var zeros = require( `@stdlib/ndarray/zeros` );
433
+ *
434
+ * var x = zeros( [ 2, 2 ], {
435
+ * 'dtype': 'int8'
436
+ * });
437
+ * // returns <ndarray>
438
+ *
439
+ * var sh = x.shape;
440
+ * // returns [ 2, 2 ]
441
+ *
442
+ * var dt = x.dtype;
443
+ * // returns 'int8'
444
+ *
445
+ * var y = zerosLike( x );
446
+ * // returns <ndarray>
447
+ *
448
+ * sh = y.shape;
449
+ * // returns [ 2, 2 ]
450
+ *
451
+ * dt = y.dtype;
452
+ * // returns 'int8'
453
+ */
454
+ declare function zerosLike( x: int8ndarray, options?: Options ): int8ndarray;
455
+
456
+ /**
457
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
458
+ *
459
+ * @param x - input array
460
+ * @param options - options
461
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
462
+ * @param options.shape - output array shape
463
+ * @returns zero-filled array
464
+ *
465
+ * @example
466
+ * var zeros = require( `@stdlib/ndarray/zeros` );
467
+ *
468
+ * var x = zeros( [ 2, 2 ], {
469
+ * 'dtype': 'uint32'
470
+ * });
471
+ * // returns <ndarray>
472
+ *
473
+ * var sh = x.shape;
474
+ * // returns [ 2, 2 ]
475
+ *
476
+ * var dt = x.dtype;
477
+ * // returns 'uint32'
478
+ *
479
+ * var y = zerosLike( x );
480
+ * // returns <ndarray>
481
+ *
482
+ * sh = y.shape;
483
+ * // returns [ 2, 2 ]
484
+ *
485
+ * dt = y.dtype;
486
+ * // returns 'uint32'
487
+ */
488
+ declare function zerosLike( x: uint32ndarray, options?: Options ): uint32ndarray; // tslint:disable-line:max-line-length
489
+
490
+ /**
491
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
492
+ *
493
+ * @param x - input array
494
+ * @param options - options
495
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
496
+ * @param options.shape - output array shape
497
+ * @returns zero-filled array
498
+ *
499
+ * @example
500
+ * var zeros = require( `@stdlib/ndarray/zeros` );
501
+ *
502
+ * var x = zeros( [ 2, 2 ], {
503
+ * 'dtype': 'uint16'
504
+ * });
505
+ * // returns <ndarray>
506
+ *
507
+ * var sh = x.shape;
508
+ * // returns [ 2, 2 ]
509
+ *
510
+ * var dt = x.dtype;
511
+ * // returns 'uint16'
512
+ *
513
+ * var y = zerosLike( x );
514
+ * // returns <ndarray>
515
+ *
516
+ * sh = y.shape;
517
+ * // returns [ 2, 2 ]
518
+ *
519
+ * dt = y.dtype;
520
+ * // returns 'uint16'
521
+ */
522
+ declare function zerosLike( x: uint16ndarray, options?: Options ): uint16ndarray; // tslint:disable-line:max-line-length
523
+
524
+ /**
525
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
526
+ *
527
+ * @param x - input array
528
+ * @param options - options
529
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
530
+ * @param options.shape - output array shape
531
+ * @returns zero-filled array
532
+ *
533
+ * @example
534
+ * var zeros = require( `@stdlib/ndarray/zeros` );
535
+ *
536
+ * var x = zeros( [ 2, 2 ], {
537
+ * 'dtype': 'uint8'
538
+ * });
539
+ * // returns <ndarray>
540
+ *
541
+ * var sh = x.shape;
542
+ * // returns [ 2, 2 ]
543
+ *
544
+ * var dt = x.dtype;
545
+ * // returns 'uint8'
546
+ *
547
+ * var y = zerosLike( x );
548
+ * // returns <ndarray>
549
+ *
550
+ * sh = y.shape;
551
+ * // returns [ 2, 2 ]
552
+ *
553
+ * dt = y.dtype;
554
+ * // returns 'uint8'
555
+ */
556
+ declare function zerosLike( x: uint8ndarray, options?: Options ): uint8ndarray;
557
+
558
+ /**
559
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
560
+ *
561
+ * @param x - input array
562
+ * @param options - options
563
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
564
+ * @param options.shape - output array shape
565
+ * @returns zero-filled array
566
+ *
567
+ * @example
568
+ * var zeros = require( `@stdlib/ndarray/zeros` );
569
+ *
570
+ * var x = zeros( [ 2, 2 ], {
571
+ * 'dtype': 'uint8c'
572
+ * });
573
+ * // returns <ndarray>
574
+ *
575
+ * var sh = x.shape;
576
+ * // returns [ 2, 2 ]
577
+ *
578
+ * var dt = x.dtype;
579
+ * // returns 'uint8c'
580
+ *
581
+ * var y = zerosLike( x );
582
+ * // returns <ndarray>
583
+ *
584
+ * sh = y.shape;
585
+ * // returns [ 2, 2 ]
586
+ *
587
+ * dt = y.dtype;
588
+ * // returns 'uint8c'
589
+ */
590
+ declare function zerosLike( x: uint8cndarray, options?: Options ): uint8cndarray; // tslint:disable-line:max-line-length
591
+
592
+ /**
593
+ * Creates a zero-filled double-precision floating-point array having the same shape as a provided input ndarray.
594
+ *
595
+ * @param x - input array
596
+ * @param options - options
597
+ * @param options.dtype - output array data type
598
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
599
+ * @param options.shape - output array shape
600
+ * @returns zero-filled array
601
+ *
602
+ * @example
603
+ * var zeros = require( `@stdlib/ndarray/zeros` );
604
+ *
605
+ * var x = zeros( [ 2, 2 ], {
606
+ * 'dtype': 'generic'
607
+ * });
608
+ * // returns <ndarray>
609
+ *
610
+ * var sh = x.shape;
611
+ * // returns [ 2, 2 ]
612
+ *
613
+ * var dt = x.dtype;
614
+ * // returns 'generic'
615
+ *
616
+ * var y = zerosLike( x, {
617
+ * 'dtype': 'float64'
618
+ * });
619
+ * // returns <ndarray>
620
+ *
621
+ * sh = y.shape;
622
+ * // returns [ 2, 2 ]
623
+ *
624
+ * dt = y.dtype;
625
+ * // returns 'float64'
626
+ */
627
+ declare function zerosLike( x: ndarray, options: Float64Options ): float64ndarray; // tslint:disable-line:max-line-length
628
+
629
+ /**
630
+ * Creates a zero-filled single-precision floating-point array having the same shape as a provided input ndarray.
631
+ *
632
+ * @param x - input array
633
+ * @param options - options
634
+ * @param options.dtype - output array data type
635
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
636
+ * @param options.shape - output array shape
637
+ * @returns zero-filled array
638
+ *
639
+ * @example
640
+ * var zeros = require( `@stdlib/ndarray/zeros` );
641
+ *
642
+ * var x = zeros( [ 2, 2 ], {
643
+ * 'dtype': 'float64'
644
+ * });
645
+ * // returns <ndarray>
646
+ *
647
+ * var sh = x.shape;
648
+ * // returns [ 2, 2 ]
649
+ *
650
+ * var dt = x.dtype;
651
+ * // returns 'float64'
652
+ *
653
+ * var y = zerosLike( x, {
654
+ * 'dtype': 'float32'
655
+ * });
656
+ * // returns <ndarray>
657
+ *
658
+ * sh = y.shape;
659
+ * // returns [ 2, 2 ]
660
+ *
661
+ * dt = y.dtype;
662
+ * // returns 'float32'
663
+ */
664
+ declare function zerosLike( x: ndarray, options: Float32Options ): float32ndarray; // tslint:disable-line:max-line-length
665
+
666
+ /**
667
+ * Creates a zero-filled double-precision complex floating-point array having the same shape as a provided input ndarray.
668
+ *
669
+ * @param x - input array
670
+ * @param options - options
671
+ * @param options.dtype - output array data type
672
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
673
+ * @param options.shape - output array shape
674
+ * @returns zero-filled array
675
+ *
676
+ * @example
677
+ * var zeros = require( `@stdlib/ndarray/zeros` );
678
+ *
679
+ * var x = zeros( [ 2, 2 ], {
680
+ * 'dtype': 'float64'
681
+ * });
682
+ * // returns <ndarray>
683
+ *
684
+ * var sh = x.shape;
685
+ * // returns [ 2, 2 ]
686
+ *
687
+ * var dt = x.dtype;
688
+ * // returns 'float64'
689
+ *
690
+ * var y = zerosLike( x, {
691
+ * 'dtype': 'complex128'
692
+ * });
693
+ * // returns <ndarray>
694
+ *
695
+ * sh = y.shape;
696
+ * // returns [ 2, 2 ]
697
+ *
698
+ * dt = y.dtype;
699
+ * // returns 'complex128'
700
+ */
701
+ declare function zerosLike( x: ndarray, options: Complex128Options ): complex128ndarray; // tslint:disable-line:max-line-length
702
+
703
+ /**
704
+ * Creates a zero-filled single-precision complex floating-point array having the same shape as a provided input ndarray.
705
+ *
706
+ * @param x - input array
707
+ * @param options - options
708
+ * @param options.dtype - output array data type
709
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
710
+ * @param options.shape - output array shape
711
+ * @returns zero-filled array
712
+ *
713
+ * @example
714
+ * var zeros = require( `@stdlib/ndarray/zeros` );
715
+ *
716
+ * var x = zeros( [ 2, 2 ], {
717
+ * 'dtype': 'float64'
718
+ * });
719
+ * // returns <ndarray>
720
+ *
721
+ * var sh = x.shape;
722
+ * // returns [ 2, 2 ]
723
+ *
724
+ * var dt = x.dtype;
725
+ * // returns 'float64'
726
+ *
727
+ * var y = zerosLike( x, {
728
+ * 'dtype': 'complex64'
729
+ * });
730
+ * // returns <ndarray>
731
+ *
732
+ * sh = y.shape;
733
+ * // returns [ 2, 2 ]
734
+ *
735
+ * dt = y.dtype;
736
+ * // returns 'complex64'
737
+ */
738
+ declare function zerosLike( x: ndarray, options: Complex64Options ): complex64ndarray; // tslint:disable-line:max-line-length
739
+
740
+ /**
741
+ * Creates a zero-filled 32-bit signed integer array having the same shape as a provided input ndarray.
742
+ *
743
+ * @param x - input array
744
+ * @param options - options
745
+ * @param options.dtype - output array data type
746
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
747
+ * @param options.shape - output array shape
748
+ * @returns zero-filled array
749
+ *
750
+ * @example
751
+ * var zeros = require( `@stdlib/ndarray/zeros` );
752
+ *
753
+ * var x = zeros( [ 2, 2 ], {
754
+ * 'dtype': 'float64'
755
+ * });
756
+ * // returns <ndarray>
757
+ *
758
+ * var sh = x.shape;
759
+ * // returns [ 2, 2 ]
760
+ *
761
+ * var dt = x.dtype;
762
+ * // returns 'float64'
763
+ *
764
+ * var y = zerosLike( x, {
765
+ * 'dtype': 'int32'
766
+ * });
767
+ * // returns <ndarray>
768
+ *
769
+ * sh = y.shape;
770
+ * // returns [ 2, 2 ]
771
+ *
772
+ * dt = y.dtype;
773
+ * // returns 'int32'
774
+ */
775
+ declare function zerosLike( x: ndarray, options: Int32Options ): int32ndarray;
776
+
777
+ /**
778
+ * Creates a zero-filled 16-bit signed integer array having the same shape as a provided input ndarray.
779
+ *
780
+ * @param x - input array
781
+ * @param options - options
782
+ * @param options.dtype - output array data type
783
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
784
+ * @param options.shape - output array shape
785
+ * @returns zero-filled array
786
+ *
787
+ * @example
788
+ * var zeros = require( `@stdlib/ndarray/zeros` );
789
+ *
790
+ * var x = zeros( [ 2, 2 ], {
791
+ * 'dtype': 'float64'
792
+ * });
793
+ * // returns <ndarray>
794
+ *
795
+ * var sh = x.shape;
796
+ * // returns [ 2, 2 ]
797
+ *
798
+ * var dt = x.dtype;
799
+ * // returns 'float64'
800
+ *
801
+ * var y = zerosLike( x, {
802
+ * 'dtype': 'int16'
803
+ * });
804
+ * // returns <ndarray>
805
+ *
806
+ * sh = y.shape;
807
+ * // returns [ 2, 2 ]
808
+ *
809
+ * dt = y.dtype;
810
+ * // returns 'int16'
811
+ */
812
+ declare function zerosLike( x: ndarray, options: Int16Options ): int16ndarray;
813
+
814
+ /**
815
+ * Creates a zero-filled 8-bit signed integer array having the same shape as a provided input ndarray.
816
+ *
817
+ * @param x - input array
818
+ * @param options - options
819
+ * @param options.dtype - output array data type
820
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
821
+ * @param options.shape - output array shape
822
+ * @returns zero-filled array
823
+ *
824
+ * @example
825
+ * var zeros = require( `@stdlib/ndarray/zeros` );
826
+ *
827
+ * var x = zeros( [ 2, 2 ], {
828
+ * 'dtype': 'float64'
829
+ * });
830
+ * // returns <ndarray>
831
+ *
832
+ * var sh = x.shape;
833
+ * // returns [ 2, 2 ]
834
+ *
835
+ * var dt = x.dtype;
836
+ * // returns 'float64'
837
+ *
838
+ * var y = zerosLike( x, {
839
+ * 'dtype': 'int8'
840
+ * });
841
+ * // returns <ndarray>
842
+ *
843
+ * sh = y.shape;
844
+ * // returns [ 2, 2 ]
845
+ *
846
+ * dt = y.dtype;
847
+ * // returns 'int8'
848
+ */
849
+ declare function zerosLike( x: ndarray, options: Int8Options ): int8ndarray;
850
+
851
+ /**
852
+ * Creates a zero-filled 32-bit unsigned integer array having the same shape as a provided input ndarray.
853
+ *
854
+ * @param x - input array
855
+ * @param options - options
856
+ * @param options.dtype - output array data type
857
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
858
+ * @param options.shape - output array shape
859
+ * @returns zero-filled array
860
+ *
861
+ * @example
862
+ * var zeros = require( `@stdlib/ndarray/zeros` );
863
+ *
864
+ * var x = zeros( [ 2, 2 ], {
865
+ * 'dtype': 'float64'
866
+ * });
867
+ * // returns <ndarray>
868
+ *
869
+ * var sh = x.shape;
870
+ * // returns [ 2, 2 ]
871
+ *
872
+ * var dt = x.dtype;
873
+ * // returns 'float64'
874
+ *
875
+ * var y = zerosLike( x, {
876
+ * 'dtype': 'uint32'
877
+ * });
878
+ * // returns <ndarray>
879
+ *
880
+ * sh = y.shape;
881
+ * // returns [ 2, 2 ]
882
+ *
883
+ * dt = y.dtype;
884
+ * // returns 'uint32'
885
+ */
886
+ declare function zerosLike( x: ndarray, options: Uint32Options ): uint32ndarray;
887
+
888
+ /**
889
+ * Creates a zero-filled 16-bit unsigned integer array having the same shape as a provided input ndarray.
890
+ *
891
+ * @param x - input array
892
+ * @param options - options
893
+ * @param options.dtype - output array data type
894
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
895
+ * @param options.shape - output array shape
896
+ * @returns zero-filled array
897
+ *
898
+ * @example
899
+ * var zeros = require( `@stdlib/ndarray/zeros` );
900
+ *
901
+ * var x = zeros( [ 2, 2 ], {
902
+ * 'dtype': 'float64'
903
+ * });
904
+ * // returns <ndarray>
905
+ *
906
+ * var sh = x.shape;
907
+ * // returns [ 2, 2 ]
908
+ *
909
+ * var dt = x.dtype;
910
+ * // returns 'float64'
911
+ *
912
+ * var y = zerosLike( x, {
913
+ * 'dtype': 'uint16'
914
+ * });
915
+ * // returns <ndarray>
916
+ *
917
+ * sh = y.shape;
918
+ * // returns [ 2, 2 ]
919
+ *
920
+ * dt = y.dtype;
921
+ * // returns 'uint16'
922
+ */
923
+ declare function zerosLike( x: ndarray, options: Uint16Options ): uint16ndarray;
924
+
925
+ /**
926
+ * Creates a zero-filled 8-bit unsigned integer array having the same shape as a provided input ndarray.
927
+ *
928
+ * @param x - input array
929
+ * @param options - options
930
+ * @param options.dtype - output array data type
931
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
932
+ * @param options.shape - output array shape
933
+ * @returns zero-filled array
934
+ *
935
+ * @example
936
+ * var zeros = require( `@stdlib/ndarray/zeros` );
937
+ *
938
+ * var x = zeros( [ 2, 2 ], {
939
+ * 'dtype': 'float64'
940
+ * });
941
+ * // returns <ndarray>
942
+ *
943
+ * var sh = x.shape;
944
+ * // returns [ 2, 2 ]
945
+ *
946
+ * var dt = x.dtype;
947
+ * // returns 'float64'
948
+ *
949
+ * var y = zerosLike( x, {
950
+ * 'dtype': 'uint8'
951
+ * });
952
+ * // returns <ndarray>
953
+ *
954
+ * sh = y.shape;
955
+ * // returns [ 2, 2 ]
956
+ *
957
+ * dt = y.dtype;
958
+ * // returns 'uint8'
959
+ */
960
+ declare function zerosLike( x: ndarray, options: Uint8Options ): uint8ndarray;
961
+
962
+ /**
963
+ * Creates a zero-filled clamped 8-bit unsigned integer array having the same shape as a provided input ndarray.
964
+ *
965
+ * @param x - input array
966
+ * @param options - options
967
+ * @param options.dtype - output array data type
968
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
969
+ * @param options.shape - output array shape
970
+ * @returns zero-filled array
971
+ *
972
+ * @example
973
+ * var zeros = require( `@stdlib/ndarray/zeros` );
974
+ *
975
+ * var x = zeros( [ 2, 2 ], {
976
+ * 'dtype': 'float64'
977
+ * });
978
+ * // returns <ndarray>
979
+ *
980
+ * var sh = x.shape;
981
+ * // returns [ 2, 2 ]
982
+ *
983
+ * var dt = x.dtype;
984
+ * // returns 'float64'
985
+ *
986
+ * var y = zerosLike( x, {
987
+ * 'dtype': 'uint8c'
988
+ * });
989
+ * // returns <ndarray>
990
+ *
991
+ * sh = y.shape;
992
+ * // returns [ 2, 2 ]
993
+ *
994
+ * dt = y.dtype;
995
+ * // returns 'uint8c'
996
+ */
997
+ declare function zerosLike( x: ndarray, options: Uint8COptions ): uint8cndarray;
998
+
999
+ /**
1000
+ * Creates a zero-filled array having the same shape and data type as a provided input ndarray.
1001
+ *
1002
+ * @param x - input array
1003
+ * @param options - options
1004
+ * @param options.dtype - output array data type
1005
+ * @param options.order - specifies whether the output array is 'row-major' (C-style) or 'column-major' (Fortran-style)
1006
+ * @param options.shape - output array shape
1007
+ * @returns zero-filled array
1008
+ *
1009
+ * @example
1010
+ * var zeros = require( `@stdlib/ndarray/zeros` );
1011
+ *
1012
+ * var x = zeros( [ 2, 2 ], {
1013
+ * 'dtype': 'float64'
1014
+ * });
1015
+ * // returns <ndarray>
1016
+ *
1017
+ * var sh = x.shape;
1018
+ * // returns [ 2, 2 ]
1019
+ *
1020
+ * var dt = x.dtype;
1021
+ * // returns 'generic'
1022
+ *
1023
+ * var y = zerosLike( x );
1024
+ * // returns <ndarray>
1025
+ *
1026
+ * sh = y.shape;
1027
+ * // returns [ 2, 2 ]
1028
+ *
1029
+ * dt = y.dtype;
1030
+ * // returns 'generic'
1031
+ */
1032
+ declare function zerosLike( x: ndarray, options?: Options | OptionsWithDType ): typedndarray<number>; // tslint:disable-line:max-line-length
1033
+
1034
+
1035
+ // EXPORTS //
1036
+
1037
+ export = zerosLike;