LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
slaqsb.f
Go to the documentation of this file.
1*> \brief \b SLAQSB scales a symmetric/Hermitian band matrix, using scaling factors computed by spbequ.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download SLAQSB + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slaqsb.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slaqsb.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slaqsb.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE SLAQSB( UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED )
20*
21* .. Scalar Arguments ..
22* CHARACTER EQUED, UPLO
23* INTEGER KD, LDAB, N
24* REAL AMAX, SCOND
25* ..
26* .. Array Arguments ..
27* REAL AB( LDAB, * ), S( * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> SLAQSB equilibrates a symmetric band matrix A using the scaling
37*> factors in the vector S.
38*> \endverbatim
39*
40* Arguments:
41* ==========
42*
43*> \param[in] UPLO
44*> \verbatim
45*> UPLO is CHARACTER*1
46*> Specifies whether the upper or lower triangular part of the
47*> symmetric matrix A is stored.
48*> = 'U': Upper triangular
49*> = 'L': Lower triangular
50*> \endverbatim
51*>
52*> \param[in] N
53*> \verbatim
54*> N is INTEGER
55*> The order of the matrix A. N >= 0.
56*> \endverbatim
57*>
58*> \param[in] KD
59*> \verbatim
60*> KD is INTEGER
61*> The number of super-diagonals of the matrix A if UPLO = 'U',
62*> or the number of sub-diagonals if UPLO = 'L'. KD >= 0.
63*> \endverbatim
64*>
65*> \param[in,out] AB
66*> \verbatim
67*> AB is REAL array, dimension (LDAB,N)
68*> On entry, the upper or lower triangle of the symmetric band
69*> matrix A, stored in the first KD+1 rows of the array. The
70*> j-th column of A is stored in the j-th column of the array AB
71*> as follows:
72*> if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
73*> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
74*>
75*> On exit, if INFO = 0, the triangular factor U or L from the
76*> Cholesky factorization A = U**T*U or A = L*L**T of the band
77*> matrix A, in the same storage format as A.
78*> \endverbatim
79*>
80*> \param[in] LDAB
81*> \verbatim
82*> LDAB is INTEGER
83*> The leading dimension of the array AB. LDAB >= KD+1.
84*> \endverbatim
85*>
86*> \param[in] S
87*> \verbatim
88*> S is REAL array, dimension (N)
89*> The scale factors for A.
90*> \endverbatim
91*>
92*> \param[in] SCOND
93*> \verbatim
94*> SCOND is REAL
95*> Ratio of the smallest S(i) to the largest S(i).
96*> \endverbatim
97*>
98*> \param[in] AMAX
99*> \verbatim
100*> AMAX is REAL
101*> Absolute value of largest matrix entry.
102*> \endverbatim
103*>
104*> \param[out] EQUED
105*> \verbatim
106*> EQUED is CHARACTER*1
107*> Specifies whether or not equilibration was done.
108*> = 'N': No equilibration.
109*> = 'Y': Equilibration was done, i.e., A has been replaced by
110*> diag(S) * A * diag(S).
111*> \endverbatim
112*
113*> \par Internal Parameters:
114* =========================
115*>
116*> \verbatim
117*> THRESH is a threshold value used to decide if scaling should be done
118*> based on the ratio of the scaling factors. If SCOND < THRESH,
119*> scaling is done.
120*>
121*> LARGE and SMALL are threshold values used to decide if scaling should
122*> be done based on the absolute size of the largest matrix element.
123*> If AMAX > LARGE or AMAX < SMALL, scaling is done.
124*> \endverbatim
125*
126* Authors:
127* ========
128*
129*> \author Univ. of Tennessee
130*> \author Univ. of California Berkeley
131*> \author Univ. of Colorado Denver
132*> \author NAG Ltd.
133*
134*> \ingroup laqhb
135*
136* =====================================================================
137 SUBROUTINE slaqsb( UPLO, N, KD, AB, LDAB, S, SCOND, AMAX,
138 $ EQUED )
139*
140* -- LAPACK auxiliary routine --
141* -- LAPACK is a software package provided by Univ. of Tennessee, --
142* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
143*
144* .. Scalar Arguments ..
145 CHARACTER EQUED, UPLO
146 INTEGER KD, LDAB, N
147 REAL AMAX, SCOND
148* ..
149* .. Array Arguments ..
150 REAL AB( LDAB, * ), S( * )
151* ..
152*
153* =====================================================================
154*
155* .. Parameters ..
156 REAL ONE, THRESH
157 parameter( one = 1.0e+0, thresh = 0.1e+0 )
158* ..
159* .. Local Scalars ..
160 INTEGER I, J
161 REAL CJ, LARGE, SMALL
162* ..
163* .. External Functions ..
164 LOGICAL LSAME
165 REAL SLAMCH
166 EXTERNAL lsame, slamch
167* ..
168* .. Intrinsic Functions ..
169 INTRINSIC max, min
170* ..
171* .. Executable Statements ..
172*
173* Quick return if possible
174*
175 IF( n.LE.0 ) THEN
176 equed = 'N'
177 RETURN
178 END IF
179*
180* Initialize LARGE and SMALL.
181*
182 small = slamch( 'Safe minimum' ) / slamch( 'Precision' )
183 large = one / small
184*
185 IF( scond.GE.thresh .AND. amax.GE.small .AND. amax.LE.large ) THEN
186*
187* No equilibration
188*
189 equed = 'N'
190 ELSE
191*
192* Replace A by diag(S) * A * diag(S).
193*
194 IF( lsame( uplo, 'U' ) ) THEN
195*
196* Upper triangle of A is stored in band format.
197*
198 DO 20 j = 1, n
199 cj = s( j )
200 DO 10 i = max( 1, j-kd ), j
201 ab( kd+1+i-j, j ) = cj*s( i )*ab( kd+1+i-j, j )
202 10 CONTINUE
203 20 CONTINUE
204 ELSE
205*
206* Lower triangle of A is stored.
207*
208 DO 40 j = 1, n
209 cj = s( j )
210 DO 30 i = j, min( n, j+kd )
211 ab( 1+i-j, j ) = cj*s( i )*ab( 1+i-j, j )
212 30 CONTINUE
213 40 CONTINUE
214 END IF
215 equed = 'Y'
216 END IF
217*
218 RETURN
219*
220* End of SLAQSB
221*
222 END
subroutine slaqsb(uplo, n, kd, ab, ldab, s, scond, amax, equed)
SLAQSB scales a symmetric/Hermitian band matrix, using scaling factors computed by spbequ.
Definition slaqsb.f:139