You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -48,9 +48,9 @@ The function has the following parameters:
48
48
-**N**: number of indexed elements.
49
49
-**order**: sort order. If `order < 0.0`, the input strided array is sorted in **decreasing** order. If `order > 0.0`, the input strided array is sorted in **increasing** order. If `order == 0.0`, the input strided array is left unchanged.
The function has the following additional parameters:
94
94
95
-
-**offset**: starting index.
95
+
-**offsetX**: starting index.
96
96
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 of `x`
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:
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' );
137
136
var dsortins =require( '@stdlib/blas/ext/base/dsortins' );
138
137
139
-
var x =filledarrayBy( 100, 'float64', uniform( -100.0, 100.0 ) );
138
+
var x =discreteUniform( 10, -100, 100, {
139
+
'dtype':'float64'
140
+
});
140
141
console.log( x );
141
142
142
143
dsortins( x.length, -1.0, x, -1 );
@@ -153,6 +154,118 @@ console.log( x );
153
154
154
155
* * *
155
156
157
+
</section>
158
+
159
+
<!-- /.intro -->
160
+
161
+
<!-- C usage documentation. -->
162
+
163
+
<sectionclass="usage">
164
+
165
+
### Usage
166
+
167
+
```c
168
+
#include"stdlib/blas/ext/base/dsortins.h"
169
+
```
170
+
171
+
#### stdlib_strided_dsortins( N, order, \*X, strideX )
172
+
173
+
Sorts a double-precision floating-point strided array using insertion sort.
174
+
175
+
```c
176
+
double x[] = { 1.0, -2.0, 3.0, -4.0 };
177
+
178
+
stdlib_strided_dsortins( 2, -1.0, x, 1 );
179
+
```
180
+
181
+
The function accepts the following arguments:
182
+
183
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
184
+
- **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.
185
+
- **X**: `[inout] double*` input array.
186
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
- **N**: `[in] CBLAS_INT` number of indexed elements.
209
+
- **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.
210
+
- **X**: `[inout] double*` input array.
211
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
212
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
- <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