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
> Add a constant to each single-precision floating-point strided array element and compute the sum using pairwise summation with extended accumulation and returning an extended precision result.
23
+
> Add a constant to each single-precision floating-point strided array element, and compute the sum using pairwise summation with extended accumulation and returning an extended precision result.
24
24
25
25
<sectionclass="intro">
26
26
@@ -36,27 +36,27 @@ limitations under the License.
36
36
var dsapxsumpw =require( '@stdlib/blas/ext/base/dsapxsumpw' );
37
37
```
38
38
39
-
#### dsapxsumpw( N, alpha, x, stride )
39
+
#### dsapxsumpw( N, alpha, x, strideX )
40
40
41
-
Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation and returning an extended precision result.
41
+
Adds a constant to each single-precision floating-point strided array element, and computes the sum using pairwise summation with 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 access every other element in `x`,
59
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element:
@@ -81,25 +81,24 @@ var v = dsapxsumpw( 4, 5.0, x1, 2 );
81
81
// returns 25.0
82
82
```
83
83
84
-
#### dsapxsumpw.ndarray( N, alpha, x, stride, offset )
84
+
#### dsapxsumpw.ndarray( N, alpha, x, strideX, offsetX )
85
85
86
-
Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result.
86
+
Adds a constant to each single-precision floating-point strided array element, and computes the sum using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result.
var v =dsapxsumpw.ndarray( x.length, 5.0, x, 1, 0 );
95
94
// returns 16.0
96
95
```
97
96
98
97
The function has the following additional parameters:
99
98
100
-
-**offset**: starting index for `x`.
99
+
-**offsetX**: starting index for `x`.
101
100
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 access 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 access every other element starting from the second element:
@@ -132,11 +131,12 @@ var v = dsapxsumpw.ndarray( 4, 5.0, x, 2, 1 );
132
131
<!-- eslint no-undef: "error" -->
133
132
134
133
```javascript
135
-
var discreteUniform =require( '@stdlib/random/base/discrete-uniform' ).factory;
136
-
var filledarrayBy =require( '@stdlib/array/filled-by' );
134
+
var discreteUniform =require( '@stdlib/random/array/discrete-uniform' );
137
135
var dsapxsumpw =require( '@stdlib/blas/ext/base/dsapxsumpw' );
138
136
139
-
var x =filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
137
+
var x =discreteUniform( 10.0, -100, 100, {
138
+
'dtype':'float32'
139
+
});
140
140
console.log( x );
141
141
142
142
var v =dsapxsumpw( x.length, 5.0, x, 1 );
@@ -147,8 +147,125 @@ console.log( v );
147
147
148
148
<!-- /.examples -->
149
149
150
+
<!-- C interface documentation. -->
151
+
150
152
* * *
151
153
154
+
<sectionclass="c">
155
+
156
+
## C APIs
157
+
158
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
159
+
160
+
<sectionclass="intro">
161
+
162
+
</section>
163
+
164
+
<!-- /.intro -->
165
+
166
+
<!-- C usage documentation. -->
167
+
168
+
<sectionclass="usage">
169
+
170
+
### Usage
171
+
172
+
```c
173
+
#include"stdlib/blas/ext/base/dsapxsumpw.h"
174
+
```
175
+
176
+
#### stdlib_strided_dsapxsumpw( N, alpha, \*X, strideX )
177
+
178
+
Adds a constant to each single-precision floating-point strided array element, and computes the sum using pairwise summation with extended accumulation and returning an extended precision result.
179
+
180
+
```c
181
+
constfloat x[] = { 1.0f, -2.0f, 2.0f };
182
+
183
+
double v = stdlib_strided_dsapxsumpw( 3, 5.0f, x, 1 );
184
+
// returns 16.0
185
+
```
186
+
187
+
The function accepts the following arguments:
188
+
189
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
190
+
- **alpha**: `[in] float` scalar constant.
191
+
- **X**: `[in] float*` input array.
192
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
#### stdlib_strided_dsapxsumpw_ndarray( N, alpha, \*X, strideX, offsetX )
199
+
200
+
Adds a constant to each single-precision floating-point strided array element, and computes the sum using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result.
201
+
202
+
```c
203
+
constfloat x[] = { 1.0f, -2.0f, 2.0f };
204
+
205
+
double v = stdlib_strided_dsapxsumpw_ndarray( 3, 5.0f, x, 1, 0 );
206
+
// returns 16.0
207
+
```
208
+
209
+
The function accepts the following arguments:
210
+
211
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
212
+
- **alpha**: `[in] float` scalar constant.
213
+
- **X**: `[in] float*` input array.
214
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
215
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
0 commit comments