LAPACK  3.7.0
LAPACK: Linear Algebra PACKage
subroutine zpoequb ( integer  N,
complex*16, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( * )  S,
double precision  SCOND,
double precision  AMAX,
integer  INFO 
)

ZPOEQUB

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

Purpose:
 ZPOEQUB computes row and column scalings intended to equilibrate a
 Hermitian positive definite matrix A and reduce its condition number
 (with respect to the two-norm).  S contains the scale factors,
 S(i) = 1/sqrt(A(i,i)), chosen so that the scaled matrix B with
 elements B(i,j) = S(i)*A(i,j)*S(j) has ones on the diagonal.  This
 choice of S puts the condition number of B within a factor N of the
 smallest possible condition number over all possible diagonal
 scalings.

 This routine differs from ZPOEQU by restricting the scaling factors
 to a power of the radix.  Barring over- and underflow, scaling by
 these factors introduces no additional rounding errors.  However, the
 scaled diagonal entries are no longer approximately 1 but lie
 between sqrt(radix) and 1/sqrt(radix).
Parameters
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]A
          A is COMPLEX*16 array, dimension (LDA,N)
          The N-by-N Hermitian positive definite matrix whose scaling
          factors are to be computed.  Only the diagonal elements of A
          are referenced.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[out]S
          S is DOUBLE PRECISION array, dimension (N)
          If INFO = 0, S contains the scale factors for A.
[out]SCOND
          SCOND is DOUBLE PRECISION
          If INFO = 0, S contains the ratio of the smallest S(i) to
          the largest S(i).  If SCOND >= 0.1 and AMAX is neither too
          large nor too small, it is not worth scaling by S.
[out]AMAX
          AMAX is DOUBLE PRECISION
          Absolute value of largest matrix element.  If AMAX is very
          close to overflow or very close to underflow, the matrix
          should be scaled.
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
          > 0:  if INFO = i, the i-th diagonal element is nonpositive.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 121 of file zpoequb.f.

121 *
122 * -- LAPACK computational routine (version 3.7.0) --
123 * -- LAPACK is a software package provided by Univ. of Tennessee, --
124 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
125 * December 2016
126 *
127 * .. Scalar Arguments ..
128  INTEGER info, lda, n
129  DOUBLE PRECISION amax, scond
130 * ..
131 * .. Array Arguments ..
132  COMPLEX*16 a( lda, * )
133  DOUBLE PRECISION s( * )
134 * ..
135 *
136 * =====================================================================
137 *
138 * .. Parameters ..
139  DOUBLE PRECISION zero, one
140  parameter ( zero = 0.0d+0, one = 1.0d+0 )
141 * ..
142 * .. Local Scalars ..
143  INTEGER i
144  DOUBLE PRECISION smin, base, tmp
145 * ..
146 * .. External Functions ..
147  DOUBLE PRECISION dlamch
148  EXTERNAL dlamch
149 * ..
150 * .. External Subroutines ..
151  EXTERNAL xerbla
152 * ..
153 * .. Intrinsic Functions ..
154  INTRINSIC max, min, sqrt, log, int, REAL, dimag
155 * ..
156 * .. Executable Statements ..
157 *
158 * Test the input parameters.
159 *
160 * Positive definite only performs 1 pass of equilibration.
161 *
162  info = 0
163  IF( n.LT.0 ) THEN
164  info = -1
165  ELSE IF( lda.LT.max( 1, n ) ) THEN
166  info = -3
167  END IF
168  IF( info.NE.0 ) THEN
169  CALL xerbla( 'ZPOEQUB', -info )
170  RETURN
171  END IF
172 *
173 * Quick return if possible.
174 *
175  IF( n.EQ.0 ) THEN
176  scond = one
177  amax = zero
178  RETURN
179  END IF
180 
181  base = dlamch( 'B' )
182  tmp = -0.5d+0 / log( base )
183 *
184 * Find the minimum and maximum diagonal elements.
185 *
186  s( 1 ) = a( 1, 1 )
187  smin = s( 1 )
188  amax = s( 1 )
189  DO 10 i = 2, n
190  s( i ) = a( i, i )
191  smin = min( smin, s( i ) )
192  amax = max( amax, s( i ) )
193  10 CONTINUE
194 *
195  IF( smin.LE.zero ) THEN
196 *
197 * Find the first non-positive diagonal element and return.
198 *
199  DO 20 i = 1, n
200  IF( s( i ).LE.zero ) THEN
201  info = i
202  RETURN
203  END IF
204  20 CONTINUE
205  ELSE
206 *
207 * Set the scale factors to the reciprocals
208 * of the diagonal elements.
209 *
210  DO 30 i = 1, n
211  s( i ) = base ** int( tmp * log( s( i ) ) )
212  30 CONTINUE
213 *
214 * Compute SCOND = min(S(I)) / max(S(I)).
215 *
216  scond = sqrt( smin ) / sqrt( amax )
217  END IF
218 *
219  RETURN
220 *
221 * End of ZPOEQUB
222 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62

Here is the call graph for this function:

Here is the caller graph for this function: