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/dssumpw/README.md
+129-13
Original file line number
Diff line number
Diff line change
@@ -36,27 +36,26 @@ limitations under the License.
36
36
var dssumpw =require( '@stdlib/blas/ext/base/dssumpw' );
37
37
```
38
38
39
-
#### dssumpw( N, x, stride )
39
+
#### dssumpw( N, x, strideX )
40
40
41
41
Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.
Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result.
The function has the following additional parameters:
99
97
100
-
-**offset**: starting index for `x`.
98
+
-**offsetX**: starting index for `x`.
101
99
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
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:
@@ -132,11 +130,12 @@ var v = dssumpw.ndarray( 4, x, 2, 1 );
132
130
<!-- eslint no-undef: "error" -->
133
131
134
132
```javascript
135
-
var discreteUniform =require( '@stdlib/random/base/discrete-uniform' ).factory;
136
-
var filledarrayBy =require( '@stdlib/array/filled-by' );
133
+
var discreteUniform =require( '@stdlib/random/array/discrete-uniform' );
137
134
var dssumpw =require( '@stdlib/blas/ext/base/dssumpw' );
138
135
139
-
var x =filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
136
+
var x =discreteUniform( 10.0, -100, 100, {
137
+
'dtype':'float32'
138
+
});
140
139
console.log( x );
141
140
142
141
var v =dssumpw( x.length, x, 1 );
@@ -147,6 +146,123 @@ console.log( v );
147
146
148
147
<!-- /.examples -->
149
148
149
+
<!-- C interface documentation. -->
150
+
151
+
* * *
152
+
153
+
<sectionclass="c">
154
+
155
+
## C APIs
156
+
157
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
158
+
159
+
<sectionclass="intro">
160
+
161
+
</section>
162
+
163
+
<!-- /.intro -->
164
+
165
+
<!-- C usage documentation. -->
166
+
167
+
<sectionclass="usage">
168
+
169
+
### Usage
170
+
171
+
```c
172
+
#include"stdlib/blas/ext/base/dssumpw.h"
173
+
```
174
+
175
+
#### stdlib_strided_dssumpw( N, \*X, strideX )
176
+
177
+
Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.
178
+
179
+
```c
180
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
181
+
182
+
double v = stdlib_strided_dssumpw( 4, x, 1 );
183
+
// returns 10.0
184
+
```
185
+
186
+
The function accepts the following arguments:
187
+
188
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
189
+
- **X**: `[in] float*` input array.
190
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
#### stdlib_strided_dssumpw_ndarray( N, \*X, strideX, offsetX )
197
+
198
+
Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result.
199
+
200
+
```c
201
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
202
+
203
+
double v = stdlib_strided_dssumpw_ndarray( 4, x, 1, 0 );
204
+
// returns 10.0
205
+
```
206
+
207
+
The function accepts the following arguments:
208
+
209
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
210
+
- **X**: `[in] float*` input array.
211
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
212
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
0 commit comments