|
1 | | -{{alias}}( N, x, strideX ) |
2 | 1 |
|
3 | | - Computes the minimum absolute value of a strided array, ignoring `NaN` |
4 | | - values. |
| 2 | +{{alias}}( N, x, strideX ) |
| 3 | + Computes the minimum absolute value of a strided array, ignoring `NaN` values. |
5 | 4 |
|
6 | | - The `N` and `strideX` parameters determine which elements in the strided |
7 | | - array are accessed at runtime. |
| 5 | + The `N` and stride parameters determine which elements in the strided array |
| 6 | + are accessed at runtime. |
8 | 7 |
|
9 | | - Indexing is relative to the first index. To introduce an offset, use a |
10 | | - typed array view. |
| 8 | + Indexing is relative to the first index. To introduce an offset, use a typed |
| 9 | + array view. |
11 | 10 |
|
12 | 11 | If `N <= 0`, the function returns `NaN`. |
13 | 12 |
|
14 | | - |
15 | 13 | Parameters |
16 | 14 | ---------- |
17 | | - |
18 | | - N: integer |
| 15 | + N: integer |
19 | 16 | Number of indexed elements. |
20 | 17 |
|
21 | | - x: Array<number>|TypedArray |
| 18 | + x: Array<number>|TypedArray |
22 | 19 | Input array. |
23 | 20 |
|
24 | | - strideX: integer |
| 21 | + strideX: integer |
25 | 22 | Stride length. |
26 | 23 |
|
27 | | - |
28 | 24 | Returns |
29 | 25 | ------- |
30 | | - |
31 | | - out: number |
| 26 | + out: number |
32 | 27 | Minimum absolute value. |
33 | 28 |
|
34 | | - |
35 | 29 | Examples |
36 | 30 | -------- |
37 | | - |
38 | 31 | // Standard Usage: |
39 | | - > var x = [ 1.0, -2.0, NaN, 2.0 ] |
| 32 | + > var x = [ 1.0, -2.0, NaN, 2.0 ]; |
40 | 33 | > {{alias}}( x.length, x, 1 ) |
41 | 34 | 1.0 |
42 | 35 |
|
43 | 36 | // Using `N` and `stride` parameters: |
44 | | - > x = [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN, NaN ] |
45 | | - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ) |
46 | | - > var stride = 2 |
47 | | - > {{alias}}( N, x, stride ) |
| 37 | + > x = [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN, NaN ]; |
| 38 | + > {{alias}}( 4, x, 2 ) |
48 | 39 | 1.0 |
49 | 40 |
|
50 | 41 | // Using view offsets: |
51 | | - > var x0 = new {{alias:@stdlib/array/float64}}([ |
52 | | - 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN |
53 | | - ]) |
54 | | - > var x1 = new {{alias:@stdlib/array/float64}}( |
55 | | - x0.buffer, x0.BYTES_PER_ELEMENT * 1 |
56 | | - ) |
57 | | - > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ) |
58 | | - > stride = 2 |
59 | | - > {{alias}}( N, x1, stride ) |
| 42 | + > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ] ); |
| 43 | + > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); |
| 44 | + > {{alias}}( 4, x1, 2 ) |
60 | 45 | 1.0 |
61 | 46 |
|
62 | 47 |
|
63 | | -{{alias}}.ndarray( N, x, stride, offset ) |
64 | | - |
65 | | - Computes the minimum absolute value of a strided array, ignoring `NaN` |
66 | | - values and using alternative indexing semantics. |
| 48 | +{{alias}}.ndarray( N, x, strideX, offsetX ) |
| 49 | + Computes the minimum absolute value of a strided array, ignoring `NaN` values and using |
| 50 | + alternative indexing semantics. |
67 | 51 |
|
68 | 52 | While typed array views mandate a view offset based on the underlying |
69 | | - buffer, the `offset` parameter supports indexing semantics based on a |
| 53 | + buffer, the `offset` parameter supports indexing semantics based on a |
70 | 54 | starting index. |
71 | 55 |
|
72 | | - |
73 | 56 | Parameters |
74 | 57 | ---------- |
75 | | - |
76 | | - N: integer |
| 58 | + N: integer |
77 | 59 | Number of indexed elements. |
78 | 60 |
|
79 | | - x: Array<number>|TypedArray |
| 61 | + x: Array<number>|TypedArray |
80 | 62 | Input array. |
81 | 63 |
|
82 | | - strideX: integer |
| 64 | + strideX: integer |
83 | 65 | Stride length. |
84 | 66 |
|
85 | | - offsetX: integer |
| 67 | + offsetX: integer |
86 | 68 | Starting index. |
87 | 69 |
|
88 | | - |
89 | 70 | Returns |
90 | 71 | ------- |
91 | | - |
92 | | - out: number |
| 72 | + out: number |
93 | 73 | Minimum absolute value. |
94 | 74 |
|
95 | | - |
96 | 75 | Examples |
97 | 76 | -------- |
98 | | - |
99 | 77 | // Standard Usage: |
100 | | - > var x = [ 1.0, -2.0, NaN, 2.0 ] |
| 78 | + > var x = [ 1.0, -2.0, NaN, 2.0 ]; |
101 | 79 | > {{alias}}.ndarray( x.length, x, 1, 0 ) |
102 | 80 | 1.0 |
103 | 81 |
|
104 | 82 | // Using offset parameter: |
105 | | - > var x = [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ] |
106 | | - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ) |
107 | | - > {{alias}}.ndarray( N, x, 2, 1 ) |
| 83 | + > var x = [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ]; |
| 84 | + > {{alias}}.ndarray( 4, x, 2, 1 ) |
108 | 85 | 1.0 |
109 | 86 |
|
110 | | - |
111 | 87 | See Also |
112 | 88 | -------- |
0 commit comments