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 access every other element in `x`,
60
60
@@ -81,9 +81,9 @@ var v = dapxsumpw( 4, 5.0, x1, 2 );
81
81
// returns 25.0
82
82
```
83
83
84
-
#### dapxsumpw.ndarray( N, alpha, x, stride, offset )
84
+
#### dapxsumpw.ndarray( N, alpha, x, strideX, offsetX )
85
85
86
-
Adds a constant to each double-precision floating-point strided array element and computes the sum using pairwise summation and alternative indexing semantics.
86
+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using pairwise summation and alternative indexing semantics.
@@ -97,9 +97,9 @@ var v = dapxsumpw.ndarray( N, 5.0, x, 1, 0 );
97
97
98
98
The function has the following additional parameters:
99
99
100
-
-**offset**: starting index for `x`.
100
+
-**offsetX**: starting index for `x`.
101
101
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
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
@@ -131,11 +131,12 @@ var v = dapxsumpw.ndarray( 4, 5.0, x, 2, 1 );
131
131
<!-- eslint no-undef: "error" -->
132
132
133
133
```javascript
134
-
var discreteUniform =require( '@stdlib/random/base/discrete-uniform' ).factory;
135
-
var filledarrayBy =require( '@stdlib/array/filled-by' );
134
+
var discreteUniform =require( '@stdlib/random/array/discrete-uniform' );
136
135
var dapxsumpw =require( '@stdlib/blas/ext/base/dapxsumpw' );
137
136
138
-
var x =filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) );
137
+
var x =discreteUniform( 10, -100, 100, {
138
+
'dtype':'float64'
139
+
});
139
140
console.log( x );
140
141
141
142
var v =dapxsumpw( x.length, 5.0, x, 1 );
@@ -146,8 +147,125 @@ console.log( v );
146
147
147
148
<!-- /.examples -->
148
149
150
+
<!-- C interface documentation. -->
151
+
149
152
* * *
150
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/dapxsumpw.h"
174
+
```
175
+
176
+
#### stdlib_strided_dapxsumpw( N, alpha, \*X, strideX )
177
+
178
+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using pairwise summation.
179
+
180
+
```c
181
+
constdouble x[] = { 1.0, 2.0, 3.0, 4.0 };
182
+
183
+
double v = stdlib_strided_dapxsumpw( 4, 5.0, x, 1 );
184
+
// returns 30.0
185
+
```
186
+
187
+
The function accepts the following arguments:
188
+
189
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
190
+
- **alpha**: `[in] double` scalar constant.
191
+
- **X**: `[in] double*` input array.
192
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
#### stdlib_strided_dapxsumpw_ndarray( N, alpha, \*X, strideX, offsetX )
199
+
200
+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using pairwise summation and alternative indexing semantics.
201
+
202
+
```c
203
+
constdouble x[] = { 1.0, 2.0, 3.0, 4.0 };
204
+
205
+
double v = stdlib_strided_dapxsumpw_ndarray( 4, 5.0, x, 1, 0 );
206
+
// returns 30.0
207
+
```
208
+
209
+
The function accepts the following arguments:
210
+
211
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
212
+
- **alpha**: `[in] double` scalar constant.
213
+
- **X**: `[in] double*` input array.
214
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
215
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
0 commit comments