1 *> \brief \b SLAQSB scales a symmetric/Hermitian band matrix, using scaling factors computed by spbequ.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SLAQSB + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slaqsb.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slaqsb.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slaqsb.f">
21 * SUBROUTINE SLAQSB( UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED )
23 * .. Scalar Arguments ..
24 * CHARACTER EQUED, UPLO
28 * .. Array Arguments ..
29 * REAL AB( LDAB, * ), S( * )
38 *> SLAQSB equilibrates a symmetric band matrix A using the scaling
39 *> factors in the vector S.
47 *> UPLO is CHARACTER*1
48 *> Specifies whether the upper or lower triangular part of the
49 *> symmetric matrix A is stored.
50 *> = 'U': Upper triangular
51 *> = 'L': Lower triangular
57 *> The order of the matrix A. N >= 0.
63 *> The number of super-diagonals of the matrix A if UPLO = 'U',
64 *> or the number of sub-diagonals if UPLO = 'L'. KD >= 0.
69 *> AB is REAL array, dimension (LDAB,N)
70 *> On entry, the upper or lower triangle of the symmetric band
71 *> matrix A, stored in the first KD+1 rows of the array. The
72 *> j-th column of A is stored in the j-th column of the array AB
74 *> if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
75 *> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
77 *> On exit, if INFO = 0, the triangular factor U or L from the
78 *> Cholesky factorization A = U**T*U or A = L*L**T of the band
79 *> matrix A, in the same storage format as A.
85 *> The leading dimension of the array AB. LDAB >= KD+1.
90 *> S is REAL array, dimension (N)
91 *> The scale factors for A.
97 *> Ratio of the smallest S(i) to the largest S(i).
103 *> Absolute value of largest matrix entry.
108 *> EQUED is CHARACTER*1
109 *> Specifies whether or not equilibration was done.
110 *> = 'N': No equilibration.
111 *> = 'Y': Equilibration was done, i.e., A has been replaced by
112 *> diag(S) * A * diag(S).
115 *> \par Internal Parameters:
116 * =========================
119 *> THRESH is a threshold value used to decide if scaling should be done
120 *> based on the ratio of the scaling factors. If SCOND < THRESH,
123 *> LARGE and SMALL are threshold values used to decide if scaling should
124 *> be done based on the absolute size of the largest matrix element.
125 *> If AMAX > LARGE or AMAX < SMALL, scaling is done.
131 *> \author Univ. of Tennessee
132 *> \author Univ. of California Berkeley
133 *> \author Univ. of Colorado Denver
136 *> \date September 2012
138 *> \ingroup realOTHERauxiliary
140 * =====================================================================
141 SUBROUTINE SLAQSB( UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED )
143 * -- LAPACK auxiliary routine (version 3.4.2) --
144 * -- LAPACK is a software package provided by Univ. of Tennessee, --
145 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
148 * .. Scalar Arguments ..
149 CHARACTER EQUED, UPLO
153 * .. Array Arguments ..
154 REAL AB( LDAB, * ), S( * )
157 * =====================================================================
161 PARAMETER ( ONE = 1.0E+0, THRESH = 0.1E+0 )
163 * .. Local Scalars ..
165 REAL CJ, LARGE, SMALL
167 * .. External Functions ..
170 EXTERNAL LSAME, SLAMCH
172 * .. Intrinsic Functions ..
175 * .. Executable Statements ..
177 * Quick return if possible
184 * Initialize LARGE and SMALL.
186 SMALL = SLAMCH( 'Safe minimum' ) / SLAMCH( 'Precision' )
189 IF( SCOND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE ) THEN
196 * Replace A by diag(S) * A * diag(S).
198 IF( LSAME( UPLO, 'U' ) ) THEN
200 * Upper triangle of A is stored in band format.
204 DO 10 I = MAX( 1, J-KD ), J
205 AB( KD+1+I-J, J ) = CJ*S( I )*AB( KD+1+I-J, J )
210 * Lower triangle of A is stored.
214 DO 30 I = J, MIN( N, J+KD )
215 AB( 1+I-J, J ) = CJ*S( I )*AB( 1+I-J, J )