You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -48,9 +48,9 @@ The function has the following parameters:
48
48
-**N**: number of indexed elements.
49
49
-**order**: sort order. If `order < 0.0`, the input strided array is sorted in **decreasing** order. If `order > 0.0`, the input strided array is sorted in **increasing** order. If `order == 0.0`, the input strided array is left unchanged.
The function has the following additional parameters:
94
94
95
-
-**offset**: starting index.
95
+
-**offsetX**: starting index.
96
96
97
-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x`
97
+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements:
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
161
+
162
+
<sectionclass="intro">
163
+
164
+
</section>
165
+
166
+
<!-- /.intro -->
167
+
168
+
<!-- C usage documentation. -->
169
+
170
+
<sectionclass="usage">
171
+
172
+
### Usage
173
+
174
+
```c
175
+
#include"stdlib/blas/ext/base/dsortins.h"
176
+
```
177
+
178
+
#### stdlib_strided_dsortins( N, order, \*X, strideX )
179
+
180
+
Sorts a double-precision floating-point strided array using insertion sort.
181
+
182
+
```c
183
+
double x[] = { 1.0, -2.0, 3.0, -4.0 };
184
+
185
+
stdlib_strided_dsortins( 2, -1, x, 1 );
186
+
```
187
+
188
+
The function accepts the following arguments:
189
+
190
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
191
+
- **order**: `[in] double` sort order. If `order < 0.0`, the input strided array `x` is sorted in **decreasing** order. If `order > 0.0`, the input strided array `x` is sorted in **increasing** order. If `order == 0.0`, the input strided arrays are left unchanged.
192
+
- **X**: `[inout] double*` input array.
193
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
#### stdlib_strided_dsortins_ndarray( N, order, \*X, strideX, offsetX )
202
+
203
+
<!--lint enable maximum-heading-length-->
204
+
205
+
Sorts a double-precision floating-point strided array using insertion sort and alternative indexing semantics.
206
+
207
+
```c
208
+
double x[] = { 1.0, -2.0, 3.0, -4.0 };
209
+
210
+
stdlib_strided_dsortins_ndarray( 4, 1, x, 1, 0 );
211
+
```
212
+
213
+
The function accepts the following arguments:
214
+
215
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
216
+
- **order**: `[in] CBLAS_INT` sort order.
217
+
- **X**: `[inout] double*` input array. If `order < 0.0`, the input strided array `x` is sorted in **decreasing** order. If `order > 0.0`, the input strided array `x` is sorted in **increasing** order. If `order == 0.0`, the input strided arrays are left unchanged.
218
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
219
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
API_SUFFIX(stdlib_strided_dsortins)( N, 1.0, x, strideX );
259
+
260
+
// Print the result:
261
+
for ( int i = 0; i < 8; i++ ) {
262
+
printf( "x[ %i ] = %lf\n", i, x[ i ] );
263
+
}
264
+
}
265
+
266
+
```
267
+
268
+
</section>
269
+
270
+
<!-- /.examples -->
271
+
272
+
</section>
273
+
274
+
<!-- /.c -->
275
+
156
276
## See Also
157
277
158
278
- <span class="package-name">[`@stdlib/blas/ext/base/dsort2ins`][@stdlib/blas/ext/base/dsort2ins]</span><span class="delimiter">: </span><span class="description">simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.</span>
0 commit comments