Skip to content

Commit 942294c

Browse files
authored
docs: change variable naming in blas/base/zaxpy
PR-URL: #6815 Reviewed-by: Athan Reines <[email protected]>
1 parent 294bab1 commit 942294c

File tree

12 files changed

+576
-576
lines changed

12 files changed

+576
-576
lines changed

lib/node_modules/@stdlib/blas/base/zaxpy/README.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,43 @@ limitations under the License.
3030
var zaxpy = require( '@stdlib/blas/base/zaxpy' );
3131
```
3232

33-
#### zaxpy( N, za, zx, strideX, zy, strideY )
33+
#### zaxpy( N, alpha, x, strideX, y, strideY )
3434

35-
Scales values from `zx` by `za` and adds the result to `zy`.
35+
Scales values from `x` by `alpha` and adds the result to `y`.
3636

3737
```javascript
3838
var Complex128Array = require( '@stdlib/array/complex128' );
3939
var Complex128 = require( '@stdlib/complex/float64/ctor' );
4040

41-
var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
42-
var zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
43-
var za = new Complex128( 2.0, 2.0 );
41+
var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
42+
var y = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
43+
var alpha = new Complex128( 2.0, 2.0 );
4444

45-
zaxpy( 3, za, zx, 1, zy, 1 );
46-
// zy => <Complex128Array>[ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ]
45+
zaxpy( 3, alpha, x, 1, y, 1 );
46+
// y => <Complex128Array>[ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ]
4747
```
4848

4949
The function has the following parameters:
5050

5151
- **N**: number of indexed elements.
52-
- **za**: scalar [`Complex128`][@stdlib/complex/float64/ctor] constant.
53-
- **zx**: first input [`Complex128Array`][@stdlib/array/complex128].
54-
- **strideX**: index increment for `zx`.
55-
- **zy**: second input [`Complex128Array`][@stdlib/array/complex128].
56-
- **strideY**: index increment for `zy`.
52+
- **alpha**: scalar [`Complex128`][@stdlib/complex/float64/ctor] constant.
53+
- **x**: first input [`Complex128Array`][@stdlib/array/complex128].
54+
- **strideX**: index increment for `x`.
55+
- **y**: second input [`Complex128Array`][@stdlib/array/complex128].
56+
- **strideY**: index increment for `y`.
5757

58-
The `N` and stride parameters determine how values from `zx` are scaled by `za` and added to `zy`. For example, to scale every other value in `zx` by `za` and add the result to every other value of `zy`,
58+
The `N` and stride parameters determine how values from `x` are scaled by `alpha` and added to `y`. For example, to scale every other value in `x` by `alpha` and add the result to every other value of `y`,
5959

6060
```javascript
6161
var Complex128Array = require( '@stdlib/array/complex128' );
6262
var Complex128 = require( '@stdlib/complex/float64/ctor' );
6363

64-
var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
65-
var zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
66-
var za = new Complex128( 2.0, 2.0 );
64+
var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
65+
var y = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
66+
var alpha = new Complex128( 2.0, 2.0 );
6767

68-
zaxpy( 2, za, zx, 2, zy, 2 );
69-
// zy => <Complex128Array>[ -1.0, 7.0, 1.0, 1.0, -1.0, 23.0, 1.0, 1.0 ]
68+
zaxpy( 2, alpha, x, 2, y, 2 );
69+
// y => <Complex128Array>[ -1.0, 7.0, 1.0, 1.0, -1.0, 23.0, 1.0, 1.0 ]
7070
```
7171

7272
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
@@ -78,54 +78,54 @@ var Complex128Array = require( '@stdlib/array/complex128' );
7878
var Complex128 = require( '@stdlib/complex/float64/ctor' );
7979

8080
// Initial arrays...
81-
var zx0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
82-
var zy0 = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
81+
var x0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
82+
var y0 = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
8383

8484
// Define a scalar constant:
85-
var za = new Complex128( 2.0, 2.0 );
85+
var alpha = new Complex128( 2.0, 2.0 );
8686

8787
// Create offset views...
88-
var zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
89-
var zy1 = new Complex128Array( zy0.buffer, zy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element
88+
var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
89+
var y1 = new Complex128Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element
9090

91-
// Scales values of `zx0` by `za` starting from second index and add the result to `zy0` starting from third index...
92-
zaxpy( 2, za, zx1, 1, zy1, 1 );
93-
// zy0 => <Complex128Array>[ 1.0, 1.0, 1.0, 1.0, -1.0, 15.0, -1.0, 23.0 ]
91+
// Scales values of `x0` by `alpha` starting from second index and add the result to `y0` starting from third index...
92+
zaxpy( 2, alpha, x1, 1, y1, 1 );
93+
// y0 => <Complex128Array>[ 1.0, 1.0, 1.0, 1.0, -1.0, 15.0, -1.0, 23.0 ]
9494
```
9595

