| 1 |
subroutine zscal(n,za,zx,incx) |
| 2 |
c |
| 3 |
c scales a vector by a constant. |
| 4 |
c jack dongarra, 3/11/78. |
| 5 |
c modified 3/93 to return if incx .le. 0. |
| 6 |
c modified 12/3/93, array(1) declarations changed to array(*) |
| 7 |
c |
| 8 |
double complex za,zx(*) |
| 9 |
integer i,incx,ix,n |
| 10 |
c |
| 11 |
if( n.le.0 .or. incx.le.0 )return |
| 12 |
if(incx.eq.1)go to 20 |
| 13 |
c |
| 14 |
c code for increment not equal to 1 |
| 15 |
c |
| 16 |
ix = 1 |
| 17 |
do 10 i = 1,n |
| 18 |
zx(ix) = za*zx(ix) |
| 19 |
ix = ix + incx |
| 20 |
10 continue |
| 21 |
return |
| 22 |
c |
| 23 |
c code for increment equal to 1 |
| 24 |
c |
| 25 |
20 do 30 i = 1,n |
| 26 |
zx(i) = za*zx(i) |
| 27 |
30 continue |
| 28 |
return |
| 29 |
end |