|
3 | 3 | Simultaneously sorts two single-precision floating-point strided arrays |
4 | 4 | based on the sort order of the first array using Shellsort. |
5 | 5 |
|
6 | | - The `N` and `stride` parameters determine which elements in `x` and `y` are |
7 | | - accessed at runtime. |
| 6 | + The `N` and stride parameters determine which elements in the strided arrays |
| 7 | + are accessed at runtime. |
8 | 8 |
|
9 | 9 | Indexing is relative to the first index. To introduce an offset, use typed |
10 | 10 | array views. |
|
67 | 67 | > y |
68 | 68 | <Float32Array>[ 3.0, 1.0, 0.0, 2.0 ] |
69 | 69 |
|
70 | | - // Using `N` and `stride` parameters: |
| 70 | + // Using `N` and stride parameters: |
71 | 71 | > x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, -4.0 ] ); |
72 | 72 | > y = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); |
73 | | - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
74 | | - > {{alias}}( N, -1, x, 2, y, 2 ) |
| 73 | + > {{alias}}( 2, -1, x, 2, y, 2 ) |
75 | 74 | <Float32Array>[ 3.0, -2.0, 1.0, -4.0 ] |
76 | 75 | > y |
77 | 76 | <Float32Array>[ 2.0, 1.0, 0.0, 3.0 ] |
|
81 | 80 | > var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); |
82 | 81 | > var y0 = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); |
83 | 82 | > var y1 = new {{alias:@stdlib/array/float32}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); |
84 | | - > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ); |
85 | | - > {{alias}}( N, 1, x1, 2, y1, 2 ) |
| 83 | + > {{alias}}( 2, 1, x1, 2, y1, 2 ) |
86 | 84 | <Float32Array>[ -4.0, 3.0, -2.0 ] |
87 | 85 | > x0 |
88 | 86 | <Float32Array>[ 1.0, -4.0, 3.0, -2.0 ] |
89 | 87 | > y0 |
90 | 88 | <Float32Array>[ 0.0, 3.0, 2.0, 1.0 ] |
91 | 89 |
|
| 90 | + |
92 | 91 | {{alias}}.ndarray( N, order, x, strideX, offsetX, y, strideY, offsetY ) |
93 | 92 | Simultaneously sorts two single-precision floating-point strided arrays |
94 | 93 | based on the sort order of the first array using Shellsort and alternative |
95 | 94 | indexing semantics. |
96 | 95 |
|
97 | 96 | While typed array views mandate a view offset based on the underlying |
98 | | - buffer, the `offset` parameter supports indexing semantics based on a |
99 | | - starting index. |
| 97 | + buffer, the offset parameter supports indexing semantics based on a starting |
| 98 | + index. |
100 | 99 |
|
101 | 100 | Parameters |
102 | 101 | ---------- |
|
143 | 142 | // Using an index offset: |
144 | 143 | > x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, -4.0 ] ); |
145 | 144 | > y = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); |
146 | | - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
147 | | - > {{alias}}.ndarray( N, 1, x, 2, 1, y, 2, 1 ) |
| 145 | + > {{alias}}.ndarray( 2, 1, x, 2, 1, y, 2, 1 ) |
148 | 146 | <Float32Array>[ 1.0, -4.0, 3.0, -2.0 ] |
149 | 147 | > y |
150 | 148 | <Float32Array>[ 0.0, 3.0, 2.0, 1.0 ] |
|
0 commit comments