| 1 |
subroutine cscal(n,ca,cx,incx) |
| 2 |
c |
| 3 |
c scales a vector by a constant. |
| 4 |
c jack dongarra, linpack, 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 |
complex ca,cx(*) |
| 9 |
integer i,incx,n,nincx |
| 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 |
nincx = n*incx |
| 17 |
do 10 i = 1,nincx,incx |
| 18 |
cx(i) = ca*cx(i) |
| 19 |
10 continue |
| 20 |
return |
| 21 |
c |
| 22 |
c code for increment equal to 1 |
| 23 |
c |
| 24 |
20 do 30 i = 1,n |
| 25 |
cx(i) = ca*cx(i) |
| 26 |
30 continue |
| 27 |
return |
| 28 |
end |