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 the strided array,
59
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element:
@@ -80,9 +81,9 @@ var v = sdsapxsum( 4, 5.0, x1, 2 );
80
81
// returns 25.0
81
82
```
82
83
83
-
#### sdsapxsum.ndarray( N, alpha, x, stride, offset )
84
+
#### sdsapxsum.ndarray( N, alpha, x, strideX, offsetX )
84
85
85
-
Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation and alternative indexing semantics.
86
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using extended accumulation and alternative indexing semantics.
@@ -95,9 +96,9 @@ var v = sdsapxsum.ndarray( 3, 5.0, x, 1, 0 );
95
96
96
97
The function has the following additional parameters:
97
98
98
-
-**offset**: starting index for `x`.
99
+
-**offsetX**: starting index.
99
100
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 access every other value in the strided array 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:
@@ -130,11 +131,12 @@ var v = sdsapxsum.ndarray( 4, 5.0, x, 2, 1 );
130
131
<!-- eslint no-undef: "error" -->
131
132
132
133
```javascript
133
-
var discreteUniform =require( '@stdlib/random/base/discrete-uniform' ).factory;
134
-
var filledarrayBy =require( '@stdlib/array/filled-by' );
134
+
var discreteUniform =require( '@stdlib/random/array/discrete-uniform' );
135
135
var sdsapxsum =require( '@stdlib/blas/ext/base/sdsapxsum' );
136
136
137
-
var x =filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
137
+
var x =discreteUniform( 10, -100, 100, {
138
+
'dtype':'float32'
139
+
});
138
140
console.log( x );
139
141
140
142
var v =sdsapxsum( x.length, 5.0, x, 1 );
@@ -145,6 +147,125 @@ console.log( v );
145
147
146
148
<!-- /.examples -->
147
149
150
+
<!-- C interface documentation. -->
151
+
152
+
* * *
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/sdsapxsum.h"
174
+
```
175
+
176
+
#### stdlib_strided_sdsapxsum( N, alpha, \*X, strideX )
177
+
178
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using extended accumulation.
179
+
180
+
```c
181
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
182
+
183
+
float v = stdlib_strided_sdsapxsum( 4, 5.0f, x, 1 );
184
+
// returns 30.0f
185
+
```
186
+
187
+
The function accepts the following arguments:
188
+
189
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
#### stdlib_strided_sdsapxsum_ndarray( N, alpha, \*X, strideX, offsetX )
199
+
200
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using extended accumulation and alternative indexing semantics.
201
+
202
+
```c
203
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
204
+
205
+
float v = stdlib_strided_sdsapxsum_ndarray( 4, 5.0f, x, 1, 0 );
206
+
// returns 30.0f
207
+
```
208
+
209
+
The function accepts the following arguments:
210
+
211
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
0 commit comments