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
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the median value of every other element in `x`,
61
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the median value of every other element in `x`,
var dmediansorted =require( '@stdlib/stats/base/dmediansorted' );
146
138
147
-
var x;
148
-
var i;
149
-
150
-
x =newFloat64Array( 10 );
151
-
for ( i =0; i <x.length; i++ ) {
152
-
x[ i ] = i -5.0;
153
-
}
139
+
var options = {
140
+
'dtype':'float64'
141
+
};
142
+
var x =linspace( -5.0, 5.0, 10, options );
154
143
console.log( x );
155
144
156
145
var v =dmediansorted( x.length, x, 1 );
@@ -161,6 +150,123 @@ console.log( v );
161
150
162
151
<!-- /.examples -->
163
152
153
+
<!-- C interface documentation. -->
154
+
155
+
* * *
156
+
157
+
<sectionclass="c">
158
+
159
+
## C APIs
160
+
161
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
162
+
163
+
<sectionclass="intro">
164
+
165
+
</section>
166
+
167
+
<!-- /.intro -->
168
+
169
+
<!-- C usage documentation. -->
170
+
171
+
<sectionclass="usage">
172
+
173
+
### Usage
174
+
175
+
```c
176
+
#include"stdlib/stats/base/dmediansorted.h"
177
+
```
178
+
179
+
#### stdlib_strided_dmediansorted( N, \*X, strideX )
180
+
181
+
Computes the median value of a sorted double-precision floating-point strided array.
182
+
183
+
```c
184
+
constdouble x[] = { 1.0, 2.0, 3.0 };
185
+
186
+
double v = stdlib_strided_dmediansorted( 3, x, 1 );
187
+
// returns 2.0
188
+
```
189
+
190
+
The function accepts the following arguments:
191
+
192
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
193
+
- **X**: `[in] double*` input array.
194
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
0 commit comments