|
1 | 1 |
|
2 | | -{{alias}}( N, x, stride ) |
3 | | - Computes the maximum absolute value of a strided array, ignoring `NaN` |
4 | | - values. |
| 2 | +{{alias}}( N, x, strideX ) |
| 3 | + Computes the maximum absolute value of a strided array, ignoring |
| 4 | + `NaN` values. |
5 | 5 |
|
6 | | - The `N` and `stride` parameters determine which elements in `x` are accessed |
7 | | - at runtime. |
| 6 | + The `N` and stride parameters determine which elements in the |
| 7 | + stridedarray 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, |
| 10 | + use a typed array view. |
11 | 11 |
|
12 | 12 | If `N <= 0`, the function returns `NaN`. |
13 | 13 |
|
|
19 | 19 | x: Array<number>|TypedArray |
20 | 20 | Input array. |
21 | 21 |
|
22 | | - stride: integer |
23 | | - Index increment. |
| 22 | + strideX: integer |
| 23 | + Stride length. |
24 | 24 |
|
25 | 25 | Returns |
26 | 26 | ------- |
27 | 27 | out: number |
28 | | - Maximum absolute value. |
| 28 | + maximum absolute value. |
29 | 29 |
|
30 | 30 | Examples |
31 | 31 | -------- |
|
36 | 36 |
|
37 | 37 | // Using `N` and `stride` parameters: |
38 | 38 | > x = [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN, NaN ]; |
39 | | - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
40 | | - > var stride = 2; |
41 | | - > {{alias}}( N, x, stride ) |
| 39 | + > {{alias}}( 4, x, 2 ) |
42 | 40 | 2.0 |
43 | 41 |
|
44 | 42 | // Using view offsets: |
45 | 43 | > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ] ); |
46 | 44 | > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); |
47 | | - > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ); |
48 | | - > stride = 2; |
49 | | - > {{alias}}( N, x1, stride ) |
| 45 | + > {{alias}}( 4, x1, 2 ) |
50 | 46 | 2.0 |
51 | 47 |
|
52 | | -{{alias}}.ndarray( N, x, stride, offset ) |
| 48 | + |
| 49 | +{{alias}}.ndarray( N, x, strideX, offsetX ) |
53 | 50 | Computes the maximum absolute value of a strided array, ignoring `NaN` |
54 | 51 | values and using alternative indexing semantics. |
55 | 52 |
|
|
65 | 62 | x: Array<number>|TypedArray |
66 | 63 | Input array. |
67 | 64 |
|
68 | | - stride: integer |
69 | | - Index increment. |
| 65 | + strideX: integer |
| 66 | + Stride length. |
70 | 67 |
|
71 | | - offset: integer |
| 68 | + offsetX: integer |
72 | 69 | Starting index. |
73 | 70 |
|
74 | 71 | Returns |
75 | 72 | ------- |
76 | 73 | out: number |
77 | | - Maximum absolute value. |
| 74 | + maximum absolute value. |
78 | 75 |
|
79 | 76 | Examples |
80 | 77 | -------- |
|
85 | 82 |
|
86 | 83 | // Using offset parameter: |
87 | 84 | > var x = [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ]; |
88 | | - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
89 | | - > {{alias}}.ndarray( N, x, 2, 1 ) |
| 85 | + > {{alias}}.ndarray( 4, x, 2, 1 ) |
90 | 86 | 2.0 |
91 | 87 |
|
92 | 88 | See Also |
93 | 89 | -------- |
94 | | - |
0 commit comments