LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
zlaqgb.f
Go to the documentation of this file.
1*> \brief \b ZLAQGB scales a general band matrix, using row and column scaling factors computed by sgbequ.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZLAQGB + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlaqgb.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlaqgb.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlaqgb.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZLAQGB( M, N, KL, KU, AB, LDAB, R, C, ROWCND, COLCND,
20* AMAX, EQUED )
21*
22* .. Scalar Arguments ..
23* CHARACTER EQUED
24* INTEGER KL, KU, LDAB, M, N
25* DOUBLE PRECISION AMAX, COLCND, ROWCND
26* ..
27* .. Array Arguments ..
28* DOUBLE PRECISION C( * ), R( * )
29* COMPLEX*16 AB( LDAB, * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> ZLAQGB equilibrates a general M by N band matrix A with KL
39*> subdiagonals and KU superdiagonals using the row and scaling factors
40*> in the vectors R and C.
41*> \endverbatim
42*
43* Arguments:
44* ==========
45*
46*> \param[in] M
47*> \verbatim
48*> M is INTEGER
49*> The number of rows of the matrix A. M >= 0.
50*> \endverbatim
51*>
52*> \param[in] N
53*> \verbatim
54*> N is INTEGER
55*> The number of columns of the matrix A. N >= 0.
56*> \endverbatim
57*>
58*> \param[in] KL
59*> \verbatim
60*> KL is INTEGER
61*> The number of subdiagonals within the band of A. KL >= 0.
62*> \endverbatim
63*>
64*> \param[in] KU
65*> \verbatim
66*> KU is INTEGER
67*> The number of superdiagonals within the band of A. KU >= 0.
68*> \endverbatim
69*>
70*> \param[in,out] AB
71*> \verbatim
72*> AB is COMPLEX*16 array, dimension (LDAB,N)
73*> On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
74*> The j-th column of A is stored in the j-th column of the
75*> array AB as follows:
76*> AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl)
77*>
78*> On exit, the equilibrated matrix, in the same storage format
79*> as A. See EQUED for the form of the equilibrated matrix.
80*> \endverbatim
81*>
82*> \param[in] LDAB
83*> \verbatim
84*> LDAB is INTEGER
85*> The leading dimension of the array AB. LDA >= KL+KU+1.
86*> \endverbatim
87*>
88*> \param[in] R
89*> \verbatim
90*> R is DOUBLE PRECISION array, dimension (M)
91*> The row scale factors for A.
92*> \endverbatim
93*>
94*> \param[in] C
95*> \verbatim
96*> C is DOUBLE PRECISION array, dimension (N)
97*> The column scale factors for A.
98*> \endverbatim
99*>
100*> \param[in] ROWCND
101*> \verbatim
102*> ROWCND is DOUBLE PRECISION
103*> Ratio of the smallest R(i) to the largest R(i).
104*> \endverbatim
105*>
106*> \param[in] COLCND
107*> \verbatim
108*> COLCND is DOUBLE PRECISION
109*> Ratio of the smallest C(i) to the largest C(i).
110*> \endverbatim
111*>
112*> \param[in] AMAX
113*> \verbatim
114*> AMAX is DOUBLE PRECISION
115*> Absolute value of largest matrix entry.
116*> \endverbatim
117*>
118*> \param[out] EQUED
119*> \verbatim
120*> EQUED is CHARACTER*1
121*> Specifies the form of equilibration that was done.
122*> = 'N': No equilibration
123*> = 'R': Row equilibration, i.e., A has been premultiplied by
124*> diag(R).
125*> = 'C': Column equilibration, i.e., A has been postmultiplied
126*> by diag(C).
127*> = 'B': Both row and column equilibration, i.e., A has been
128*> replaced by diag(R) * A * diag(C).
129*> \endverbatim
130*
131*> \par Internal Parameters:
132* =========================
133*>
134*> \verbatim
135*> THRESH is a threshold value used to decide if row or column scaling
136*> should be done based on the ratio of the row or column scaling
137*> factors. If ROWCND < THRESH, row scaling is done, and if
138*> COLCND < THRESH, column scaling is done.
139*>
140*> LARGE and SMALL are threshold values used to decide if row scaling
141*> should be done based on the absolute size of the largest matrix
142*> element. If AMAX > LARGE or AMAX < SMALL, row scaling is done.
143*> \endverbatim
144*
145* Authors:
146* ========
147*
148*> \author Univ. of Tennessee
149*> \author Univ. of California Berkeley
150*> \author Univ. of Colorado Denver
151*> \author NAG Ltd.
152*
153*> \ingroup laqgb
154*
155* =====================================================================
156 SUBROUTINE zlaqgb( M, N, KL, KU, AB, LDAB, R, C, ROWCND,
157 $ COLCND,
158 $ AMAX, EQUED )
159*
160* -- LAPACK auxiliary routine --
161* -- LAPACK is a software package provided by Univ. of Tennessee, --
162* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
163*
164* .. Scalar Arguments ..
165 CHARACTER EQUED
166 INTEGER KL, KU, LDAB, M, N
167 DOUBLE PRECISION AMAX, COLCND, ROWCND
168* ..
169* .. Array Arguments ..
170 DOUBLE PRECISION C( * ), R( * )
171 COMPLEX*16 AB( LDAB, * )
172* ..
173*
174* =====================================================================
175*
176* .. Parameters ..
177 DOUBLE PRECISION ONE, THRESH
178 PARAMETER ( ONE = 1.0d+0, thresh = 0.1d+0 )
179* ..
180* .. Local Scalars ..
181 INTEGER I, J
182 DOUBLE PRECISION CJ, LARGE, SMALL
183* ..
184* .. External Functions ..
185 DOUBLE PRECISION DLAMCH
186 EXTERNAL DLAMCH
187* ..
188* .. Intrinsic Functions ..
189 INTRINSIC max, min
190* ..
191* .. Executable Statements ..
192*
193* Quick return if possible
194*
195 IF( m.LE.0 .OR. n.LE.0 ) THEN
196 equed = 'N'
197 RETURN
198 END IF
199*
200* Initialize LARGE and SMALL.
201*
202 small = dlamch( 'Safe minimum' ) / dlamch( 'Precision' )
203 large = one / small
204*
205 IF( rowcnd.GE.thresh .AND. amax.GE.small .AND. amax.LE.large )
206 $ THEN
207*
208* No row scaling
209*
210 IF( colcnd.GE.thresh ) THEN
211*
212* No column scaling
213*
214 equed = 'N'
215 ELSE
216*
217* Column scaling
218*
219 DO 20 j = 1, n
220 cj = c( j )
221 DO 10 i = max( 1, j-ku ), min( m, j+kl )
222 ab( ku+1+i-j, j ) = cj*ab( ku+1+i-j, j )
223 10 CONTINUE
224 20 CONTINUE
225 equed = 'C'
226 END IF
227 ELSE IF( colcnd.GE.thresh ) THEN
228*
229* Row scaling, no column scaling
230*
231 DO 40 j = 1, n
232 DO 30 i = max( 1, j-ku ), min( m, j+kl )
233 ab( ku+1+i-j, j ) = r( i )*ab( ku+1+i-j, j )
234 30 CONTINUE
235 40 CONTINUE
236 equed = 'R'
237 ELSE
238*
239* Row and column scaling
240*
241 DO 60 j = 1, n
242 cj = c( j )
243 DO 50 i = max( 1, j-ku ), min( m, j+kl )
244 ab( ku+1+i-j, j ) = cj*r( i )*ab( ku+1+i-j, j )
245 50 CONTINUE
246 60 CONTINUE
247 equed = 'B'
248 END IF
249*
250 RETURN
251*
252* End of ZLAQGB
253*
254 END
subroutine zlaqgb(m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, equed)
ZLAQGB scales a general band matrix, using row and column scaling factors computed by sgbequ.
Definition zlaqgb.f:159