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
61
@@ -81,9 +82,9 @@ var v = dapxsumors( 4, 5.0, x1, 2 );
81
82
// returns 25.0
82
83
```
83
84
84
-
#### dapxsumors.ndarray( N, alpha, x, stride, offset )
85
+
#### dapxsumors.ndarray( N, alpha, x, strideX, offsetX )
85
86
86
-
Adds a constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics.
87
+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics.
@@ -97,9 +98,9 @@ var v = dapxsumors.ndarray( N, 5.0, x, 1, 0 );
97
98
98
99
The function has the following additional parameters:
99
100
100
-
-**offset**: starting index for `x`.
101
+
-**offsetX**: starting index for `x`.
101
102
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
103
+
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
@@ -132,11 +133,12 @@ var v = dapxsumors.ndarray( 4, 5.0, x, 2, 1 );
132
133
<!-- eslint no-undef: "error" -->
133
134
134
135
```javascript
135
-
var discreteUniform =require( '@stdlib/random/base/discrete-uniform' ).factory;
136
-
var filledarrayBy =require( '@stdlib/array/filled-by' );
136
+
var discreteUniform =require( '@stdlib/random/array/discrete-uniform' );
137
137
var dapxsumors =require( '@stdlib/blas/ext/base/dapxsumors' );
138
138
139
-
var x =filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
139
+
var x =discreteUniform( 10, -100, 100, {
140
+
'dtype':'float64'
141
+
});
140
142
console.log( x );
141
143
142
144
var v =dapxsumors( x.length, 5.0, x, 1 );
@@ -147,6 +149,125 @@ console.log( v );
147
149
148
150
<!-- /.examples -->
149
151
152
+
<!-- C interface documentation. -->
153
+
154
+
* * *
155
+
156
+
<sectionclass="c">
157
+
158
+
## C APIs
159
+
160
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
161
+
162
+
<sectionclass="intro">
163
+
164
+
</section>
165
+
166
+
<!-- /.intro -->
167
+
168
+
<!-- C usage documentation. -->
169
+
170
+
<sectionclass="usage">
171
+
172
+
### Usage
173
+
174
+
```c
175
+
#include"stdlib/blas/ext/base/dapxsumors.h"
176
+
```
177
+
178
+
#### stdlib_strided_dapxsumors( N, alpha, \*X, strideX )
179
+
180
+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation.
181
+
182
+
```c
183
+
constdouble x[] = { 1.0, 2.0, 3.0, 4.0 };
184
+
185
+
double v = stdlib_strided_dapxsumors( 4, 5.0, x, 1 );
186
+
// returns 30.0
187
+
```
188
+
189
+
The function accepts the following arguments:
190
+
191
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
192
+
- **alpha**: `[in] double` scalar constant.
193
+
- **X**: `[in] double*` input array.
194
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
#### stdlib_strided_dapxsumors_ndarray( N, alpha, \*X, strideX, offsetX )
201
+
202
+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics.
203
+
204
+
```c
205
+
constdouble x[] = { 1.0, 2.0, 3.0, 4.0 };
206
+
207
+
double v = stdlib_strided_dapxsumors_ndarray( 4, 5.0, x, 1, 0 );
208
+
// returns 30.0
209
+
```
210
+
211
+
The function accepts the following arguments:
212
+
213
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
214
+
- **alpha**: `[in] double` scalar constant.
215
+
- **X**: `[in] double*` input array.
216
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
217
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
0 commit comments