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
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/blas/ext/base/dsnansum/README.md
+128-12
Original file line number
Diff line number
Diff line change
@@ -36,27 +36,26 @@ limitations under the License.
36
36
var dsnansum =require( '@stdlib/blas/ext/base/dsnansum' );
37
37
```
38
38
39
-
#### dsnansum( N, x, stride )
39
+
#### dsnansum( N, x, strideX )
40
40
41
41
Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.
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 extended accumulation and alternative indexing semantics.
85
+
Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation and alternative indexing semantics, and returning an extended precision result.
var x =newFloat32Array( [ 1.0, -2.0, NaN, 2.0 ] );
92
91
93
-
var v =dsnansum.ndarray( 4, x, 1, 0 );
92
+
var v =dsnansum.ndarray( x.length, x, 1, 0 );
94
93
// returns 1.0
95
94
```
96
95
97
96
The function has the following additional parameters:
98
97
99
-
-**offset**: starting index for `x`.
98
+
-**offsetX**: starting index for `x`.
100
99
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 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:
@@ -136,14 +135,14 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
136
135
var filledarrayBy =require( '@stdlib/array/filled-by' );
137
136
var dsnansum =require( '@stdlib/blas/ext/base/dsnansum' );
138
137
139
-
functionclbk() {
138
+
functionrand() {
140
139
if ( bernoulli( 0.7 ) >0 ) {
141
140
returndiscreteUniform( -10, 10 );
142
141
}
143
142
returnNaN;
144
143
}
145
144
146
-
var x =filledarrayBy( 10, 'float64', clbk );
145
+
var x =filledarrayBy( 10, 'float32', rand );
147
146
console.log( x );
148
147
149
148
var v =dsnansum( x.length, x, 1 );
@@ -154,6 +153,123 @@ console.log( v );
154
153
155
154
<!-- /.examples -->
156
155
156
+
<!-- C interface documentation. -->
157
+
158
+
* * *
159
+
160
+
<sectionclass="c">
161
+
162
+
## C APIs
163
+
164
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
165
+
166
+
<sectionclass="intro">
167
+
168
+
</section>
169
+
170
+
<!-- /.intro -->
171
+
172
+
<!-- C usage documentation. -->
173
+
174
+
<sectionclass="usage">
175
+
176
+
### Usage
177
+
178
+
```c
179
+
#include"stdlib/blas/ext/base/dsnansum.h"
180
+
```
181
+
182
+
#### stdlib_strided_dsnansum( N, \*X, strideX )
183
+
184
+
Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.
#### stdlib_strided_dsnansum_ndarray( N, \*X, strideX, offsetX )
204
+
205
+
Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation and alternative indexing semantics, and returning an extended precision result.
0 commit comments