LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zdscal()

subroutine zdscal ( integer  n,
double precision  da,
complex*16, dimension(*)  zx,
integer  incx 
)

ZDSCAL

Purpose:
    ZDSCAL scales a vector by a constant.
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]ZX
          ZX is COMPLEX*16 array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of ZX
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
     jack dongarra, 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 77 of file zdscal.f.

78*
79* -- Reference BLAS level1 routine --
80* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
81* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
82*
83* .. Scalar Arguments ..
84 DOUBLE PRECISION DA
85 INTEGER INCX,N
86* ..
87* .. Array Arguments ..
88 COMPLEX*16 ZX(*)
89* ..
90*
91* =====================================================================
92*
93* .. Local Scalars ..
94 INTEGER I,NINCX
95* .. Parameters ..
96 DOUBLE PRECISION ONE
97 parameter(one=1.0d+0)
98* ..
99* .. Intrinsic Functions ..
100 INTRINSIC dble, dcmplx, dimag
101* ..
102 IF (n.LE.0 .OR. incx.LE.0 .OR. da.EQ.one) RETURN
103 IF (incx.EQ.1) THEN
104*
105* code for increment equal to 1
106*
107 DO i = 1,n
108 zx(i) = dcmplx(da*dble(zx(i)),da*dimag(zx(i)))
109 END DO
110 ELSE
111*
112* code for increment not equal to 1
113*
114 nincx = n*incx
115 DO i = 1,nincx,incx
116 zx(i) = dcmplx(da*dble(zx(i)),da*dimag(zx(i)))
117 END DO
118 END IF
119 RETURN
120*
121* End of ZDSCAL
122*