|
2 | 2 | {{alias}}( N, x, strideX, y, strideY )
|
3 | 3 | Computes the cumulative minimum of a strided array.
|
4 | 4 |
|
5 |
| - The `N` and `stride` parameters determine which elements in `x` and `y` are |
6 |
| - accessed at runtime. |
| 5 | + The `N` and stride parameters determine which elements in the strided arrays |
| 6 | + are accessed at runtime. |
7 | 7 |
|
8 | 8 | Indexing is relative to the first index. To introduce an offset, use a typed
|
9 | 9 | array view.
|
|
19 | 19 | Input array.
|
20 | 20 |
|
21 | 21 | strideX: integer
|
22 |
| - Index increment for `x`. |
| 22 | + Stride length for `x`. |
23 | 23 |
|
24 | 24 | y: Array<number>|TypedArray
|
25 | 25 | Output array.
|
26 | 26 |
|
27 | 27 | strideY: integer
|
28 |
| - Index increment for `y`. |
| 28 | + Stride length for `y`. |
29 | 29 |
|
30 | 30 | Returns
|
31 | 31 | -------
|
|
40 | 40 | > {{alias}}( x.length, x, 1, y, 1 )
|
41 | 41 | [ 1.0, -2.0, -2.0 ]
|
42 | 42 |
|
43 |
| - // Using `N` and `stride` parameters: |
| 43 | + // Using `N` and stride parameters: |
44 | 44 | > x = [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ];
|
45 | 45 | > y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
|
46 |
| - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
47 |
| - > {{alias}}( N, x, 2, y, 2 ) |
| 46 | + > {{alias}}( 3, x, 2, y, 2 ) |
48 | 47 | [ -2.0, 0.0, -2.0, 0.0, -2.0, 0.0 ]
|
49 | 48 |
|
50 | 49 | // Using view offsets:
|
51 | 50 | > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
|
52 | 51 | > var y0 = new {{alias:@stdlib/array/float64}}( x0.length );
|
53 | 52 | > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
|
54 | 53 | > var y1 = new {{alias:@stdlib/array/float64}}( y0.buffer, y0.BYTES_PER_ELEMENT*3 );
|
55 |
| - > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ); |
56 |
| - > {{alias}}( N, x1, 2, y1, 1 ) |
| 54 | + > {{alias}}( 3, x1, 2, y1, 1 ) |
57 | 55 | <Float64Array>[ -2.0, -2.0, -2.0 ]
|
58 | 56 | > y0
|
59 | 57 | <Float64Array>[ 0.0, 0.0, 0.0, -2.0, -2.0, -2.0 ]
|
60 | 58 |
|
| 59 | + |
61 | 60 | {{alias}}.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
|
62 | 61 | Computes the cumulative minimum of a strided array using alternative
|
63 | 62 | indexing semantics.
|
|
75 | 74 | Input array.
|
76 | 75 |
|
77 | 76 | strideX: integer
|
78 |
| - Index increment for `x`. |
| 77 | + Stride length for `x`. |
79 | 78 |
|
80 | 79 | offsetX: integer
|
81 | 80 | Starting index for `x`.
|
|
84 | 83 | Output array.
|
85 | 84 |
|
86 | 85 | strideY: integer
|
87 |
| - Index increment for `y`. |
| 86 | + Stride length for `y`. |
88 | 87 |
|
89 | 88 | offsetY: integer
|
90 | 89 | Starting index for `y`.
|
|
105 | 104 | // Advanced indexing:
|
106 | 105 | > x = [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ];
|
107 | 106 | > y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
|
108 |
| - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
109 |
| - > {{alias}}.ndarray( N, x, 2, 1, y, -1, y.length-1 ) |
| 107 | + > {{alias}}.ndarray( 3, x, 2, 1, y, -1, y.length-1 ) |
110 | 108 | [ 0.0, 0.0, 0.0, -2.0, -2.0, -2.0 ]
|
111 | 109 |
|
112 | 110 | See Also
|
|
0 commit comments