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