1 subroutine dscal(n,da,dx,incx)
3 ! scales a vector by a constant.
4 ! uses unrolled loops for increment equal to one.
5 ! jack dongarra, linpack, 3/11/78.
6 ! modified 3/93 to return if incx .le. 0.
7 ! modified 12/3/93, array(1) declarations changed to array(*)
9 double precision da,dx(*)
10 integer i,incx,m,mp1,n,nincx
12 if( n.le.0 .or. incx.le.0 )return
15 ! code for increment not equal to 1
18 do 10 i = 1,nincx,incx
23 ! code for increment equal to 1
29 if( m .eq. 0 ) go to 40
37 dx(i + 1) = da*dx(i + 1)
38 dx(i + 2) = da*dx(i + 2)
39 dx(i + 3) = da*dx(i + 3)
40 dx(i + 4) = da*dx(i + 4)