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 the strided arrays are accessed at runtime. For example, to compute the sum of every other element in `x`,
60
59
@@ -82,7 +81,7 @@ var v = dnansumors( 4, x1, 2 );
82
81
// returns 5.0
83
82
```
84
83
85
-
#### dnansumors.ndarray( N, x, stride, offset )
84
+
#### dnansumors.ndarray( N, x, strideX, offsetX )
86
85
87
86
Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics.
88
87
@@ -91,15 +90,15 @@ var Float64Array = require( '@stdlib/array/float64' );
91
90
92
91
var x =newFloat64Array( [ 1.0, -2.0, NaN, 2.0 ] );
93
92
94
-
var v =dnansumors.ndarray( 4, x, 1, 0 );
93
+
var v =dnansumors.ndarray( x.length, x, 1, 0 );
95
94
// returns 1.0
96
95
```
97
96
98
97
The function has the following additional parameters:
99
98
100
-
-**offset**: starting index for `x`.
99
+
-**offsetX**: starting index for `x`.
101
100
102
-
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 calculate the sum of every other value in `x`starting from the second value
101
+
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 calculate the sum of every other element starting from the second element,
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
166
+
167
+
<sectionclass="intro">
168
+
169
+
</section>
170
+
171
+
<!-- /.intro -->
172
+
173
+
<!-- C usage documentation. -->
174
+
175
+
<sectionclass="usage">
176
+
177
+
### Usage
178
+
179
+
```c
180
+
#include"stdlib/blas/ext/base/dnansumors.h"
181
+
```
182
+
183
+
#### stdlib_strided_dnansumors( N, \*X, strideX )
184
+
185
+
Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.
186
+
187
+
```c
188
+
constdouble x[] = { 1.0, 2.0, 0.0/0.0, 4.0 };
189
+
190
+
double v = stdlib_strided_dnansumors( 4, x, 1 );
191
+
// returns 7.0
192
+
```
193
+
194
+
The function accepts the following arguments:
195
+
196
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
197
+
- **X**: `[in] double*` input array.
198
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
#### stdlib_strided_dnansumors_ndarray( N, \*X, strideX, offsetX )
205
+
206
+
Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics.
207
+
208
+
```c
209
+
constdouble x[] = { 1.0, 2.0, 0.0/0.0, 4.0 };
210
+
211
+
double v = stdlib_strided_dnansumors_ndarray( 4, x, 1, 0 );
212
+
// returns 7.0
213
+
```
214
+
215
+
The function accepts the following arguments:
216
+
217
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
218
+
- **X**: `[in] double*` input array.
219
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
220
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
0 commit comments