LAPACK  3.10.0 LAPACK: Linear Algebra PACKage

## ◆ dscal()

 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 1.```
Parameters
 [in] N ``` N is INTEGER number of elements in input vector(s)``` [in] DA ``` DA is DOUBLE PRECISION On entry, DA specifies the scalar alpha.``` [in,out] DX ` DX is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCX ) )` [in] INCX ``` INCX is INTEGER storage spacing between elements of DX```
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 78 of file dscal.f.

79 *
80 * -- Reference BLAS level1 routine --
81 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
82 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
83 *
84 * .. Scalar Arguments ..
85  DOUBLE PRECISION DA
86  INTEGER INCX,N
87 * ..
88 * .. Array Arguments ..
89  DOUBLE PRECISION DX(*)
90 * ..
91 *
92 * =====================================================================
93 *
94 * .. Local Scalars ..
95  INTEGER I,M,MP1,NINCX
96 * ..
97 * .. Intrinsic Functions ..
98  INTRINSIC mod
99 * ..
100  IF (n.LE.0 .OR. incx.LE.0) RETURN
101  IF (incx.EQ.1) THEN
102 *
103 * code for increment equal to 1
104 *
105 *
106 * clean-up loop
107 *
108  m = mod(n,5)
109  IF (m.NE.0) THEN
110  DO i = 1,m
111  dx(i) = da*dx(i)
112  END DO
113  IF (n.LT.5) RETURN
114  END IF
115  mp1 = m + 1
116  DO i = mp1,n,5
117  dx(i) = da*dx(i)
118  dx(i+1) = da*dx(i+1)
119  dx(i+2) = da*dx(i+2)
120  dx(i+3) = da*dx(i+3)
121  dx(i+4) = da*dx(i+4)
122  END DO
123  ELSE
124 *
125 * code for increment not equal to 1
126 *
127  nincx = n*incx
128  DO i = 1,nincx,incx
129  dx(i) = da*dx(i)
130  END DO
131  END IF
132  RETURN
133 *
134 * End of DSCAL
135 *