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