Skip to content

Commit 5bf3254

Browse files
fix: update documentation for dsortsh parameters and examples
--- 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: passed - 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: na - task: lint_c_benchmarks status: na - 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 6d90d5b commit 5bf3254

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The function has the following parameters:
5050
- **x**: input [`Float64Array`][@stdlib/array/float64].
5151
- **strideX**: stride length.
5252

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

5555
```javascript
5656
var Float64Array = require( '@stdlib/array/float64' );
@@ -94,7 +94,7 @@ The function has the following additional parameters:
9494

9595
- **offsetX**: starting index.
9696

97-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements:
97+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements:
9898

9999
```javascript
100100
var Float64Array = require( '@stdlib/array/float64' );
@@ -132,11 +132,12 @@ dsortsh.ndarray( 3, 1.0, x, 1, x.length-3 );
132132
<!-- eslint no-undef: "error" -->
133133

134134
```javascript
135-
var filledarrayBy = require( '@stdlib/array/filled-by' );
136-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
135+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
137136
var dsortsh = require( '@stdlib/blas/ext/base/dsortsh' );
138137

139-
var x = filledarrayBy( 100, 'float64', uniform( -100.0, 100.0 ) );
138+
var x = discreteUniform( 10, -100, 100, {
139+
'dtype': 'float64'
140+
});
140141
console.log( x );
141142

142143
dsortsh( x.length, -1.0, x, -1 );
@@ -227,10 +228,10 @@ stdlib_strided_dsortsh_ndarray( 4, 1.0, x, 1, 0 );
227228
The function accepts the following arguments:
228229
229230
- **N**: `[in] CBLAS_INT` number of indexed elements.
230-
- **order**: `[in] CBLAS_INT` 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.
231-
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
231+
- **order**: `[in] double` 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.
232+
- **strideX**: `[in] CBLAS_INT` stride length.
232233
- **X**: `[inout] double*` input array.
233-
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
234+
- **offsetX**: `[in] CBLAS_INT` starting index.
234235
235236
```c
236237
stdlib_strided_dsortsh_ndarray( const CBLAS_INT N, const double order, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{{alias}}( N, order, x, strideX )
33
Sorts a double-precision floating-point strided array using Shellsort.
44

5-
The `N` and stride parameters determine which elements in are accessed
6-
at runtime.
5+
The `N` and stride parameters determine which elements in the strided array
6+
are accessed at runtime.
77

88
Indexing is relative to the first index. To introduce an offset, use typed
99
array views.
@@ -48,7 +48,7 @@
4848
Returns
4949
-------
5050
x: Float64Array
51-
Output Array.
51+
Input array.
5252

5353
Examples
5454
--------
@@ -76,8 +76,8 @@
7676
alternative indexing semantics.
7777

7878
While typed array views mandate a view offset based on the underlying
79-
buffer, the offset parameter supports indexing semantics based on a
80-
starting index.
79+
buffer, the offset parameter supports indexing semantics based on a starting
80+
index.
8181

8282
Parameters
8383
----------
@@ -100,7 +100,7 @@
100100
Returns
101101
-------
102102
x: Float64Array
103-
Output Array.
103+
Input array.
104104

105105
Examples
106106
--------

lib/node_modules/@stdlib/blas/ext/base/dsortsh/examples/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818

1919
'use strict';
2020

21-
var filledarrayBy = require( '@stdlib/array/filled-by' );
22-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
21+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
2322
var dsortsh = require( './../lib' );
2423

25-
var x = filledarrayBy( 100, 'float64', uniform( -100.0, 100.0 ) );
24+
var x = discreteUniform( 10, -100, 100, {
25+
'dtype': 'float64'
26+
});
2627
console.log( x );
2728

2829
dsortsh( x.length, -1.0, x, -1 );

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* @param N number of indexed elements
3939
* @param order sort order
4040
* @param X input array
41-
* @param strideX index increment
41+
* @param strideX stride length
4242
*/
4343
void API_SUFFIX(stdlib_strided_dsortsh)( const CBLAS_INT N, const double order, double *X, const CBLAS_INT strideX ) {
4444
CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
@@ -51,7 +51,7 @@ void API_SUFFIX(stdlib_strided_dsortsh)( const CBLAS_INT N, const double order,
5151
* @param N number of indexed elements
5252
* @param order sort order
5353
* @param X input array
54-
* @param strideX index increment
54+
* @param strideX stride length
5555
* @param offsetX starting index
5656
*/
5757
void API_SUFFIX(stdlib_strided_dsortsh_ndarray)( const CBLAS_INT N, const double order, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {

0 commit comments

Comments
 (0)