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

◆ zdrscl()

subroutine zdrscl ( integer  n,
double precision  sa,
complex*16, dimension( * )  sx,
integer  incx 
)

ZDRSCL multiplies a vector by the reciprocal of a real scalar.

Download ZDRSCL + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 ZDRSCL multiplies an n-element complex vector x by the real scalar
 1/a.  This is done without overflow or underflow as long as
 the final result x/a does not overflow or underflow.
Parameters
[in]N
          N is INTEGER
          The number of components of the vector x.
[in]SA
          SA is DOUBLE PRECISION
          The scalar a which is used to divide each component of x.
          SA must be >= 0, or the subroutine will divide by zero.
[in,out]SX
          SX is COMPLEX*16 array, dimension
                         (1+(N-1)*abs(INCX))
          The n-element vector x.
[in]INCX
          INCX is INTEGER
          The increment between successive values of the vector SX.
          > 0:  SX(1) = X(1) and SX(1+(i-1)*INCX) = x(i),     1< i<= n
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 83 of file zdrscl.f.

84*
85* -- LAPACK auxiliary routine --
86* -- LAPACK is a software package provided by Univ. of Tennessee, --
87* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
88*
89* .. Scalar Arguments ..
90 INTEGER INCX, N
91 DOUBLE PRECISION SA
92* ..
93* .. Array Arguments ..
94 COMPLEX*16 SX( * )
95* ..
96*
97* =====================================================================
98*
99* .. Parameters ..
100 DOUBLE PRECISION ZERO, ONE
101 parameter( zero = 0.0d+0, one = 1.0d+0 )
102* ..
103* .. Local Scalars ..
104 LOGICAL DONE
105 DOUBLE PRECISION BIGNUM, CDEN, CDEN1, CNUM, CNUM1, MUL, SMLNUM
106* ..
107* .. External Functions ..
108 DOUBLE PRECISION DLAMCH
109 EXTERNAL dlamch
110* ..
111* .. External Subroutines ..
112 EXTERNAL zdscal
113* ..
114* .. Intrinsic Functions ..
115 INTRINSIC abs
116* ..
117* .. Executable Statements ..
118*
119* Quick return if possible
120*
121 IF( n.LE.0 )
122 $ RETURN
123*
124* Get machine parameters
125*
126 smlnum = dlamch( 'S' )
127 bignum = one / smlnum
128*
129* Initialize the denominator to SA and the numerator to 1.
130*
131 cden = sa
132 cnum = one
133*
134 10 CONTINUE
135 cden1 = cden*smlnum
136 cnum1 = cnum / bignum
137 IF( abs( cden1 ).GT.abs( cnum ) .AND. cnum.NE.zero ) THEN
138*
139* Pre-multiply X by SMLNUM if CDEN is large compared to CNUM.
140*
141 mul = smlnum
142 done = .false.
143 cden = cden1
144 ELSE IF( abs( cnum1 ).GT.abs( cden ) ) THEN
145*
146* Pre-multiply X by BIGNUM if CDEN is small compared to CNUM.
147*
148 mul = bignum
149 done = .false.
150 cnum = cnum1
151 ELSE
152*
153* Multiply X by CNUM / CDEN and return.
154*
155 mul = cnum / cden
156 done = .true.
157 END IF
158*
159* Scale the vector X by MUL
160*
161 CALL zdscal( n, mul, sx, incx )
162*
163 IF( .NOT.done )
164 $ GO TO 10
165*
166 RETURN
167*
168* End of ZDRSCL
169*
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
subroutine zdscal(n, da, zx, incx)
ZDSCAL
Definition zdscal.f:78
Here is the call graph for this function:
Here is the caller graph for this function: