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
-**stride**: index increment for the strided array.
56
+
-**strideX**: stride length for `x`.
58
57
59
-
The `N` and `stride` parameters determine which elements in the strided array are
60
-
accessed at runtime. For example, to compute the sum of every other element in
61
-
the strided array.
58
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element:
@@ -84,25 +81,24 @@ var v = snansumors( 4, x1, 2 );
84
81
// returns 5.0
85
82
```
86
83
87
-
#### snansumors.ndarray( N, x, stride, offset )
84
+
#### snansumors.ndarray( N, x, strideX, offsetX )
88
85
89
86
Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics.
var x =newFloat32Array( [ 1.0, -2.0, NaN, 2.0 ] );
95
-
varN=x.length;
96
92
97
-
var v =snansumors.ndarray( N, x, 1, 0 );
93
+
var v =snansumors.ndarray( x.length, x, 1, 0 );
98
94
// returns 1.0
99
95
```
100
96
101
97
The function has the following additional parameters:
102
98
103
-
-**offset**: starting index for `x`.
99
+
-**offsetX**: starting index for `x`.
104
100
105
-
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/snansumors.h"
181
+
```
182
+
183
+
#### stdlib_strided_snansumors( N, \*X, strideX )
184
+
185
+
Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.
#### stdlib_strided_snansumors_ndarray( N, \*X, strideX, offsetX )
205
+
206
+
Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics.
* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics.
45
45
*
46
46
* @param N - number of indexed elements
47
47
* @param x - input array
48
-
* @paramstride - stride length
49
-
* @paramoffset - starting index
48
+
* @paramstrideX - stride length
49
+
* @paramoffsetX - starting index
50
50
* @returns sum
51
51
*
52
52
* @example
@@ -57,15 +57,15 @@ interface Routine {
57
57
* var v = snansumors.ndarray( x.length, x, 1, 0 );
0 commit comments