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
var ssorthp =require( '@stdlib/blas/ext/base/ssorthp' );
31
31
```
32
32
33
-
#### ssorthp( N, order, x, stride )
33
+
#### ssorthp( N, order, x, strideX )
34
34
35
35
Sorts a single-precision floating-point strided array using heapsort.
36
36
@@ -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 the strided array
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 discreteUniform =require( '@stdlib/random/base/discrete-uniform' ).factory;
135
-
var filledarrayBy =require( '@stdlib/array/filled-by' );
134
+
var discreteUniform =require( '@stdlib/random/array/discrete-uniform' );
136
135
var ssorthp =require( '@stdlib/blas/ext/base/ssorthp' );
137
136
138
-
varrand=discreteUniform( -100, 100 );
139
-
var x =filledarrayBy( 10,'float32', rand );
140
-
137
+
varx=discreteUniform( 10, -100, 100, {
138
+
'dtype':'float32'
139
+
});
141
140
console.log( x );
142
141
143
142
ssorthp( x.length, -1.0, x, -1 );
@@ -150,6 +149,125 @@ console.log( x );
150
149
151
150
* * *
152
151
152
+
<sectionclass="c">
153
+
154
+
## C APIs
155
+
156
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
157
+
158
+
<sectionclass="intro">
159
+
160
+
</section>
161
+
162
+
<!-- /.intro -->
163
+
164
+
<!-- C usage documentation. -->
165
+
166
+
<sectionclass="usage">
167
+
168
+
### Usage
169
+
170
+
```c
171
+
#include"stdlib/blas/ext/base/ssorthp.h"
172
+
```
173
+
174
+
#### stdlib_strided_ssorthp( N, order, \*X, strideX )
175
+
176
+
Sorts a single-precision floating-point strided array using heapsort.
177
+
178
+
```c
179
+
float x[] = { 1.0f, -2.0f, 3.0f, -4.0f };
180
+
181
+
stdlib_strided_ssorthp( 2, -1.0f, x, 1 );
182
+
```
183
+
184
+
The function accepts the following arguments:
185
+
186
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
187
+
- **order**: `[in] float` 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.
- **N**: `[in] CBLAS_INT` number of indexed elements.
212
+
- **order**: `[in] float` 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.
0 commit comments