LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ 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.
Date
December 2016

Definition at line 86 of file zdrscl.f.

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