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`,
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 = sapxsumors( 4, 5.0, x1, 2 );
80
81
// returns 25.0
81
82
```
82
83
83
-
#### sapxsumors.ndarray( N, alpha, x, stride, offset )
84
+
#### sapxsumors.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 ordinary recursive summation and alternative indexing semantics.
86
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics.
@@ -95,9 +96,9 @@ var v = sapxsumors.ndarray( x.length, 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 `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:
var sapxsumors =require( '@stdlib/blas/ext/base/sapxsumors' );
137
137
138
-
var x =filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
138
+
var x =discreteUniform( 10, -100, 100, {
139
+
'dtype':'float32'
140
+
});
139
141
console.log( x );
140
142
141
143
var v =sapxsumors( x.length, 5.0, x, 1 );
@@ -146,6 +148,125 @@ console.log( v );
146
148
147
149
<!-- /.examples -->
148
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/sapxsumors.h"
175
+
```
176
+
177
+
#### stdlib_strided_sapxsumors( N, alpha, \*X, strideX )
178
+
179
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.
180
+
181
+
```c
182
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
183
+
184
+
float v = stdlib_strided_sapxsumors( 4, 5.0f, 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.
#### stdlib_strided_sapxsumors_ndarray( N, alpha, \*X, strideX, offsetX )
200
+
201
+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics.
202
+
203
+
```c
204
+
constfloat x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
205
+
206
+
float v = stdlib_strided_sapxsumors_ndarray( 4, 5.0f, x, 1, 0 );
207
+
// returns 30.0
208
+
```
209
+
210
+
The function accepts the following arguments:
211
+
212
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
0 commit comments