Skip to content

Commit 4d090b7

Browse files
docs: improve clarity in README and documentation for ssort2ins function
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: passed - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent e07f9ab commit 4d090b7

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The function has the following parameters:
5858
- **y**: second input [`Float32Array`][@stdlib/array/float32].
5959
- **strideY**: stride length for `y`.
6060

61-
The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to sort every other element
61+
The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to sort every other element:
6262

6363
```javascript
6464
var Float32Array = require( '@stdlib/array/float32' );
@@ -232,9 +232,9 @@ The function accepts the following arguments:
232232
233233
- **N**: `[in] CBLAS_INT` number of indexed elements.
234234
- **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*` input array.
235+
- **X**: `[inout] float*` first input array.
236236
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
237-
- **Y**: `[inout] float*` input array.
237+
- **Y**: `[inout] float*` second input array.
238238
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
239239
240240
```c
@@ -260,10 +260,10 @@ The function accepts the following arguments:
260260
261261
- **N**: `[in] CBLAS_INT` number of indexed elements.
262262
- **order**: `[in] float` sort order.
263-
- **X**: `[inout] float*` input array.
263+
- **X**: `[inout] float*` first input array.
264264
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
265265
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
266-
- **Y**: `[inout] float*` input array.
266+
- **Y**: `[inout] float*` second input array.
267267
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
268268
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
269269
@@ -311,7 +311,7 @@ int main( void ) {
311311
// Print the result:
312312
for ( int i = 0; i < 8; i++ ) {
313313
printf( "x[ %i ] = %f\n", i, x[ i ] );
314-
printf( "y[ %i ] = %lf\n", i, y[ i ] );
314+
printf( "y[ %i ] = %f\n", i, y[ i ] );
315315
}
316316
}
317317
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ static double benchmark2( int iterations, int len ) {
138138
float *y;
139139
int i;
140140

141-
x = (float *)malloc( len * sizeof(float) );
142-
y = (float *)malloc( len * sizeof(float) );
141+
x = ( float * )malloc( len * sizeof(float) );
142+
y = ( float * )malloc( len * sizeof(float) );
143143
for ( i = 0; i < len; i++ ) {
144144
x[ i ] = ( rand_float()*20.0f ) - 10.0f;
145145
y[ i ] = ( rand_float()*20.0f ) - 10.0f;

lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
Stride length for `x`.
117117

118118
offsetX: integer
119-
Starting index of `x`.
119+
Starting index for `x`.
120120

121121
y: Float32Array
122122
Second input array.
@@ -125,7 +125,7 @@
125125
Stride length for `y`.
126126

127127
offsetY: integer
128-
Starting index of `y`.
128+
Starting index for `y`.
129129

130130
Returns
131131
-------

lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int main( void ) {
3737
// Print the result:
3838
for ( int i = 0; i < 8; i++ ) {
3939
printf( "x[ %i ] = %f\n", i, x[ i ] );
40-
printf( "y[ %i ] = %lf\n", i, y[ i ] );
40+
printf( "y[ %i ] = %f\n", i, y[ i ] );
4141
}
4242
}
4343

lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
* @param N number of indexed elements
3030
* @param order sort order
3131
* @param X first input array
32-
* @param strideX stride length for `x`
32+
* @param strideX stride length for `X`
3333
* @param Y second input array
34-
* @param strideY stride length for `y`
34+
* @param strideY stride length for `Y`
3535
*/
3636
void API_SUFFIX(stdlib_strided_ssort2ins)( const CBLAS_INT N, const float order, float *X, const CBLAS_INT strideX, float *Y, const CBLAS_INT strideY ) {
3737
CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
@@ -46,11 +46,11 @@ void API_SUFFIX(stdlib_strided_ssort2ins)( const CBLAS_INT N, const float order,
4646
* @param N number of indexed elements
4747
* @param order sort order
4848
* @param X first input array
49-
* @param strideX stride length for `x`
50-
* @param offsetX starting index for `x`
49+
* @param strideX stride length for `X`
50+
* @param offsetX starting index for `X`
5151
* @param Y second input array
52-
* @param strideY stride length for `y`
53-
* @param offsetY starting index for `y`
52+
* @param strideY stride length for `Y`
53+
* @param offsetY starting index for `Y`
5454
*/
5555
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 ) {
5656
CBLAS_INT sx;
@@ -86,12 +86,12 @@ void API_SUFFIX(stdlib_strided_ssort2ins_ndarray)( const CBLAS_INT N, const floa
8686
ox = offsetX;
8787
oy = offsetY;
8888
}
89-
fx = ox; // first index
90-
lx = fx + ((N-1)*sx); // last index
89+
fx = ox; // first index
90+
lx = fx + ( (N-1)*sx ); // last index
9191
ix = fx + sx;
9292

93-
fy = oy; // first index
94-
ly = fy + ((N-1)*sy); // last index
93+
fy = oy; // first index
94+
ly = fy + ( (N-1)*sy ); // last index
9595
iy = fy + sy;
9696

9797
if ( sx < 0 ) {

0 commit comments

Comments
 (0)