Skip to content

Commit 095803e

Browse files
authored
docs: change variable naming in blas/base/zscal
PR-URL: #6880 Reviewed-by: Athan Reines <[email protected]>
1 parent 07d1610 commit 095803e

File tree

14 files changed

+250
-250
lines changed

14 files changed

+250
-250
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var alpha = new Complex128( 2.0, 2.0 );
8282
// Create an offset view:
8383
var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
8484

85-
// Scales every other value from `zx1` by `za`...
85+
// Scales every other value from `x1` by `alpha`...
8686
zscal( 3, alpha, x1, 1 );
8787
// x0 => <Complex128Array>[ 1.0, 2.0, -2.0, 14.0, -2.0, 22.0, -2.0, 30.0 ]
8888
```

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ var options = {
4747
* @returns {Function} benchmark function
4848
*/
4949
function createBenchmark( len ) {
50-
var zxbuf;
51-
var za;
52-
var zx;
50+
var alpha;
51+
var xbuf;
52+
var x;
5353

54-
zxbuf = uniform( len*2, -100.0, 100.0, options );
55-
zx = new Complex128Array( zxbuf.buffer );
54+
xbuf = uniform( len*2, -100.0, 100.0, options );
55+
x = new Complex128Array( xbuf.buffer );
5656

57-
za = new Complex128( 1.0, 0.0 );
57+
alpha = new Complex128( 1.0, 0.0 );
5858

5959
return benchmark;
6060

@@ -69,13 +69,13 @@ function createBenchmark( len ) {
6969

7070
b.tic();
7171
for ( i = 0; i < b.iterations; i++ ) {
72-
zscal( zx.length, za, zx, 1 );
73-
if ( isnan( zxbuf[ i%(len*2) ] ) ) {
72+
zscal( x.length, alpha, x, 1 );
73+
if ( isnan( xbuf[ i%(len*2) ] ) ) {
7474
b.fail( 'should not return NaN' );
7575
}
7676
}
7777
b.toc();
78-
if ( isnan( zxbuf[ i%(len*2) ] ) ) {
78+
if ( isnan( xbuf[ i%(len*2) ] ) ) {
7979
b.fail( 'should not return NaN' );
8080
}
8181
b.pass( 'benchmark finished' );

lib/node_modules/@stdlib/blas/base/zscal/benchmark/benchmark.native.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ var options = {
5252
* @returns {Function} benchmark function
5353
*/
5454
function createBenchmark( len ) {
55-
var zxbuf;
56-
var za;
57-
var zx;
55+
var alpha;
56+
var xbuf;
57+
var x;
5858

59-
zxbuf = uniform( len*2, -100.0, 100.0, options );
60-
zx = new Complex128Array( zxbuf.buffer );
59+
xbuf = uniform( len*2, -100.0, 100.0, options );
60+
x = new Complex128Array( xbuf.buffer );
6161

62-
za = new Complex128( 1.0, 0.0 );
62+
alpha = new Complex128( 1.0, 0.0 );
6363

6464
return benchmark;
6565

@@ -74,13 +74,13 @@ function createBenchmark( len ) {
7474

7575
b.tic();
7676
for ( i = 0; i < b.iterations; i++ ) {
77-
zscal( zx.length, za, zx, 1 );
78-
if ( isnan( zxbuf[ i%(len*2) ] ) ) {
77+
zscal( x.length, alpha, x, 1 );
78+
if ( isnan( xbuf[ i%(len*2) ] ) ) {
7979
b.fail( 'should not return NaN' );
8080
}
8181
}
8282
b.toc();
83-
if ( isnan( zxbuf[ i%(len*2) ] ) ) {
83+
if ( isnan( xbuf[ i%(len*2) ] ) ) {
8484
b.fail( 'should not return NaN' );
8585
}
8686
b.pass( 'benchmark finished' );

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ var options = {
4747
* @returns {Function} benchmark function
4848
*/
4949
function createBenchmark( len ) {
50-
var zxbuf;
51-
var za;
52-
var zx;
50+
var alpha;
51+
var xbuf;
52+
var x;
5353

54-
zxbuf = uniform( len*2, -100.0, 100.0, options );
55-
zx = new Complex128Array( zxbuf.buffer );
54+
xbuf = uniform( len*2, -100.0, 100.0, options );
55+
x = new Complex128Array( xbuf.buffer );
5656

57-
za = new Complex128( 1.0, 0.0 );
57+
alpha = new Complex128( 1.0, 0.0 );
5858

5959
return benchmark;
6060

@@ -69,13 +69,13 @@ function createBenchmark( len ) {
6969

7070
b.tic();
7171
for ( i = 0; i < b.iterations; i++ ) {
72-
zscal( zx.length, za, zx, 1, 0 );
73-
if ( isnan( zxbuf[ i%(len*2) ] ) ) {
72+
zscal( x.length, alpha, x, 1, 0 );
73+
if ( isnan( xbuf[ i%(len*2) ] ) ) {
7474
b.fail( 'should not return NaN' );
7575
}
7676
}
7777
b.toc();
78-
if ( isnan( zxbuf[ i%(len*2) ] ) ) {
78+
if ( isnan( xbuf[ i%(len*2) ] ) ) {
7979
b.fail( 'should not return NaN' );
8080
}
8181
b.pass( 'benchmark finished' );

lib/node_modules/@stdlib/blas/base/zscal/benchmark/benchmark.ndarray.native.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ var options = {
5252
* @returns {Function} benchmark function
5353
*/
5454
function createBenchmark( len ) {
55-
var zxbuf;
56-
var za;
57-
var zx;
55+
var alpha;
56+
var xbuf;
57+
var x;
5858

59-
zxbuf = uniform( len*2, -100.0, 100.0, options );
60-
zx = new Complex128Array( zxbuf.buffer );
59+
xbuf = uniform( len*2, -100.0, 100.0, options );
60+
x = new Complex128Array( xbuf.buffer );
6161

62-
za = new Complex128( 1.0, 0.0 );
62+
alpha = new Complex128( 1.0, 0.0 );
6363

6464
return benchmark;
6565

@@ -74,13 +74,13 @@ function createBenchmark( len ) {
7474

7575
b.tic();
7676
for ( i = 0; i < b.iterations; i++ ) {
77-
zscal( zx.length, za, zx, 1, 0 );
78-
if ( isnan( zxbuf[ i%(len*2) ] ) ) {
77+
zscal( x.length, alpha, x, 1, 0 );
78+
if ( isnan( xbuf[ i%(len*2) ] ) ) {
7979
b.fail( 'should not return NaN' );
8080
}
8181
}
8282
b.toc();
83-
if ( isnan( zxbuf[ i%(len*2) ] ) ) {
83+
if ( isnan( xbuf[ i%(len*2) ] ) ) {
8484
b.fail( 'should not return NaN' );
8585
}
8686
b.pass( 'benchmark finished' );

lib/node_modules/@stdlib/blas/base/zscal/benchmark/c/benchmark.length.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,27 +96,27 @@ static double rand_double( void ) {
9696
* @return elapsed time in seconds
9797
*/
9898
static double benchmark1( int iterations, int len ) {
99-
stdlib_complex128_t za;
100-
double zx[ len*2 ];
99+
stdlib_complex128_t alpha;
100+
double x[ len*2 ];
101101
double elapsed;
102102
double t;
103103
int i;
104104

105-
za = stdlib_complex128( 1.0, 0.0 );
105+
alpha = stdlib_complex128( 1.0, 0.0 );
106106
for ( i = 0; i < len*2; i+=2 ) {
107-
zx[ i ] = ( rand_double()*2.0 ) - 1.0;
108-
zx[ i+1 ] = ( rand_double()*2.0 ) - 1.0;
107+
x[ i ] = ( rand_double()*2.0 ) - 1.0;
108+
x[ i+1 ] = ( rand_double()*2.0 ) - 1.0;
109109
}
110110
t = tic();
111111
for ( i = 0; i < iterations; i++ ) {
112-
c_zscal( len, za, (void *)zx, 1 );
113-
if ( zx[ 0 ] != zx[ 0 ] ) {
112+
c_zscal( len, alpha, (void *)x, 1 );
113+
if ( x[ 0 ] != x[ 0 ] ) {
114114
printf( "should not return NaN\n" );
115115
break;
116116
}
117117
}
118118
elapsed = tic() - t;
119-
if ( zx[ 0 ] != zx[ 0 ] ) {
119+
if ( x[ 0 ] != x[ 0 ] ) {
120120
printf( "should not return NaN\n" );
121121
}
122122
return elapsed;
@@ -130,27 +130,27 @@ static double benchmark1( int iterations, int len ) {
130130
* @return elapsed time in seconds
131131
*/
132132
static double benchmark2( int iterations, int len ) {
133-
stdlib_complex128_t za;
134-
double zx[ len*2 ];
133+
stdlib_complex128_t alpha;
134+
double x[ len*2 ];
135135
double elapsed;
136136
double t;
137137
int i;
138138

139-
za = stdlib_complex128( 1.0, 0.0 );
139+
alpha = stdlib_complex128( 1.0, 0.0 );
140140
for ( i = 0; i < len*2; i+=2 ) {
141-
zx[ i ] = ( rand_double()*2.0 ) - 1.0;
142-
zx[ i+1 ] = ( rand_double()*2.0 ) - 1.0;
141+
x[ i ] = ( rand_double()*2.0 ) - 1.0;
142+
x[ i+1 ] = ( rand_double()*2.0 ) - 1.0;
143143
}
144144
t = tic();
145145
for ( i = 0; i < iterations; i++ ) {
146-
c_zscal_ndarray( len, za, (void *)zx, 1, 0 );
147-
if ( zx[ 0 ] != zx[ 0 ] ) {
146+
c_zscal_ndarray( len, alpha, (void *)x, 1, 0 );
147+
if ( x[ 0 ] != x[ 0 ] ) {
148148
printf( "should not return NaN\n" );
149149
break;
150150
}
151151
}
152152
elapsed = tic() - t;
153-
if ( zx[ 0 ] != zx[ 0 ] ) {
153+
if ( x[ 0 ] != x[ 0 ] ) {
154154
printf( "should not return NaN\n" );
155155
}
156156
return elapsed;

lib/node_modules/@stdlib/blas/base/zscal/benchmark/fortran/benchmark.length.f

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ double precision function benchmark( iterations, len )
124124
! ..
125125
! External functions:
126126
interface
127-
subroutine zscal( N, za, zx, strideX )
128-
complex(kind=kind(0.0d0)) :: za, zx(*)
127+
subroutine zscal( N, alpha, x, strideX )
128+
complex(kind=kind(0.0d0)) :: alpha, x(*)
129129
integer :: strideX, N
130130
end subroutine zscal
131131
end interface
@@ -142,7 +142,7 @@ end subroutine zscal
142142
complex(kind=kind(0.0d0)), allocatable :: x(:)
143143
! ..
144144
! Local scalar:
145-
complex(kind=kind(0.0d0)) :: za
145+
complex(kind=kind(0.0d0)) :: alpha
146146
! ..
147147
! Intrinsic functions:
148148
intrinsic random_number, cpu_time, cmplx
@@ -152,7 +152,7 @@ end subroutine zscal
152152
! ..
153153
call random_number( r1 )
154154
call random_number( r2 )
155-
za = cmplx( (r1*1.0d0), (r2*0.0d0), kind=kind(0.0d0) )
155+
alpha = cmplx( (r1*1.0d0), (r2*0.0d0), kind=kind(0.0d0) )
156156
do i = 1, len
157157
call random_number( r1 )
158158
call random_number( r2 )
@@ -162,7 +162,7 @@ end subroutine zscal
162162
call cpu_time( t1 )
163163
! ..
164164
do i = 1, iterations
165-
call zscal( len, za, x, 1 );
165+
call zscal( len, alpha, x, 1 );
166166
if ( x( 1 ) /= x( 1 ) ) then
167167
print '(A)', 'should not return NaN'
168168
exit
@@ -219,4 +219,4 @@ subroutine main()
219219
end do
220220
call print_summary( count, count )
221221
end subroutine main
222-
end program bench
222+
end program bench

lib/node_modules/@stdlib/blas/base/zscal/lib/ndarray.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ var addon = require( './../src/addon.node' );
4747
* // x => <Complex128Array>[ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ]
4848
*/
4949
function zscal( N, alpha, x, strideX, offsetX ) {
50-
var viewZX = reinterpret( x, 0 );
51-
addon.ndarray( N, alpha, viewZX, strideX, offsetX );
50+
var viewX = reinterpret( x, 0 );
51+
addon.ndarray( N, alpha, viewX, strideX, offsetX );
5252
return x;
5353
}
5454

lib/node_modules/@stdlib/blas/base/zscal/lib/zscal.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ var addon = require( './../src/addon.node' );
4646
* // x => <Complex128Array>[ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ]
4747
*/
4848
function zscal( N, alpha, x, strideX ) {
49-
var viewZX = reinterpret( x, 0 );
50-
addon( N, alpha, viewZX, strideX );
49+
var viewX = reinterpret( x, 0 );
50+
addon( N, alpha, viewX, strideX );
5151
return x;
5252
}
5353

lib/node_modules/@stdlib/blas/base/zscal/src/zscal.f

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@
4949
! > * We will gladly answer any questions regarding the software. If a modification is done, however, it is the responsibility of the person who modified the routine to provide support.
5050
!
5151
! @param {integer} N - number of indexed elements
52-
! @param {complex<double>} za - scalar constant
53-
! @param {Array<complex<double>>} zx - input array
54-
! @param {integer} strideX - `zx` stride length
52+
! @param {complex<double>} alpha - scalar constant
53+
! @param {Array<complex<double>>} x - input array
54+
! @param {integer} strideX - `x` stride length
5555
!<
56-
subroutine zscal( N, za, zx, strideX )
56+
subroutine zscal( N, alpha, x, strideX )
5757
implicit none
5858
! ..
5959
! Scalar arguments:
60-
complex(kind=kind(0.0d0)) :: za
60+
complex(kind=kind(0.0d0)) :: alpha
6161
integer :: strideX, N
6262
! ..
6363
! Array arguments:
64-
complex(kind=kind(0.0d0)) :: zx(*)
64+
complex(kind=kind(0.0d0)) :: x(*)
6565
! ..
6666
! Local scalars:
6767
integer :: ix, i
@@ -72,14 +72,14 @@ subroutine zscal( N, za, zx, strideX )
7272
! ..
7373
if ( strideX == 1 ) then
7474
do i = 1, N
75-
zx(i) = za * zx(i)
75+
x(i) = alpha * x(i)
7676
end do
7777
else
7878
ix = 1
7979
do i = 1, N
80-
zx(ix) = za * zx(ix)
80+
x(ix) = alpha * x(ix)
8181
ix = ix + strideX
8282
end do
8383
end if
8484
return
85-
end subroutine zscal
85+
end subroutine zscal

0 commit comments

Comments
 (0)