1 *> \brief \b CLAQHB scales a Hermitian band matrix, using scaling factors computed by cpbequ.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CLAQHB + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/claqhb.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/claqhb.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/claqhb.f">
21 * SUBROUTINE CLAQHB( UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED )
23 * .. Scalar Arguments ..
24 * CHARACTER EQUED, UPLO
28 * .. Array Arguments ..
30 * COMPLEX AB( LDAB, * )
39 *> CLAQHB equilibrates an Hermitian band matrix A using the scaling
40 *> factors in the vector S.
48 *> UPLO is CHARACTER*1
49 *> Specifies whether the upper or lower triangular part of the
50 *> symmetric matrix A is stored.
51 *> = 'U': Upper triangular
52 *> = 'L': Lower triangular
58 *> The order of the matrix A. N >= 0.
64 *> The number of super-diagonals of the matrix A if UPLO = 'U',
65 *> or the number of sub-diagonals if UPLO = 'L'. KD >= 0.
70 *> AB is COMPLEX array, dimension (LDAB,N)
71 *> On entry, the upper or lower triangle of the symmetric band
72 *> matrix A, stored in the first KD+1 rows of the array. The
73 *> j-th column of A is stored in the j-th column of the array AB
75 *> if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
76 *> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
78 *> On exit, if INFO = 0, the triangular factor U or L from the
79 *> Cholesky factorization A = U**H *U or A = L*L**H of the band
80 *> matrix A, in the same storage format as A.
86 *> The leading dimension of the array AB. LDAB >= KD+1.
91 *> S is REAL array, dimension (N)
92 *> The scale factors for A.
98 *> Ratio of the smallest S(i) to the largest S(i).
104 *> Absolute value of largest matrix entry.
109 *> EQUED is CHARACTER*1
110 *> Specifies whether or not equilibration was done.
111 *> = 'N': No equilibration.
112 *> = 'Y': Equilibration was done, i.e., A has been replaced by
113 *> diag(S) * A * diag(S).
116 *> \par Internal Parameters:
117 * =========================
120 *> THRESH is a threshold value used to decide if scaling should be done
121 *> based on the ratio of the scaling factors. If SCOND < THRESH,
124 *> LARGE and SMALL are threshold values used to decide if scaling should
125 *> be done based on the absolute size of the largest matrix element.
126 *> If AMAX > LARGE or AMAX < SMALL, scaling is done.
132 *> \author Univ. of Tennessee
133 *> \author Univ. of California Berkeley
134 *> \author Univ. of Colorado Denver
137 *> \date September 2012
139 *> \ingroup complexOTHERauxiliary
141 * =====================================================================
142 SUBROUTINE CLAQHB( UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED )
144 * -- LAPACK auxiliary routine (version 3.4.2) --
145 * -- LAPACK is a software package provided by Univ. of Tennessee, --
146 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
149 * .. Scalar Arguments ..
150 CHARACTER EQUED, UPLO
154 * .. Array Arguments ..
156 COMPLEX AB( LDAB, * )
159 * =====================================================================
163 PARAMETER ( ONE = 1.0E+0, THRESH = 0.1E+0 )
165 * .. Local Scalars ..
167 REAL CJ, LARGE, SMALL
169 * .. External Functions ..
172 EXTERNAL LSAME, SLAMCH
174 * .. Intrinsic Functions ..
175 INTRINSIC MAX, MIN, REAL
177 * .. Executable Statements ..
179 * Quick return if possible
186 * Initialize LARGE and SMALL.
188 SMALL = SLAMCH( 'Safe minimum' ) / SLAMCH( 'Precision' )
191 IF( SCOND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE ) THEN
198 * Replace A by diag(S) * A * diag(S).
200 IF( LSAME( UPLO, 'U' ) ) THEN
202 * Upper triangle of A is stored in band format.
206 DO 10 I = MAX( 1, J-KD ), J - 1
207 AB( KD+1+I-J, J ) = CJ*S( I )*AB( KD+1+I-J, J )
209 AB( KD+1, J ) = CJ*CJ*REAL( AB( KD+1, J ) )
213 * Lower triangle of A is stored.
217 AB( 1, J ) = CJ*CJ*REAL( AB( 1, J ) )
218 DO 30 I = J + 1, MIN( N, J+KD )
219 AB( 1+I-J, J ) = CJ*S( I )*AB( 1+I-J, J )