Skip to content

Commit 53d63c0

Browse files
authored
chore: fix section tags and restore removed content
Signed-off-by: Philipp Burckhardt <[email protected]>
1 parent 51e5204 commit 53d63c0

File tree

1 file changed

+135
-2
lines changed
  • lib/node_modules/@stdlib/blas/ext/base/ssort2ins

1 file changed

+135
-2
lines changed

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

Lines changed: 135 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,145 @@ console.log( y );
187187

188188
<!-- /.examples -->
189189

190-
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
191190

192-
<section class="related">
193191

194192
* * *
195193

194+
<!-- C interface documentation. -->
195+
196+
<section class="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+
<section class="intro">
203+
204+
</section>
205+
206+
<!-- /.intro -->
207+
208+
<!-- C usage documentation. -->
209+
210+
<section class="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`.
237+
238+
```c
239+
stdlib_strided_ssort2ins( const CBLAS_INT N, const float order, float *X, const CBLAS_INT strideX, float *Y, const CBLAS_INT strideY );
240+
```
241+
242+
<!--lint disable maximum-heading-length-->
243+
244+
#### stdlib_strided_ssort2ins_ndarray( N, order, \*X, strideX, offsetX, \*Y, strideY, offsetY )
245+
246+
<!--lint enable maximum-heading-length-->
247+
248+
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`.
267+
268+
```c
269+
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 );
270+
```
271+
272+
</section>
273+
274+
<!-- /.usage -->
275+
276+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
277+
278+
<section class="notes">
279+
280+
</section>
281+
282+
<!-- /.notes -->
283+
284+
<!-- C API usage examples. -->
285+
286+
<section class="examples">
287+
288+
### Examples
289+
290+
```c
291+
#include "stdlib/blas/ext/base/ssort2ins.h"
292+
#include <stdio.h>
293+
294+
int main( void ) {
295+
// Create strided arrays:
296+
float x[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f };
297+
float y[] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f };
298+
299+
// Specify the number of elements:
300+
int N = 8;
301+
302+
// Specify the strides:
303+
int strideX = 1;
304+
int strideY = 1;
305+
306+
// Sort the arrays:
307+
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+
196329
## See Also
197330
198331
- <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)