96-
#### zaxpy.ndarray( N, za, zx, strideX, offsetX, zy, strideY, offsetY )
96+
#### zaxpy.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY )
9797

98-
Scales values from `zx` by `za` and adds the result to `zy` using alternative indexing semantics.
98+
Scales values from `x` by `alpha` and adds the result to `y` using alternative indexing semantics.
9999

100100
```javascript
101101
var Complex128Array = require( '@stdlib/array/complex128' );
102102
var Complex128 = require( '@stdlib/complex/float64/ctor' );
103103

104-
var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
105-
var zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
106-
var za = new Complex128( 2.0, 2.0 );
104+
var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
105+
var y = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
106+
var alpha = new Complex128( 2.0, 2.0 );
107107

108-
zaxpy.ndarray( 3, za, zx, 1, 0, zy, 1, 0 );
109-
// zy => <Complex128Array>[ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ]
108+
zaxpy.ndarray( 3, alpha, x, 1, 0, y, 1, 0 );
109+
// y => <Complex128Array>[ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ]
110110
```
111111

112112
The function has the following additional parameters:
113113

114-
- **offsetX**: starting index for `zx`.
115-
- **offsetY**: starting index for `zy`.
114+
- **offsetX**: starting index for `x`.
115+
- **offsetY**: starting index for `y`.
116116

117117
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 scale values in the first input strided array starting from the second element and add the result to the second input array starting from the second element,
118118

119119
```javascript
120120
var Complex128Array = require( '@stdlib/array/complex128' );
121121
var Complex128 = require( '@stdlib/complex/float64/ctor' );
122122

123-
var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
124-
var zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
125-
var za = new Complex128( 2.0, 2.0 );
123+
var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
124+
var y = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
125+
var alpha = new Complex128( 2.0, 2.0 );
126126

127-
zaxpy.ndarray( 3, za, zx, 1, 1, zy, 1, 1 );
128-
// zy => <Complex128Array>[ 1.0, 1.0, -1.0, 15.0, -1.0, 23.0, -1.0, 31.0 ]
127+
zaxpy.ndarray( 3, alpha, x, 1, 1, y, 1, 1 );
128+
// y => <Complex128Array>[ 1.0, 1.0, -1.0, 15.0, -1.0, 23.0, -1.0, 31.0 ]
129129
```
130130

131131
</section>
@@ -136,7 +136,7 @@ zaxpy.ndarray( 3, za, zx, 1, 1, zy, 1, 1 );
136136

137137
## Notes
138138

139-
- If `N <= 0`, both functions return `zy` unchanged.
139+
- If `N <= 0`, both functions return `y` unchanged.
140140
- `zaxpy()` corresponds to the [BLAS][blas] level 1 function [`zaxpy`][zaxpy].
141141

142142
</section>
@@ -162,17 +162,17 @@ function rand() {
162162
return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) );
163163
}
164164

165-
var zx = filledarrayBy( 10, 'complex128', rand );
166-
var zy = filledarrayBy( 10, 'complex128', rand );
167-
var zyc = zcopy( zy.length, zy, 1, zeros( zy.length, 'complex128' ), 1 );
165+
var x = filledarrayBy( 10, 'complex128', rand );
166+
var y = filledarrayBy( 10, 'complex128', rand );
167+
var yc = zcopy( y.length, y, 1, zeros( y.length, 'complex128' ), 1 );
168168

169-
var za = new Complex128( 2.0, 2.0 );
169+
var alpha = new Complex128( 2.0, 2.0 );
170170

171-
// Scale values from `zx` by `za` and add the result to `zy`:
172-
zaxpy( zx.length, za, zx, 1, zy, 1 );
171+
// Scale values from `x` by `alpha` and add the result to `y`:
172+
zaxpy( x.length, alpha, x, 1, y, 1 );
173173

