Skip to content

Commit 5632412

Browse files
authored
Discard changes to lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md
1 parent cefe61c commit 5632412

File tree

1 file changed

+131
-0
lines changed
  • lib/node_modules/@stdlib/blas/ext/base/ssort2ins

1 file changed

+131
-0
lines changed

lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,137 @@ console.log( y );
193193

194194
* * *
195195

196+
<!-- C interface documentation. -->
197+
198+
<section class="c">
199+
200+
## C APIs
201+
202+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
203+
204+
<section class="intro">
205+
206+
</section>
207+
208+
<!-- /.intro -->
209+
210+
<!-- C usage documentation. -->
211+
212+
<section class="usage">
213+
214+
### Usage
215+
216+
```c
217+
#include "stdlib/blas/ext/base/ssort2ins.h"
218+
```
219+
220+
#### stdlib_strided_ssort2ins( N, order, \*X, strideX, \*Y, strideY )
221+
222+
Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort.
223+
224+
```c
225+
float x[] = { 1.0f, -2.0f, 3.0f, -4.0f };
226+
float y[] = { 0.0f, 1.0f, 2.0f, 3.0f };
227+
228+
stdlib_strided_ssort2ins( 4, 1.0f, x, 1, y, 1 );
229+
```
230+
231+
The function accepts the following arguments:
232+
233+
- **N**: `[in] CBLAS_INT` number of indexed elements.
234+
- **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.
235+
- **X**: `[inout] float*` first input array.
236+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
237+
- **Y**: `[inout] float*` second input array.
238+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
239+
240+
```c
241+
stdlib_strided_ssort2ins( const CBLAS_INT N, const float order, float *X, const CBLAS_INT strideX, float *Y, const CBLAS_INT strideY );
242+
```
243+
244+
<!--lint disable maximum-heading-length-->
245+
246+
#### stdlib_strided_ssort2ins_ndarray( N, order, \*X, strideX, offsetX, \*Y, strideY, offsetY )
247+
248+
<!--lint enable maximum-heading-length-->
249+
250+
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.
251+
252+
```c
253+
float x[] = { 1.0f, -2.0f, 3.0f, -4.0f };
254+
float y[] = { 0.0f, 1.0f, 2.0f, 3.0f };
255+
256+
stdlib_strided_ssort2ins_ndarray( 4, 1.0f, x, 1, 0, y, 1, 0 );
257+
```
258+
259+
The function accepts the following arguments:
260+
261+
- **N**: `[in] CBLAS_INT` number of indexed elements.
262+
- **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.
263+
- **X**: `[inout] float*` first input array.
264+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
265+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
266+
- **Y**: `[inout] float*` second input array.
267+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
268+
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
269+
270+
```c
271+
stdlib_strided_ssort2ins_ndarray( const CBLAS_INT N, const float order, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
272+
```
273+
274+
</section>
275+
276+
<!-- /.usage -->
277+
278+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
279+
280+
<section class="notes">
281+
282+
</section>
283+
284+
<!-- /.notes -->
285+
286+
<!-- C API usage examples. -->
287+
288+
<section class="examples">
289+
290+
### Examples
291+
292+
```c
293+
#include "stdlib/blas/ext/base/ssort2ins.h"
294+
#include <stdio.h>
295+
296+
int main( void ) {
297+
// Create strided arrays:
298+
float x[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f };
299+
float y[] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f };
300+
301+
// Specify the number of elements:
302+
int N = 8;
303+
304+
// Specify the strides:
305+
int strideX = 1;
306+
int strideY = 1;
307+
308+
// Sort the arrays:
309+
stdlib_strided_ssort2ins( N, 1.0f, x, strideX, y, strideY );
310+
311+
// Print the result:
312+
for ( int i = 0; i < 8; i++ ) {
313+
printf( "x[ %i ] = %f\n", i, x[ i ] );
314+
printf( "y[ %i ] = %f\n", i, y[ i ] );
315+
}
316+
}
317+
```
318+
319+
</section>
320+
321+
<!-- /.examples -->
322+
323+
</section>
324+
325+
<!-- /.c -->
326+
196327
## See Also
197328
198329
- <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

Comments
 (0)