@@ -30,35 +30,35 @@ limitations under the License.
30
30
var zdscal = require ( ' @stdlib/blas/base/zdscal' );
31
31
```
32
32
33
- #### zdscal( N, da, zx, strideZX )
33
+ #### zdscal( N, alpha, x, strideX )
34
34
35
35
Scales a double-precision complex floating-point vector by a double-precision floating-point constant.
36
36
37
37
``` javascript
38
38
var Complex128Array = require ( ' @stdlib/array/complex128' );
39
39
40
- var zx = new Complex128Array ( [ 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ] );
40
+ var x = new Complex128Array ( [ 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ] );
41
41
42
- zdscal ( 3 , 2.0 , zx , 1 );
43
- // zx => <Complex128Array>[ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ]
42
+ zdscal ( 3 , 2.0 , x , 1 );
43
+ // x => <Complex128Array>[ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ]
44
44
```
45
45
46
46
The function has the following parameters:
47
47
48
48
- ** N** : number of indexed elements.
49
- - ** da ** : scalar constant.
50
- - ** zx ** : input [ ` Complex128Array ` ] [ @stdlib/array/complex128 ] .
51
- - ** strideZX ** : stride length for ` zx ` .
49
+ - ** alpha ** : scalar constant.
50
+ - ** x ** : input [ ` Complex128Array ` ] [ @stdlib/array/complex128 ] .
51
+ - ** strideX ** : stride length for ` x ` .
52
52
53
- The ` N ` and stride parameters determine which elements in ` zx ` are scaled by ` da ` . For example, to scale every other element in ` zx ` by ` da ` ,
53
+ The ` N ` and stride parameters determine which elements in ` x ` are scaled by ` alpha ` . For example, to scale every other element in ` x ` by ` alpha ` ,
54
54
55
55
``` javascript
56
56
var Complex128Array = require ( ' @stdlib/array/complex128' );
57
57
58
- var zx = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
58
+ var x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
59
59
60
- zdscal ( 2 , 2.0 , zx , 2 );
61
- // zx => <Complex128Array>[ 2.0, 4.0, 3.0, 4.0, 10.0, 12.0, 7.0, 8.0 ]
60
+ zdscal ( 2 , 2.0 , x , 2 );
61
+ // x => <Complex128Array>[ 2.0, 4.0, 3.0, 4.0, 10.0, 12.0, 7.0, 8.0 ]
62
62
```
63
63
64
64
Note that indexing is relative to the first index. To introduce an offset, use [ ` typed array ` ] [ mdn-typed-array ] views.
@@ -69,42 +69,42 @@ Note that indexing is relative to the first index. To introduce an offset, use [
69
69
var Complex128Array = require ( ' @stdlib/array/complex128' );
70
70
71
71
// Initial array:
72
- var zx0 = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
72
+ var x0 = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
73
73
74
74
// Create an offset view:
75
- var zx1 = new Complex128Array ( zx0 .buffer , zx0 .BYTES_PER_ELEMENT * 1 ); // start at 2nd element
75
+ var x1 = new Complex128Array ( x0 .buffer , x0 .BYTES_PER_ELEMENT * 1 ); // start at 2nd element
76
76
77
- // Scale every element in `zx1 `:
78
- zdscal ( 3 , 2.0 , zx1 , 1 );
79
- // zx0 => <Complex128Array>[ 1.0, 2.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0 ]
77
+ // Scale every element in `x1 `:
78
+ zdscal ( 3 , 2.0 , x1 , 1 );
79
+ // x0 => <Complex128Array>[ 1.0, 2.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0 ]
80
80
```
81
81
82
- #### zdscal.ndarray( N, da, zx, strideZX, offsetZX )
82
+ #### zdscal.ndarray( N, alpha, x, strideX, offsetX )
83
83
84
84
Scales a double-precision complex floating-point vector by a double-precision floating-point constant using alternative indexing semantics.
85
85
86
86
``` javascript
87
87
var Complex128Array = require ( ' @stdlib/array/complex128' );
88
88
89
- var zx = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ] );
89
+ var x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ] );
90
90
91
- zdscal .ndarray ( 3 , 2.0 , zx , 1 , 0 );
92
- // zx => <Complex128Array>[ 2.0, 4.0, 6.0, 8.0, 10.0, 12.0 ]
91
+ zdscal .ndarray ( 3 , 2.0 , x , 1 , 0 );
92
+ // x => <Complex128Array>[ 2.0, 4.0, 6.0, 8.0, 10.0, 12.0 ]
93
93
```
94
94
95
95
The function has the following additional parameters:
96
96
97
- - ** offsetZX ** : starting index for ` zx ` .
97
+ - ** offsetX ** : starting index for ` x ` .
98
98
99
99
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 scale every other element in the input strided array starting from the second element,
100
100
101
101
``` javascript
102
102
var Complex128Array = require ( ' @stdlib/array/complex128' );
103
103
104
- var zx = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
104
+ var x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
105
105
106
- zdscal .ndarray ( 2 , 2.0 , zx , 2 , 1 );
107
- // zx => <Complex128Array>[ 1.0, 2.0, 6.0, 8.0, 5.0, 6.0, 14.0, 16.0 ]
106
+ zdscal .ndarray ( 2 , 2.0 , x , 2 , 1 );
107
+ // x => <Complex128Array>[ 1.0, 2.0, 6.0, 8.0, 5.0, 6.0, 14.0, 16.0 ]
108
108
```
109
109
110
110
</section >
@@ -115,7 +115,7 @@ zdscal.ndarray( 2, 2.0, zx, 2, 1 );
115
115
116
116
## Notes
117
117
118
- - If ` N <= 0 ` , both functions return ` zx ` unchanged.
118
+ - If ` N <= 0 ` , both functions return ` x ` unchanged.
119
119
- ` zdscal() ` corresponds to the [ BLAS] [ blas ] level 1 function [ ` zdscal ` ] [ zdscal ] .
120
120
121
121
</section >
@@ -138,11 +138,11 @@ function rand() {
138
138
return new Complex128 ( discreteUniform ( 0 , 10 ), discreteUniform ( - 5 , 5 ) );
139
139
}
140
140
141
- var zx = filledarrayBy ( 10 , ' complex128' , rand );
142
- console .log ( zx .toString () );
141
+ var x = filledarrayBy ( 10 , ' complex128' , rand );
142
+ console .log ( x .toString () );
143
143
144
- zdscal ( zx .length , 2.0 , zx , 1 );
145
- console .log ( zx .toString () );
144
+ zdscal ( x .length , 2.0 , x , 1 );
145
+ console .log ( x .toString () );
146
146
```
147
147
148
148
</section >
0 commit comments