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`,
59
59
@@ -80,7 +80,7 @@ var v = dnansumkbn( 4, x1, 2 );
80
80
// returns 5.0
81
81
```
82
82
83
-
#### dnansumkbn.ndarray( N, x, stride, offset )
83
+
#### dnansumkbn.ndarray( N, x, strideX, offsetX )
84
84
85
85
Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm and alternative indexing semantics.
86
86
@@ -89,15 +89,15 @@ var Float64Array = require( '@stdlib/array/float64' );
89
89
90
90
var x =newFloat64Array( [ 1.0, -2.0, NaN, 2.0 ] );
91
91
92
-
var v =dnansumkbn.ndarray( 4, x, 1, 0 );
92
+
var v =dnansumkbn.ndarray( x.length, x, 1, 0 );
93
93
// returns 1.0
94
94
```
95
95
96
96
The function has the following additional parameters:
97
97
98
-
-**offset**: starting index for `x`.
98
+
-**offsetX**: starting index for `x`.
99
99
100
-
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
100
+
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. -->
164
+
165
+
<sectionclass="intro">
166
+
167
+
</section>
168
+
169
+
<!-- /.intro -->
170
+
171
+
<!-- C usage documentation. -->
172
+
173
+
<sectionclass="usage">
174
+
175
+
### Usage
176
+
177
+
```c
178
+
#include"stdlib/blas/ext/base/dnansumkbn.h"
179
+
```
180
+
181
+
#### stdlib_strided_dnansumkbn( N, \*X, strideX )
182
+
183
+
Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm.
184
+
185
+
```c
186
+
constdouble x[] = { 1.0, 2.0, 0.0/0.0, 4.0 };
187
+
188
+
double v = stdlib_strided_dnansumkbn( 4, x, 1 );
189
+
// returns 7.0
190
+
```
191
+
192
+
The function accepts the following arguments:
193
+
194
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
195
+
- **X**: `[in] double*` input array.
196
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
#### stdlib_strided_dnansumkbn_ndarray( N, \*X, strideX, offsetX )
203
+
204
+
Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm and alternative indexing semantics.
205
+
206
+
```c
207
+
constdouble x[] = { 1.0, 2.0, 0.0/0.0, 4.0 };
208
+
209
+
double v = stdlib_strided_dnansumkbn_ndarray( 4, x, 1, 0 );
210
+
// returns 7.0
211
+
```
212
+
213
+
The function accepts the following arguments:
214
+
215
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
216
+
- **X**: `[in] double*` input array.
217
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
218
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
0 commit comments