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 array are accessed at runtime. For example, to compute the sum of every other element in `x`,
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:
Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using alternative indexing semantics.
86
86
@@ -95,9 +95,9 @@ var v = snansum.ndarray( 4, x, 1, 0 );
95
95
96
96
The function has the following additional parameters:
97
97
98
-
-**offset**: starting index for `x`.
98
+
-**offsetX**: starting index.
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:
@@ -135,7 +135,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' );
135
135
var snansum =require( '@stdlib/blas/ext/base/snansum' );
136
136
137
137
functionrand() {
138
-
if ( bernoulli( 0.8 ) >0 ) {
138
+
if ( bernoulli( 0.5 ) <1 ) {
139
139
returndiscreteUniform( 0, 100 );
140
140
}
141
141
returnNaN;
@@ -152,6 +152,123 @@ console.log( v );
152
152
153
153
<!-- /.examples -->
154
154
155
+
<!-- C interface documentation. -->
156
+
157
+
* * *
158
+
159
+
<sectionclass="c">
160
+
161
+
## C APIs
162
+
163
+
<!-- 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/snansum.h"
179
+
```
180
+
181
+
#### stdlib_strided_snansum( N, \*X, strideX )
182
+
183
+
Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values.
184
+
185
+
```c
186
+
constfloat x[] = { 1.0f, 2.0f, 0.0f/0.0f, 4.0f };
187
+
188
+
float v = stdlib_strided_snansum( 4, x, 1 );
189
+
// returns 7.0f
190
+
```
191
+
192
+
The function accepts the following arguments:
193
+
194
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
0 commit comments