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
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/README.md
+135-4
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,7 @@ The function has the following additional parameters:
115
115
-**offsetX**: starting index for `x`.
116
116
-**offsetY**: starting index for `y`.
117
117
118
-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in the strided input array starting from the second value and to store in the last `N` elements of the strided output array starting from the last element
118
+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offsetX and offsetY parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in the strided input array starting from the second value and to store in the last `N` elements of the strided output array starting from the last element
var dcusumkbn =require( '@stdlib/blas/ext/base/dcusumkbn' );
155
154
156
-
var x =filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) );
155
+
var x =discreteUniform( 10, -100, 100, {
156
+
'dtype':'float64'
157
+
});
157
158
var y =newFloat64Array( x.length );
158
159
159
160
console.log( x );
@@ -167,8 +168,138 @@ console.log( y );
167
168
168
169
<!-- /.examples -->
169
170
171
+
<!-- C interface documentation. -->
172
+
170
173
* * *
171
174
175
+
<sectionclass="c">
176
+
177
+
## C APIs
178
+
179
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
180
+
181
+
<sectionclass="intro">
182
+
183
+
</section>
184
+
185
+
<!-- /.intro -->
186
+
187
+
<!-- C usage documentation. -->
188
+
189
+
<sectionclass="usage">
190
+
191
+
### Usage
192
+
193
+
```c
194
+
#include"stdlib/blas/ext/base/dcusumkbn.h"
195
+
```
196
+
197
+
#### stdlib_strided_dcusumkbn( N, sum, \*X, strideX, \*Y, strideY )
198
+
199
+
Computes the cumulative sum of double-precision floating-point strided array elements using an improved Kahan–Babuška algorithm.
200
+
201
+
```c
202
+
constdouble x[] = { 1.0, 2.0, 3.0, 4.0 }
203
+
double y[] = { 0.0, 0.0, 0.0, 0.0 }
204
+
205
+
stdlib_strided_dcusumkbn( 4, 0.0, x, 1, y, 1 );
206
+
```
207
+
208
+
The function accepts the following arguments:
209
+
210
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
211
+
- **sum**: `[in] CBLAS_INT` initial sum.
212
+
- **X**: `[in] double*` input array.
213
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
214
+
- **Y**: `[out] double*` output array.
215
+
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
Computes the cumulative sum of double-precision floating-point strided array elements using an improved Kahan–Babuška algorithm and alternative indexing semantics.
228
+
229
+
```c
230
+
constdouble x[] = { 1.0, 2.0, 3.0, 4.0 }
231
+
double y[] = { 0.0, 0.0, 0.0, 0.0 }
232
+
233
+
stdlib_strided_dcusumkbn_ndarray( 4, 0.0, x, 1, 0, y, 1, 0 );
234
+
```
235
+
236
+
The function accepts the following arguments:
237
+
238
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
239
+
- **sum**: `[in] CBLAS_INT` initial sum.
240
+
- **X**: `[in] double*` input array.
241
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
242
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
243
+
- **Y**: `[out] double*` output array.
244
+
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
245
+
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
0 commit comments