Skip to content

Commit d9c08b0

Browse files
authored
docs: update blas/ext/base/dcusumkbn2 to follow current project conventions
PR-URL: #5168 Reviewed-by: Philipp Burckhardt <[email protected]>
1 parent 8357863 commit d9c08b0

File tree

9 files changed

+44
-55
lines changed

9 files changed

+44
-55
lines changed

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/README.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,19 @@ The function has the following parameters:
6161
- **N**: number of indexed elements.
6262
- **sum**: initial sum.
6363
- **x**: input [`Float64Array`][@stdlib/array/float64].
64-
- **strideX**: index increment for `x`.
64+
- **strideX**: stride length for `x`.
6565
- **y**: output [`Float64Array`][@stdlib/array/float64].
66-
- **strideY**: index increment for `y`.
66+
- **strideY**: stride length for `y`.
6767

68-
The `N` and stride parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`,
68+
The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element:
6969

7070
```javascript
7171
var Float64Array = require( '@stdlib/array/float64' );
7272

7373
var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] );
7474
var y = new Float64Array( x.length );
7575

76-
var N = 4;
77-
78-
var v = dcusumkbn2( N, 0.0, x, 2, y, 1 );
76+
var v = dcusumkbn2( 4, 0.0, x, 2, y, 1 );
7977
// y => <Float64Array>[ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]
8078
```
8179

@@ -94,9 +92,7 @@ var y0 = new Float64Array( x0.length );
9492
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
9593
var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element
9694

97-
var N = 4;
98-
99-
dcusumkbn2( N, 0.0, x1, -2, y1, 1 );
95+
dcusumkbn2( 4, 0.0, x1, -2, y1, 1 );
10096
// y0 => <Float64Array>[ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ]
10197
```
10298

@@ -119,17 +115,15 @@ The function has the following additional parameters:
119115
- **offsetX**: starting index for `x`.
120116
- **offsetY**: starting index for `y`.
121117

122-
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 `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element
118+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element:
123119

124120
```javascript
125121
var Float64Array = require( '@stdlib/array/float64' );
126122

127123
var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
128124
var y = new Float64Array( x.length );
129125