174174
// Print the results:
175-
logEach( '(%s)*(%s) + (%s) = %s', za, zx, zyc, zy );
175+
logEach( '(%s)*(%s) + (%s) = %s', alpha, x, yc, y );
176176
```
177177

178178
</section>

lib/node_modules/@stdlib/blas/base/zaxpy/benchmark/benchmark.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ var options = {
4949
*/
5050
function createBenchmark( len ) {
5151
var viewY;
52-
var za;
53-
var zx;
54-
var zy;
52+
var alpha;
53+
var x;
54+
var y;
5555

56-
zx = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) );
57-
zy = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) );
56+
x = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) );
57+
y = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) );
5858

59-
viewY = reinterpret( zy, 0 );
59+
viewY = reinterpret( y, 0 );
6060

61-
za = new Complex128( 1.0, 0.0 );
61+
alpha = new Complex128( 1.0, 0.0 );
6262

6363
return benchmark;
6464

@@ -73,7 +73,7 @@ function createBenchmark( len ) {
7373

7474
b.tic();
7575
for ( i = 0; i < b.iterations; i++ ) {
76-
zaxpy( zx.length, za, zx, 1, zy, 1 );
76+
zaxpy( x.length, alpha, x, 1, y, 1 );
7777
if ( isnan( viewY[ i%(len*2) ] ) ) {
7878
b.fail( 'should not return NaN' );
7979
}

lib/node_modules/@stdlib/blas/base/zaxpy/benchmark/benchmark.ndarray.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ var options = {
4949
*/
5050
function createBenchmark( len ) {
5151
var viewY;
52-
var za;
53-
var zx;
54-
var zy;
52+
var alpha;
53+
var x;
54+
var y;
5555

56-
zx = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) );
57-
zy = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) );
56+
x = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) );
57+
y = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) );
5858

59-
viewY = reinterpret( zy, 0 );
59+
viewY = reinterpret( y, 0 );
6060

61-
za = new Complex128( 1.0, 0.0 );
61+
alpha = new Complex128( 1.0, 0.0 );
6262

6363
return benchmark;
6464

@@ -73,7 +73,7 @@ function createBenchmark( len ) {
7373

7474
b.tic();
7575
for ( i = 0; i < b.iterations; i++ ) {
76-
zaxpy( zx.length, za, zx, 1, 0, zy, 1, 0 );
76+
zaxpy( x.length, alpha, x, 1, 0, y, 1, 0 );
7777
if ( isnan( viewY[ i%(len*2) ] ) ) {
7878
b.fail( 'should not return NaN' );
7979
}

lib/node_modules/@stdlib/blas/base/zaxpy/docs/repl.txt

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
11

2-
{{alias}}( N, za, zx, strideX, zy, strideY )
2+
{{alias}}( N, alpha, x, strideX, y, strideY )
33
Scales a double-precision complex floating-point vector by a double-
44
precision complex floating point constant and adds the result to a double-
55
precision complex floating-point vector.
66

7-
The `N` and stride parameters determine how values from `zx` are scaled by
8-
`za` and added to `zy`.
7+
The `N` and stride parameters determine how values from `x` are scaled by
8+
`alpha` and added to `y`.
99

1010
Indexing is relative to the first index. To introduce an offset, use typed
1111
array views.
1212

13-
If `N` is less than or equal to `0`, the function returns `zy` unchanged.
13+
If `N` is less than or equal to `0`, the function returns `y` unchanged.
1414

1515
Parameters
1616
----------
1717
N: integer
1818
Number of indexed elements.
1919

20-
za: Complex128
20+
alpha: Complex128
2121
Scalar constant.
2222

23-
zx: Complex128Array
23+
x: Complex128Array
2424
First input array.
2525

2626
strideX: integer
27-
Index increment for `zx`.
27+
Index increment for `x`.
2828

29-
zy: Complex128Array
29+
y: Complex128Array
3030
Second input array.
3131

3232
strideY: integer
33-
Index increment for `zy`.
33+
Index increment for `y`.
3434

3535
Returns
3636
-------
37-
zy: Complex128Array
37+
y: Complex128Array
3838
Second input array.
3939

4040
Examples
4141
--------
4242
// Standard usage:
43-
> var zx = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] );
44-
> var zy = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0 ] );
45-
> var za = new {{alias:@stdlib/complex/float64/ctor}}( 2.0, 2.0 );
46-
> {{alias}}( 2, za, zx, 1, zy, 1 )
43+
> var x = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] );
44+
> var y = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0 ] );
45+
> var alpha = new {{alias:@stdlib/complex/float64/ctor}}( 2.0, 2.0 );
46+
> {{alias}}( 2, alpha, x, 1, y, 1 )
4747
<Complex128Array>[ -1.0, 7.0, -1.0, 15.0 ]
4848

4949
// Advanced indexing:
50-
> zx = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
51-
> zy = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
52-
> {{alias}}( 2, za, zx, -2, zy, 1 )
50+
> x = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
51+
> y = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
52+
> {{alias}}( 2, alpha, x, -2, y, 1 )
5353
<Complex128Array>[ -1.0, 23.0, -1.0, 7.0, 1.0, 1.0 ]
5454

5555
// Using typed array views:
56-
> var zx0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] );
57-
> var zy0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0 ] );
58-
> var zx1 = new {{alias:@stdlib/array/complex128}}( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 );
59-
> var zy1 = new {{alias:@stdlib/array/complex128}}( zy0.buffer, zy0.BYTES_PER_ELEMENT*1 );
60-
> {{alias}}( 1, za, zx1, 1, zy1, 1 )
56+
> var x0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] );
57+
> var y0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0 ] );
58+
> var x1 = new {{alias:@stdlib/array/complex128}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
59+
> var y1 = new {{alias:@stdlib/array/complex128}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 );
60+
> {{alias}}( 1, alpha, x1, 1, y1, 1 )
6161
<Complex128Array>[ -1.0, 15.0 ]
62-
> zy0
62+
> y0
6363
<Complex128Array>[ 1.0, 1.0, -1.0, 15.0 ]
6464

6565

66-
{{alias}}.ndarray( N, za, zx, strideX, offsetX, zy, strideY, offsetY )
66+
{{alias}}.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY )
6767
Scales a double-precision complex floating-point vector by a double-
6868
precision complex floating-point constant and adds the result to a double-
6969
precision complex floating-point vector using alternative indexing
@@ -78,45 +78,45 @@
7878
N: integer
7979
Number of indexed elements.
8080

81-
za: Complex128
81+
alpha: Complex128
8282
Scalar constant.
8383

84-
zx: Complex128Array
84+
x: Complex128Array
8585
First input array.
8686

8787
strideX: integer
88-
Index increment for `zx`.
88+
Index increment for `x`.
8989

9090
offsetX: integer
91-
Starting index for `zx`.
91+
Starting index for `x`.
9292

93-
zy: Complex128Array
93+
y: Complex128Array
9494
Second input array.
9595

9696
strideY: integer
97-
Index increment for `zy`.
97+
Index increment for `y`.
9898

9999
offsetY: integer
100-
Starting index for `zy`.
100+
Starting index for `y`.
101101

102102
Returns
103103
-------
104-
zy: Complex128Array
104+
y: Complex128Array
105105
Second input array.
106106

107107
Examples
108108
--------
109109
// Standard usage:
110-
> var zx = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] );
111-
> var zy = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0 ] );
112-
> var za = new {{alias:@stdlib/complex/float64/ctor}}( 2.0, 2.0 );
113-
> {{alias}}.ndarray( zx.length, za, zx, 1, 0, zy, 1, 0 )
110+
> var x = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] );
111+
> var y = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0 ] );
112+
> var alpha = new {{alias:@stdlib/complex/float64/ctor}}( 2.0, 2.0 );
113+
> {{alias}}.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 )
114114
<Complex128Array>[ -1.0, 7.0, -1.0, 15.0 ]
115115

116116
// Advanced indexing:
117-
> zx = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
118-
> zy = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
119-
> {{alias}}.ndarray( 2, za, zx, 1, 1, zy, 1, 1 )
117+
> x = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
118+
> y = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
119+
> {{alias}}.ndarray( 2, alpha, x, 1, 1, y, 1, 1 )
120120
<Complex128Array>[ 1.0, 1.0, -1.0, 15.0, -1.0, 23.0 ]
121121

122122
See Also

0 commit comments

Comments
 (0)