@@ -30,22 +30,22 @@ limitations under the License.
3030var zscal = require ( ' @stdlib/blas/base/zscal' );
3131```
3232
33- #### zscal( N, za, zx , strideX )
33+ #### zscal( N, alpha, x , strideX )
3434
35- Scales values from ` zx ` by ` za ` .
35+ Scales values from ` x ` by ` alpha ` .
3636
3737``` javascript
3838var Complex128Array = require ( ' @stdlib/array/complex128' );
3939var Complex128 = require ( ' @stdlib/complex/float64/ctor' );
4040var real = require ( ' @stdlib/complex/float64/real' );
4141var imag = require ( ' @stdlib/complex/float64/imag' );
4242
43- var zx = new Complex128Array ( [ 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ] );
44- var za = new Complex128 ( 2.0 , 0.0 );
43+ var x = new Complex128Array ( [ 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ] );
44+ var alpha = new Complex128 ( 2.0 , 0.0 );
4545
46- zscal ( 3 , za, zx , 1 );
46+ zscal ( 3 , alpha, x , 1 );
4747
48- var z = zx .get ( 0 );
48+ var z = x .get ( 0 );
4949// returns <Complex128>
5050
5151var re = real ( z );
@@ -58,24 +58,24 @@ var im = imag( z );
5858The function has the following parameters:
5959
6060- ** N** : number of indexed elements.
61- - ** za ** : scalar [ ` Complex128 ` ] [ @stdlib/complex/float64/ctor ] constant.
62- - ** zx ** : input [ ` Complex128Array ` ] [ @stdlib/array/complex128 ] .
63- - ** strideX** : index increment for ` zx ` .
61+ - ** alpha ** : scalar [ ` Complex128 ` ] [ @stdlib/complex/float64/ctor ] constant.
62+ - ** x ** : input [ ` Complex128Array ` ] [ @stdlib/array/complex128 ] .
63+ - ** strideX** : index increment for ` x ` .
6464
65- The ` N ` and stride parameters determine how values from ` zx ` are scaled by ` za ` . For example, to scale every other value in ` zx ` by ` za ` ,
65+ The ` N ` and stride parameters determine how values from ` x ` are scaled by ` alpha ` . For example, to scale every other value in ` x ` by ` alpha ` ,
6666
6767``` javascript
6868var Complex128Array = require ( ' @stdlib/array/complex128' );
6969var Complex128 = require ( ' @stdlib/complex/float64/ctor' );
7070var real = require ( ' @stdlib/complex/float64/real' );
7171var imag = require ( ' @stdlib/complex/float64/imag' );
7272
73- var zx = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
74- var za = new Complex128 ( 2.0 , 0.0 );
73+ var x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
74+ var alpha = new Complex128 ( 2.0 , 0.0 );
7575
76- zscal ( 2 , za, zx , 2 );
76+ zscal ( 2 , alpha, x , 2 );
7777
78- var z = zx .get ( 2 );
78+ var z = x .get ( 2 );
7979// returns <Complex128>
8080
8181var re = real ( z );
@@ -96,18 +96,18 @@ var real = require( '@stdlib/complex/float64/real' );
9696var imag = require ( ' @stdlib/complex/float64/imag' );
9797
9898// Initial array:
99- var zx0 = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
99+ var x0 = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
100100
101101// Define a scalar constant:
102- var za = new Complex128 ( 2.0 , 2.0 );
102+ var alpha = new Complex128 ( 2.0 , 2.0 );
103103
104104// Create an offset view:
105- var zx1 = new Complex128Array ( zx0 .buffer , zx0 .BYTES_PER_ELEMENT * 1 ); // start at 2nd element
105+ var x1 = new Complex128Array ( x0 .buffer , x0 .BYTES_PER_ELEMENT * 1 ); // start at 2nd element
106106
107- // Scales every other value from `zx1 ` by `za `...
108- zscal ( 3 , za, zx1 , 1 );
107+ // Scales every other value from `x1 ` by `alpha `...
108+ zscal ( 3 , alpha, x1 , 1 );
109109
110- var z = zx0 .get ( 1 );
110+ var z = x0 .get ( 1 );
111111// returns <Complex128>
112112
113113var re = real ( z );
@@ -117,22 +117,22 @@ var im = imag( z );
117117// returns 14.0
118118```
119119
120- #### zscal.ndarray( N, za, zx , strideX, offsetX )
120+ #### zscal.ndarray( N, alpha, x , strideX, offsetX )
121121
122- Scales values from ` zx ` by ` za ` using alternative indexing semantics.
122+ Scales values from ` x ` by ` alpha ` using alternative indexing semantics.
123123
124124``` javascript
125125var Complex128Array = require ( ' @stdlib/array/complex128' );
126126var Complex128 = require ( ' @stdlib/complex/float64/ctor' );
127127var real = require ( ' @stdlib/complex/float64/real' );
128128var imag = require ( ' @stdlib/complex/float64/imag' );
129129
130- var zx = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ] );
131- var za = new Complex128 ( 2.0 , 2.0 );
130+ var x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ] );
131+ var alpha = new Complex128 ( 2.0 , 2.0 );
132132
133- zscal .ndarray ( 3 , za, zx , 1 , 0 );
133+ zscal .ndarray ( 3 , alpha, x , 1 , 0 );
134134
135- var z = zx .get ( 0 );
135+ var z = x .get ( 0 );
136136// returns <Complex128>
137137
138138var re = real ( z );
@@ -144,7 +144,7 @@ var im = imag( z );
144144
145145The function has the following additional parameters:
146146
147- - ** offsetX** : starting index for ` zx ` .
147+ - ** offsetX** : starting index for ` x ` .
148148
149149While [ ` 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 value in the input strided array starting from the second element,
150150
@@ -154,12 +154,12 @@ var Complex128 = require( '@stdlib/complex/float64/ctor' );
154154var real = require ( ' @stdlib/complex/float64/real' );
155155var imag = require ( ' @stdlib/complex/float64/imag' );
156156
157- var zx = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
158- var za = new Complex128 ( 2.0 , 2.0 );
157+ var x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ] );
158+ var alpha = new Complex128 ( 2.0 , 2.0 );
159159
160- zscal .ndarray ( 2 , za, zx , 2 , 1 );
160+ zscal .ndarray ( 2 , alpha, x , 2 , 1 );
161161
162- var z = zx .get ( 3 );
162+ var z = x .get ( 3 );
163163// returns <Complex128>
164164
165165var re = real ( z );
@@ -177,7 +177,7 @@ var im = imag( z );
177177
178178## Notes
179179
180- - If ` N <= 0 ` or ` strideX <= 0 ` , both functions return ` zx ` unchanged.
180+ - If ` N <= 0 ` or ` strideX <= 0 ` , both functions return ` x ` unchanged.
181181- ` zscal() ` corresponds to the [ BLAS] [ blas ] level 1 function [ ` zscal ` ] [ zscal ] .
182182
183183</section >
@@ -200,15 +200,15 @@ function rand() {
200200 return new Complex128 ( discreteUniform ( 0 , 10 ), discreteUniform ( - 5 , 5 ) );
201201}
202202
203- var zx = filledarrayBy ( 10 , ' complex128' , rand );
204- console .log ( zx .toString () );
203+ var x = filledarrayBy ( 10 , ' complex128' , rand );
204+ console .log ( x .toString () );
205205
206- var za = new Complex128 ( 2.0 , 2.0 );
207- console .log ( za .toString () );
206+ var alpha = new Complex128 ( 2.0 , 2.0 );
207+ console .log ( alpha .toString () );
208208
209- // Scales elements from `zx ` by `za `:
210- zscal ( zx .length , za, zx , 1 );
211- console .log ( zx .get ( zx .length - 1 ).toString () );
209+ // Scales elements from `x ` by `alpha `:
210+ zscal ( x .length , alpha, x , 1 );
211+ console .log ( x .get ( x .length - 1 ).toString () );
212212```
213213
214214</section >
@@ -241,53 +241,53 @@ console.log( zx.get( zx.length-1 ).toString() );
241241#include " stdlib/blas/base/zscal.h"
242242```
243243
244- #### c_zscal( N, za , \* ZX , strideX )
244+ #### c_zscal( N, alpha , \* X , strideX )
245245
246- Scales values from ` ZX ` by ` za ` .
246+ Scales values from ` X ` by ` alpha ` .
247247
248248``` c
249249#include " stdlib/complex/float64/ctor.h"
250250
251- double zx [] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
252- const stdlib_complex128_t za = stdlib_complex128( 2.0, 2.0 );
251+ double x [] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
252+ const stdlib_complex128_t alpha = stdlib_complex128( 2.0, 2.0 );
253253
254- c_zscal ( 4, za , (void * )zx , 1 );
254+ c_zscal ( 4, alpha , (void * )x , 1 );
255255```
256256
257257The function accepts the following arguments:
258258
259259- **N**: `[in] CBLAS_INT` number of indexed elements.
260- - **za **: `[in] stdlib_complex128_t` scalar constant.
261- - **ZX **: `[inout] void*` input array.
262- - **strideX**: `[in] CBLAS_INT` index increment for `ZX `.
260+ - **alpha **: `[in] stdlib_complex128_t` scalar constant.
261+ - **X **: `[inout] void*` input array.
262+ - **strideX**: `[in] CBLAS_INT` index increment for `X `.
263263
264264```c
265- void c_zscal( const CBLAS_INT N, const stdlib_complex128_t za , void *ZX , const CBLAS_INT strideX );
265+ void c_zscal( const CBLAS_INT N, const stdlib_complex128_t alpha , void *X , const CBLAS_INT strideX );
266266```
267267
268- #### c_zscal_ndarray( N, za , \* ZX , strideX, offsetX )
268+ #### c_zscal_ndarray( N, alpha , \* X , strideX, offsetX )
269269
270- Scales values from ` ZX ` by ` za ` using alternative indexing semantics.
270+ Scales values from ` X ` by ` alpha ` using alternative indexing semantics.
271271
272272``` c
273273#include " stdlib/complex/float64/ctor.h"
274274
275- double zx [] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
276- const stdlib_complex128_t za = stdlib_complex128( 2.0, 2.0 );
275+ double x [] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
276+ const stdlib_complex128_t alpha = stdlib_complex128( 2.0, 2.0 );
277277
278- c_zscal_ndarray ( 4, za , (void * )zx , 1, 0 );
278+ c_zscal_ndarray ( 4, alpha , (void * )x , 1, 0 );
279279```
280280
281281The function accepts the following arguments:
282282
283283- **N**: `[in] CBLAS_INT` number of indexed elements.
284- - **za **: `[in] stdlib_complex128_t` scalar constant.
285- - **ZX **: `[inout] void*` input array.
286- - **strideX**: `[in] CBLAS_INT` index increment for `ZX `.
287- - **offsetX**: `[in] CBLAS_INT` starting index for `ZX `.
284+ - **alpha **: `[in] stdlib_complex128_t` scalar constant.
285+ - **X **: `[inout] void*` input array.
286+ - **strideX**: `[in] CBLAS_INT` index increment for `X `.
287+ - **offsetX**: `[in] CBLAS_INT` starting index for `X `.
288288
289289```c
290- void c_zscal_ndarray( const CBLAS_INT N, const stdlib_complex128_t za , void *ZX , const CBLAS_INT strideX, const CBLAS_INT offsetX );
290+ void c_zscal_ndarray( const CBLAS_INT N, const stdlib_complex128_t alpha , void *X , const CBLAS_INT strideX, const CBLAS_INT offsetX );
291291```
292292
293293</section >
@@ -315,10 +315,10 @@ void c_zscal_ndarray( const CBLAS_INT N, const stdlib_complex128_t za, void *ZX,
315315
316316int main ( void ) {
317317 // Create a strided array of interleaved real and imaginary components:
318- double zx [ ] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
318+ double x [ ] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
319319
320320 // Create a complex scalar:
321- const stdlib_complex128_t ca = stdlib_complex128( 2.0, 2.0 );
321+ const stdlib_complex128_t alpha = stdlib_complex128( 2.0, 2.0 );
322322
323323 // Specify the number of elements:
324324 const int N = 4;
@@ -327,19 +327,19 @@ int main( void ) {
327327 const int strideX = 1;
328328
329329 // Scale the elements of the array:
330- c_zscal( N, za , (void *)zx , strideX );
330+ c_zscal( N, alpha , (void *)x , strideX );
331331
332332 // Print the result:
333333 for ( int i = 0; i < N; i++ ) {
334- printf( "zx [ %i ] = %lf + %lfj\n", i, zx [ i*2 ], zx [ (i*2)+1 ] );
334+ printf( "x [ %i ] = %lf + %lfj\n", i, x [ i*2 ], x [ (i*2)+1 ] );
335335 }
336336
337337 // Scale the elements of the array using alternative indexing semantics:
338- c_zscal_ndarray( N, za , (void *)zx , -strideX, N-1 );
338+ c_zscal_ndarray( N, alpha , (void *)x , -strideX, N-1 );
339339
340340 // Print the result:
341341 for ( int i = 0; i < N; i++ ) {
342- printf( "zx [ %i ] = %lf + %lfj\n", i, zx [ i*2 ], zx [ (i*2)+1 ] );
342+ printf( "x [ %i ] = %lf + %lfj\n", i, x [ i*2 ], x [ (i*2)+1 ] );
343343 }
344344}
345345```
0 commit comments