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
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md
+135-2Lines changed: 135 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,12 +187,145 @@ console.log( y );
187
187
188
188
<!-- /.examples -->
189
189
190
-
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
191
190
192
-
<sectionclass="related">
193
191
194
192
* * *
195
193
194
+
<!-- C interface documentation. -->
195
+
196
+
<sectionclass="c">
197
+
198
+
## C APIs
199
+
200
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
201
+
202
+
<sectionclass="intro">
203
+
204
+
</section>
205
+
206
+
<!-- /.intro -->
207
+
208
+
<!-- C usage documentation. -->
209
+
210
+
<sectionclass="usage">
211
+
212
+
### Usage
213
+
214
+
```c
215
+
#include"stdlib/blas/ext/base/ssort2ins.h"
216
+
```
217
+
218
+
#### stdlib_strided_ssort2ins( N, order, \*X, strideX, \*Y, strideY )
219
+
220
+
Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort.
221
+
222
+
```c
223
+
float x[] = { 1.0f, -2.0f, 3.0f, -4.0f };
224
+
float y[] = { 0.0f, 1.0f, 2.0f, 3.0f };
225
+
226
+
stdlib_strided_ssort2ins( 4, 1.0f, x, 1, y, 1 );
227
+
```
228
+
229
+
The function accepts the following arguments:
230
+
231
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
232
+
- **order**: `[in] float` 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.
233
+
- **X**: `[inout] float*` first input array.
234
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
235
+
- **Y**: `[inout] float*` second input array.
236
+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort and alternative indexing semantics.
249
+
250
+
```c
251
+
float x[] = { 1.0f, -2.0f, 3.0f, -4.0f };
252
+
float y[] = { 0.0f, 1.0f, 2.0f, 3.0f };
253
+
254
+
stdlib_strided_ssort2ins_ndarray( 4, 1.0f, x, 1, 0, y, 1, 0 );
255
+
```
256
+
257
+
The function accepts the following arguments:
258
+
259
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
260
+
- **order**: `[in] float` 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.
261
+
- **X**: `[inout] float*` first input array.
262
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
263
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
264
+
- **Y**: `[inout] float*` second input array.
265
+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
266
+
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
stdlib_strided_ssort2ins( N, 1.0f, x, strideX, y, strideY );
308
+
309
+
// Print the result:
310
+
for ( int i = 0; i < 8; i++ ) {
311
+
printf( "x[ %i ] = %f\n", i, x[ i ] );
312
+
printf( "y[ %i ] = %f\n", i, y[ i ] );
313
+
}
314
+
}
315
+
```
316
+
317
+
</section>
318
+
319
+
<!-- /.examples -->
320
+
321
+
</section>
322
+
323
+
<!-- /.c -->
324
+
325
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
326
+
327
+
<section class="related">
328
+
196
329
## See Also
197
330
198
331
- <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