|
20 | 20 |
|
21 | 21 | /// <reference types="@stdlib/types"/> |
22 | 22 |
|
23 | | -import { Complex128Array, Complex64Array, AnyArray, NumericDataType } from '@stdlib/types/array'; |
| 23 | +import { Complex128Array, Complex64Array, Float16Array, AnyArray, NumericDataType } from '@stdlib/types/array'; |
24 | 24 |
|
25 | 25 | /** |
26 | 26 | * Generates a linearly spaced numeric array whose elements increment by 1 starting from one and having the same length as a provided input array. |
@@ -58,6 +58,24 @@ declare function oneToLike( x: AnyArray, dtype: 'float64' ): Float64Array; |
58 | 58 | */ |
59 | 59 | declare function oneToLike( x: AnyArray, dtype: 'float32' ): Float32Array; |
60 | 60 |
|
| 61 | +/** |
| 62 | +* Generates a linearly spaced numeric array whose elements increment by 1 starting from one and having the same length as a provided input array. |
| 63 | +* |
| 64 | +* @param x - input array from which to derive the output array length |
| 65 | +* @param dtype - data type |
| 66 | +* @returns linearly spaced numeric array |
| 67 | +* |
| 68 | +* @example |
| 69 | +* var zeros = require( '@stdlib/array/zeros' ); |
| 70 | +* |
| 71 | +* var x = zeros( 2, 'float64' ); |
| 72 | +* // returns <Float64Array>[ 0.0, 0.0 ] |
| 73 | +* |
| 74 | +* var y = oneToLike( x, 'float16' ); |
| 75 | +* // returns <Float16Array>[ 1.0, 2.0 ] |
| 76 | +*/ |
| 77 | +declare function oneToLike( x: AnyArray, dtype: 'float16' ): Float16Array; |
| 78 | + |
61 | 79 | /** |
62 | 80 | * Generates a linearly spaced numeric array whose elements increment by 1 starting from one and having the same length as a provided input array. |
63 | 81 | * |
@@ -282,6 +300,24 @@ declare function oneToLike( x: Float64Array, dtype?: NumericDataType ): Float64A |
282 | 300 | */ |
283 | 301 | declare function oneToLike( x: Float32Array, dtype?: NumericDataType ): Float32Array; |
284 | 302 |
|
| 303 | +/** |
| 304 | +* Generates a linearly spaced numeric array whose elements increment by 1 starting from one and having the same length and data type as a provided input array. |
| 305 | +* |
| 306 | +* @param x - input array from which to derive the output array length |
| 307 | +* @param dtype - data type |
| 308 | +* @returns linearly spaced numeric array |
| 309 | +* |
| 310 | +* @example |
| 311 | +* var zeros = require( '@stdlib/array/zeros' ); |
| 312 | +* |
| 313 | +* var x = zeros( 2, 'float16' ); |
| 314 | +* // returns <Float16Array>[ 0.0, 0.0 ] |
| 315 | +* |
| 316 | +* var y = oneToLike( x ); |
| 317 | +* // returns <Float16Array>[ 1.0, 2.0 ] |
| 318 | +*/ |
| 319 | +declare function oneToLike( x: Float16Array, dtype?: NumericDataType ): Float16Array; |
| 320 | + |
285 | 321 | /** |
286 | 322 | * Generates a linearly spaced numeric array whose elements increment by 1 starting from one and having the same length and data type as a provided input array. |
287 | 323 | * |
|
0 commit comments