|
1 | 1 |
|
2 |
| -{{alias}}( x, s, value ) |
3 |
| - Fills an input ndarray with a specified value in the region defined by a |
4 |
| - MultiSlice. |
| 2 | +{{alias}}( x, value, ...s[, options] ) |
| 3 | + Fills an input ndarray slice with a specified value. |
5 | 4 |
|
6 |
| - If `value` is a number and `x` has a complex data type, the function fills |
7 |
| - an input ndarray with a complex number whose real component equals the |
8 |
| - provided scalar `value` and whose imaginary component is zero. |
| 5 | + The function supports three (mutually exclusive) means of providing slice |
| 6 | + arguments: |
9 | 7 |
|
10 |
| - The function *mutates* the input ndarray. |
| 8 | + 1. Providing a single MultiSlice object. |
| 9 | + 2. Providing a single array containing slice arguments. |
| 10 | + 3. Providing slice arguments as separate arguments. |
| 11 | + |
| 12 | + An individual slice argument must be either a Slice, an integer, null, or |
| 13 | + undefined. |
| 14 | + |
| 15 | + If providing a MultiSlice object or an array of slice arguments, no other |
| 16 | + slice arguments should be provided. |
| 17 | + |
| 18 | + Mixing function invocation styles (e.g., providing multiple MultiSlice |
| 19 | + objects or providing an array of slice arguments followed by additional |
| 20 | + slice arguments) is not supported. |
11 | 21 |
|
12 | 22 | Parameters
|
13 | 23 | ----------
|
14 |
| - x: ndarrayLike |
| 24 | + x: ndarray |
15 | 25 | Input ndarray.
|
16 | 26 |
|
17 |
| - s: MultiSlice |
18 |
| - MultiSlice instance. |
19 |
| - |
20 | 27 | value: any
|
21 | 28 | Scalar value. Must be able to safely cast to the input ndarray data
|
22 | 29 | type. Scalar values having floating-point data types (both real and
|
23 | 30 | complex) are allowed to downcast to a lower precision data type of the
|
24 | 31 | same kind (e.g., a scalar double-precision floating-point number can be
|
25 | 32 | used to fill a 'float32' input ndarray).
|
26 | 33 |
|
| 34 | + s: ...MultiSlice|Slice|null|undefined|integer|ArrayLike |
| 35 | + Slice arguments. |
| 36 | + |
| 37 | + options: Object (optional) |
| 38 | + Options. |
| 39 | + |
| 40 | + options.strict: boolean (optional) |
| 41 | + Boolean indicating whether to enforce strict bounds checking. |
| 42 | + Default: true. |
| 43 | + |
27 | 44 | Returns
|
28 | 45 | -------
|
29 |
| - out: ndarrayLike |
| 46 | + out: ndarray |
30 | 47 | Input ndarray.
|
31 | 48 |
|
32 | 49 | Examples
|
|
37 | 54 | > var s0 = new {{alias:@stdlib/slice/ctor}}( 0, 1 );
|
38 | 55 | > var s1 = new {{alias:@stdlib/slice/ctor}}( null, null );
|
39 | 56 | > var s = new {{alias:@stdlib/slice/multi}}( s0, s1 );
|
40 |
| - > {{alias}}( x, s, 10.0 ); |
| 57 | + > {{alias}}( x, 10.0, s ); |
41 | 58 | > x.get( 0, 0 )
|
42 | 59 | 10.0
|
43 | 60 |
|
|
0 commit comments