LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ dpbequ()

subroutine dpbequ ( character  UPLO,
integer  N,
integer  KD,
double precision, dimension( ldab, * )  AB,
integer  LDAB,
double precision, dimension( * )  S,
double precision  SCOND,
double precision  AMAX,
integer  INFO 
)

DPBEQU

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

Purpose:
 DPBEQU computes row and column scalings intended to equilibrate a
 symmetric positive definite band 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.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  Upper triangular of A is stored;
          = 'L':  Lower triangular of A is stored.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]KD
          KD is INTEGER
          The number of superdiagonals of the matrix A if UPLO = 'U',
          or the number of subdiagonals if UPLO = 'L'.  KD >= 0.
[in]AB
          AB is DOUBLE PRECISION array, dimension (LDAB,N)
          The upper or lower triangle of the symmetric band matrix A,
          stored in the first KD+1 rows of the array.  The j-th column
          of A is stored in the j-th column of the array AB as follows:
          if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
          if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j<=i<=min(n,j+kd).
[in]LDAB
          LDAB is INTEGER
          The leading dimension of the array A.  LDAB >= KD+1.
[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.

Definition at line 128 of file dpbequ.f.

129 *
130 * -- LAPACK computational routine --
131 * -- LAPACK is a software package provided by Univ. of Tennessee, --
132 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
133 *
134 * .. Scalar Arguments ..
135  CHARACTER UPLO
136  INTEGER INFO, KD, LDAB, N
137  DOUBLE PRECISION AMAX, SCOND
138 * ..
139 * .. Array Arguments ..
140  DOUBLE PRECISION AB( LDAB, * ), S( * )
141 * ..
142 *
143 * =====================================================================
144 *
145 * .. Parameters ..
146  DOUBLE PRECISION ZERO, ONE
147  parameter( zero = 0.0d+0, one = 1.0d+0 )
148 * ..
149 * .. Local Scalars ..
150  LOGICAL UPPER
151  INTEGER I, J
152  DOUBLE PRECISION SMIN
153 * ..
154 * .. External Functions ..
155  LOGICAL LSAME
156  EXTERNAL lsame
157 * ..
158 * .. External Subroutines ..
159  EXTERNAL xerbla
160 * ..
161 * .. Intrinsic Functions ..
162  INTRINSIC max, min, sqrt
163 * ..
164 * .. Executable Statements ..
165 *
166 * Test the input parameters.
167 *
168  info = 0
169  upper = lsame( uplo, 'U' )
170  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
171  info = -1
172  ELSE IF( n.LT.0 ) THEN
173  info = -2
174  ELSE IF( kd.LT.0 ) THEN
175  info = -3
176  ELSE IF( ldab.LT.kd+1 ) THEN
177  info = -5
178  END IF
179  IF( info.NE.0 ) THEN
180  CALL xerbla( 'DPBEQU', -info )
181  RETURN
182  END IF
183 *
184 * Quick return if possible
185 *
186  IF( n.EQ.0 ) THEN
187  scond = one
188  amax = zero
189  RETURN
190  END IF
191 *
192  IF( upper ) THEN
193  j = kd + 1
194  ELSE
195  j = 1
196  END IF
197 *
198 * Initialize SMIN and AMAX.
199 *
200  s( 1 ) = ab( j, 1 )
201  smin = s( 1 )
202  amax = s( 1 )
203 *
204 * Find the minimum and maximum diagonal elements.
205 *
206  DO 10 i = 2, n
207  s( i ) = ab( j, i )
208  smin = min( smin, s( i ) )
209  amax = max( amax, s( i ) )
210  10 CONTINUE
211 *
212  IF( smin.LE.zero ) THEN
213 *
214 * Find the first non-positive diagonal element and return.
215 *
216  DO 20 i = 1, n
217  IF( s( i ).LE.zero ) THEN
218  info = i
219  RETURN
220  END IF
221  20 CONTINUE
222  ELSE
223 *
224 * Set the scale factors to the reciprocals
225 * of the diagonal elements.
226 *
227  DO 30 i = 1, n
228  s( i ) = one / sqrt( s( i ) )
229  30 CONTINUE
230 *
231 * Compute SCOND = min(S(I)) / max(S(I))
232 *
233  scond = sqrt( smin ) / sqrt( amax )
234  END IF
235  RETURN
236 *
237 * End of DPBEQU
238 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
Here is the call graph for this function:
Here is the caller graph for this function: