Skip to content

Commit 3587230

Browse files
chore: address commit comments regarding typo and refactor
PR-URL: #5263 Closes: #5237 Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]> Signed-off-by: Philipp Burckhardt <[email protected]>
1 parent 427d616 commit 3587230

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,14 @@ stdlib_strided_ssort2ins( 4, 1.0f, x, 1, y, 1 );
231231
The function accepts the following arguments:
232232
233233
- **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.
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.
235235
- **X**: `[inout] float*` first input array.
236236
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
237237
- **Y**: `[inout] float*` second input array.
238238
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
239239
240240
```c
241-
stdlib_strided_ssort2ins( const CBLAS_INT N, const float order, float *X, CBLAS_INT strideX, float *Y, CBLAS_INT strideY );
241+
stdlib_strided_ssort2ins( const CBLAS_INT N, const float order, float *X, const CBLAS_INT strideX, float *Y, const CBLAS_INT strideY );
242242
```
243243

244244
<!--lint disable maximum-heading-length-->
@@ -259,7 +259,7 @@ stdlib_strided_ssort2ins_ndarray( 4, 1.0f, x, 1, 0, y, 1, 0 );
259259
The function accepts the following arguments:
260260
261261
- **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.
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.
263263
- **X**: `[inout] float*` first input array.
264264
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
265265
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
@@ -268,7 +268,7 @@ The function accepts the following arguments:
268268
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
269269
270270
```c
271-
stdlib_strided_ssort2ins_ndarray( const CBLAS_INT N, const float order, float *X, CBLAS_INT strideX, CBLAS_INT offsetX, float *Y, CBLAS_INT strideY, CBLAS_INT offsetY );
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 );
272272
```
273273

274274
</section>

Diff for: lib/node_modules/@stdlib/blas/ext/base/ssort2ins/benchmark/c/benchmark.unsorted_random.length.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static double tic( void ) {
8282
*
8383
* @return random number
8484
*/
85-
static double rand_float( void ) {
85+
static float rand_float( void ) {
8686
int r = rand();
8787
return (float)r / ( (float)RAND_MAX + 1.0f );
8888
}

Diff for: lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/main.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void API_SUFFIX(stdlib_strided_ssort2ins)( const CBLAS_INT N, const float order,
4141

4242

4343
/**
44-
* Simultaneously sorts two signle-precision floating-point strided arrays based on the sort order of the first array using insertion sort and alternative indexing semantics.
44+
* 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.
4545
*
4646
* @param N number of indexed elements
4747
* @param order sort order
@@ -52,7 +52,7 @@ void API_SUFFIX(stdlib_strided_ssort2ins)( const CBLAS_INT N, const float order,
5252
* @param strideY stride length for `Y`
5353
* @param offsetY starting index for `Y`
5454
*/
55-
void API_SUFFIX(stdlib_strided_ssort2ins_ndarray)( const CBLAS_INT N, const float order, float *X, CBLAS_INT strideX, CBLAS_INT offsetX, float *Y, CBLAS_INT strideY, CBLAS_INT offsetY ) {
55+
void API_SUFFIX(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 ) {
5656
CBLAS_INT sx;
5757
CBLAS_INT sy;
5858
CBLAS_INT ox;
@@ -76,8 +76,8 @@ void API_SUFFIX(stdlib_strided_ssort2ins_ndarray)( const CBLAS_INT N, const floa
7676
}
7777
// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...
7878
if ( order < 0.0f ) {
79-
sx = strideX * -1;
80-
sy = strideY * -1;
79+
sx = -strideX;
80+
sy = -strideY;
8181
ox = offsetX - ( (N-1) * sx );
8282
oy = offsetY - ( (N-1) * sy );
8383
} else {

0 commit comments

Comments
 (0)