LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dscal ( integer  N,
double precision  DA,
double precision, dimension(*)  DX,
integer  INCX 
)

DSCAL

Purpose:
    DSCAL scales a vector by a constant.
    uses unrolled loops for increment equal to one.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 3/93 to return if incx .le. 0.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 55 of file dscal.f.

55 *
56 * -- Reference BLAS level1 routine (version 3.4.0) --
57 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
58 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
59 * November 2011
60 *
61 * .. Scalar Arguments ..
62  DOUBLE PRECISION da
63  INTEGER incx,n
64 * ..
65 * .. Array Arguments ..
66  DOUBLE PRECISION dx(*)
67 * ..
68 *
69 * =====================================================================
70 *
71 * .. Local Scalars ..
72  INTEGER i,m,mp1,nincx
73 * ..
74 * .. Intrinsic Functions ..
75  INTRINSIC mod
76 * ..
77  IF (n.LE.0 .OR. incx.LE.0) RETURN
78  IF (incx.EQ.1) THEN
79 *
80 * code for increment equal to 1
81 *
82 *
83 * clean-up loop
84 *
85  m = mod(n,5)
86  IF (m.NE.0) THEN
87  DO i = 1,m
88  dx(i) = da*dx(i)
89  END DO
90  IF (n.LT.5) RETURN
91  END IF
92  mp1 = m + 1
93  DO i = mp1,n,5
94  dx(i) = da*dx(i)
95  dx(i+1) = da*dx(i+1)
96  dx(i+2) = da*dx(i+2)
97  dx(i+3) = da*dx(i+3)
98  dx(i+4) = da*dx(i+4)
99  END DO
100  ELSE
101 *
102 * code for increment not equal to 1
103 *
104  nincx = n*incx
105  DO i = 1,nincx,incx
106  dx(i) = da*dx(i)
107  END DO
108  END IF
109  RETURN