130-
var N = 4;
131-
132-
dcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 );
126+
dcusumkbn2.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 );
133127
// y => <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ]
134128
```
135129

@@ -216,9 +210,9 @@ The function accepts the following arguments:
216210
- **N**: `[in] CBLAS_INT` number of indexed elements.
217211
- **sum**: `[in] double` initial sum.
218212
- **X**: `[in] double*` input array.
219-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
213+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
220214
- **Y**: `[out] double*` output array.
221-
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
215+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
222216
223217
```c
224218
void stdlib_strided_dcusumkbn2( const CBLAS_INT N, const double sum, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
@@ -244,10 +238,10 @@ The function accepts the following arguments:
244238
- **N**: `[in] CBLAS_INT` number of indexed elements.
245239
- **sum**: `[in] double` initial sum.
246240
- **X**: `[in] double*` input array.
247-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
241+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
248242
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
249243
- **Y**: `[out] double*` output array.
250-
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
244+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
251245
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
252246
253247
```c

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/docs/repl.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Computes the cumulative sum of double-precision floating-point strided
44
array elements using a second-order iterative Kahan–Babuška algorithm.
55

6-
The `N` and stride parameters determine which elements in the strided
7-
arrays are accessed at runtime.
6+
The `N` and stride parameters determine which elements in the strided arrays
7+
are accessed at runtime.
88

99
Indexing is relative to the first index. To introduce an offset, use a typed
1010
array view.
@@ -23,13 +23,13 @@
2323
Input array.
2424

2525
strideX: integer
26-
Index increment for `x`.
26+
Stride length for `x`.
2727

2828
y: Float64Array
2929
Output array.
3030

3131
strideY: integer
32-
Index increment for `y`.
32+
Stride length for `y`.
3333

3434
Returns
3535
-------
@@ -67,8 +67,8 @@
6767
alternative indexing semantics.
6868

6969
While typed array views mandate a view offset based on the underlying
70-
buffer, the offset parameters support indexing semantics based on a
71-
starting index.
70+
buffer, the offset parameters support indexing semantics based on starting
71+
indices.
7272

7373
Parameters
7474
----------
@@ -82,7 +82,7 @@
8282
Input array.
8383

8484
strideX: integer
85-
Index increment for `x`.
85+
Stride length for `x`.
8686

8787
offsetX: integer
8888
Starting index for `x`.
@@ -91,7 +91,7 @@
9191
Output array.
9292

9393
strideY: integer
94-
Index increment for `y`.
94+
Stride length for `y`.
9595

9696
offsetY: integer
9797
Starting index for `y`.

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ interface Routine {
2828
* @param N - number of indexed elements
2929
* @param sum - initial sum
3030
* @param x - input array
31-
* @param strideX - `x` stride length
31+
* @param strideX - stride length for `x`
3232
* @param y - output array
33-
* @param strideY - `y` stride length
33+
* @param strideY - stride length for `y`
3434
* @returns output array
3535
*
3636
* @example
@@ -50,10 +50,10 @@ interface Routine {
5050
* @param N - number of indexed elements
5151
* @param sum - initial sum
5252
* @param x - input array
53-
* @param strideX - `x` stride length
53+
* @param strideX - stride length for `x`
5454
* @param offsetX - starting index for `x`
5555
* @param y - output array
56-
* @param strideY - `y` stride length
56+
* @param strideY - stride length for `y`
5757
* @param offsetY - starting index for `y`
5858
* @returns output array
5959
*
@@ -75,9 +75,9 @@ interface Routine {
7575
* @param N - number of indexed elements
7676
* @param sum - initial sum
7777
* @param x - input array
78-
* @param strideX - `x` stride length
78+
* @param strideX - stride length for `x`
7979
* @param y - output array
80-
* @param strideY - `y` stride length
80+
* @param strideY - stride length for `y`
8181
* @returns output array
8282
*
8383
* @example

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/lib/dcusumkbn2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ var ndarray = require( './ndarray.js' );
4040
* @param {PositiveInteger} N - number of indexed elements
4141
* @param {number} sum - initial sum
4242
* @param {Float64Array} x - input array
43-
* @param {integer} strideX - `x` stride length
43+
* @param {integer} strideX - stride length for `x`
4444
* @param {Float64Array} y - output array
45-
* @param {integer} strideY - `y` stride length
45+
* @param {integer} strideY - stride length for `y`
4646
* @returns {Float64Array} output array
4747
*
4848
* @example

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/lib/dcusumkbn2.native.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,18 @@ var addon = require( './../src/addon.node' );
3131
* @param {PositiveInteger} N - number of indexed elements
3232
* @param {number} sum - initial sum
3333
* @param {Float64Array} x - input array
34-
* @param {integer} strideX - `x` stride length
34+
* @param {integer} strideX - stride length for `x`
3535
* @param {Float64Array} y - output array
36-
* @param {integer} strideY - `y` stride length
36+
* @param {integer} strideY - stride length for `y`
3737
* @returns {Float64Array} output array
3838
*
3939
* @example
4040
* var Float64Array = require( '@stdlib/array/float64' );
4141
*
4242
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
4343
* var y = new Float64Array( x.length );
44-
* var N = x.length;
4544
*
46-
* var v = dcusumkbn2( N, 0.0, x, 1, y, 1 );
45+
* var v = dcusumkbn2( x.length, 0.0, x, 1, y, 1 );
4746
* // returns <Float64Array>[ 1.0, -1.0, 1.0 ]
4847
*/
4948
function dcusumkbn2( N, sum, x, strideX, y, strideY ) {

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/lib/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
*
3030
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
3131
* var y = new Float64Array( x.length );
32-
* var N = x.length;
3332
*
34-
* dcusumkbn2( N, 0.0, x, 1, y, 1 );
33+
* dcusumkbn2( x.length, 0.0, x, 1, y, 1 );
3534
* // y => <Float64Array>[ 1.0, -1.0, 1.0 ]
3635
*
3736
* @example
@@ -40,9 +39,8 @@
4039
*
4140
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
4241
* var y = new Float64Array( x.length );
43-
* var N = 4;
4442
*
45-
* dcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );
43+
* dcusumkbn2.ndarray( 4, 0.0, x, 2, 1, y, 1, 0 );
4644
* // y => <Float64Array>[ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]
4745
*/
4846

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/lib/ndarray.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ var abs = require( '@stdlib/math/base/special/abs' );
3939
* @param {PositiveInteger} N - number of indexed elements
4040
* @param {number} sum - initial sum
4141
* @param {Float64Array} x - input array
42-
* @param {integer} strideX - `x` stride length
42+
* @param {integer} strideX - stride length for `x`
4343
* @param {NonNegativeInteger} offsetX - starting index for `x`
4444
* @param {Float64Array} y - output array
45-
* @param {integer} strideY - `y` stride length
45+
* @param {integer} strideY - stride length for `y`
4646
* @param {NonNegativeInteger} offsetY - starting index for `y`
4747
* @returns {Float64Array} output array
4848
*
@@ -51,9 +51,8 @@ var abs = require( '@stdlib/math/base/special/abs' );
5151
*
5252
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
5353
* var y = new Float64Array( x.length );
54-
* var N = 4;
5554
*
56-
* var v = dcusumkbn2( N, 0.0, x, 2, 1, y, 1, 0 );
55+
* var v = dcusumkbn2( 4, 0.0, x, 2, 1, y, 1, 0 );
5756
* // returns <Float64Array>[ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]
5857
*/
5958
function dcusumkbn2( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/lib/ndarray.native.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,19 @@ var addon = require( './../src/addon.node' );
3131
* @param {PositiveInteger} N - number of indexed elements
3232
* @param {number} sum - initial sum
3333
* @param {Float64Array} x - input array
34-
* @param {integer} strideX - `x` stride length
34+
* @param {integer} strideX - stride length for `x`
3535
* @param {NonNegativeInteger} offsetX - starting index for `x`
3636
* @param {Float64Array} y - output array
37-
* @param {integer} strideY - `y` stride length
37+
* @param {integer} strideY - stride length for `y`
3838
* @param {NonNegativeInteger} offsetY - starting index for `y`
3939
* @returns {Float64Array} output array
4040
*
4141
* @example
4242
* var Float64Array = require( '@stdlib/array/float64' );
4343
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
4444
* var y = new Float64Array( x.length );
45-
* var N = 4;
4645
*
47-
* var v = dcusumkbn2( N, 0.0, x, 2, 1, y, 1, 0 );
46+
* var v = dcusumkbn2( 4, 0.0, x, 2, 1, y, 1, 0 );
4847
* // returns <Float64Array>[ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]
4948
*/
5049
function dcusumkbn2( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {

lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/src/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
* @param N number of indexed elements
3636
* @param sum initial sum
3737
* @param X input array
38-
* @param strideX X stride length
38+
* @param strideX stride length for X
3939
* @param Y output array
40-
* @param strideY Y stride length
40+
* @param strideY stride length for Y
4141
*/
4242
void API_SUFFIX(stdlib_strided_dcusumkbn2)( const CBLAS_INT N, const double sum, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY ) {
4343
const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
@@ -59,11 +59,11 @@ void API_SUFFIX(stdlib_strided_dcusumkbn2)( const CBLAS_INT N, const double sum,
5959
* @param N number of indexed elements
6060
* @param sum initial sum
6161
* @param X input array
62-
* @param strideX X index increment
63-
* @param offsetX X starting index
62+
* @param strideX stride length for X
63+
* @param offsetX starting index for X
6464
* @param Y output array
65-
* @param strideY Y index increment
66-
* @param offsetY Y starting index
65+
* @param strideY stride length for Y
66+
* @param offsetY stating index for Y
6767
*/
6868
void API_SUFFIX(stdlib_strided_dcusumkbn2_ndarray)( const CBLAS_INT N, const double sum, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) {
6969
double ccs;

0 commit comments

Comments
 (0)