|
20 | 20 |
|
21 | 21 | /// <reference types="@stdlib/types"/> |
22 | 22 |
|
23 | | -import { Complex128Array, Complex64Array, BooleanArray, AnyArray, DataType } from '@stdlib/types/array'; |
| 23 | +import { Complex128Array, Complex64Array, Float16Array, BooleanArray, AnyArray, DataType } from '@stdlib/types/array'; |
24 | 24 | import { ComplexLike } from '@stdlib/types/complex'; |
25 | 25 |
|
26 | 26 | /** |
@@ -61,6 +61,25 @@ declare function fullLike( x: AnyArray, value: number, dtype: 'float64' ): Float |
61 | 61 | */ |
62 | 62 | declare function fullLike( x: AnyArray, value: number, dtype: 'float32' ): Float32Array; |
63 | 63 |
|
| 64 | +/** |
| 65 | +* Creates a filled array having the same length as a provided input array. |
| 66 | +* |
| 67 | +* @param x - input array from which to derive the output array length |
| 68 | +* @param value - fill value |
| 69 | +* @param dtype - data type |
| 70 | +* @returns filled array |
| 71 | +* |
| 72 | +* @example |
| 73 | +* var zeros = require( '@stdlib/array/zeros' ); |
| 74 | +* |
| 75 | +* var x = zeros( 2, 'float64' ); |
| 76 | +* // returns <Float64Array>[ 0.0, 0.0 ] |
| 77 | +* |
| 78 | +* var y = fullLike( x, 1.0, 'float16' ); |
| 79 | +* // returns <Float16Array>[ 1.0, 1.0 ] |
| 80 | +*/ |
| 81 | +declare function fullLike( x: AnyArray, value: number, dtype: 'float16' ): Float16Array; |
| 82 | + |
64 | 83 | /** |
65 | 84 | * Creates a filled array having the same length as a provided input array. |
66 | 85 | * |
@@ -316,6 +335,25 @@ declare function fullLike( x: Float64Array, value: number, dtype?: DataType ): F |
316 | 335 | */ |
317 | 336 | declare function fullLike( x: Float32Array, value: number, dtype?: DataType ): Float32Array; |
318 | 337 |
|
| 338 | +/** |
| 339 | +* Creates a filled array having the same length and data type as a provided input array. |
| 340 | +* |
| 341 | +* @param x - input array from which to derive the output array length |
| 342 | +* @param value - fill value |
| 343 | +* @param dtype - data type |
| 344 | +* @returns filled array |
| 345 | +* |
| 346 | +* @example |
| 347 | +* var zeros = require( '@stdlib/array/zeros' ); |
| 348 | +* |
| 349 | +* var x = zeros( 2, 'float16' ); |
| 350 | +* // returns <Float16Array>[ 0.0, 0.0 ] |
| 351 | +* |
| 352 | +* var y = fullLike( x, 1.0 ); |
| 353 | +* // returns <Float16Array>[ 1.0, 1.0 ] |
| 354 | +*/ |
| 355 | +declare function fullLike( x: Float16Array, value: number, dtype?: DataType ): Float16Array; |
| 356 | + |
319 | 357 | /** |
320 | 358 | * Creates a filled array having the same length and data type as a provided input array. |
321 | 359 | * |
|
0 commit comments