![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b DLAQGB 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download DLAQGB + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlaqgb.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlaqgb.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaqgb.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE DLAQGB( M, N, KL, KU, AB, LDAB, R, C, ROWCND, COLCND, 00022 * AMAX, EQUED ) 00023 * 00024 * .. Scalar Arguments .. 00025 * CHARACTER EQUED 00026 * INTEGER KL, KU, LDAB, M, N 00027 * DOUBLE PRECISION AMAX, COLCND, ROWCND 00028 * .. 00029 * .. Array Arguments .. 00030 * DOUBLE PRECISION AB( LDAB, * ), C( * ), R( * ) 00031 * .. 00032 * 00033 * 00034 *> \par Purpose: 00035 * ============= 00036 *> 00037 *> \verbatim 00038 *> 00039 *> DLAQGB equilibrates a general M by N band matrix A with KL 00040 *> subdiagonals and KU superdiagonals using the row and scaling factors 00041 *> in the vectors R and C. 00042 *> \endverbatim 00043 * 00044 * Arguments: 00045 * ========== 00046 * 00047 *> \param[in] M 00048 *> \verbatim 00049 *> M is INTEGER 00050 *> The number of rows of the matrix A. M >= 0. 00051 *> \endverbatim 00052 *> 00053 *> \param[in] N 00054 *> \verbatim 00055 *> N is INTEGER 00056 *> The number of columns of the matrix A. N >= 0. 00057 *> \endverbatim 00058 *> 00059 *> \param[in] KL 00060 *> \verbatim 00061 *> KL is INTEGER 00062 *> The number of subdiagonals within the band of A. KL >= 0. 00063 *> \endverbatim 00064 *> 00065 *> \param[in] KU 00066 *> \verbatim 00067 *> KU is INTEGER 00068 *> The number of superdiagonals within the band of A. KU >= 0. 00069 *> \endverbatim 00070 *> 00071 *> \param[in,out] AB 00072 *> \verbatim 00073 *> AB is DOUBLE PRECISION array, dimension (LDAB,N) 00074 *> On entry, the matrix A in band storage, in rows 1 to KL+KU+1. 00075 *> The j-th column of A is stored in the j-th column of the 00076 *> array AB as follows: 00077 *> AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl) 00078 *> 00079 *> On exit, the equilibrated matrix, in the same storage format 00080 *> as A. See EQUED for the form of the equilibrated matrix. 00081 *> \endverbatim 00082 *> 00083 *> \param[in] LDAB 00084 *> \verbatim 00085 *> LDAB is INTEGER 00086 *> The leading dimension of the array AB. LDA >= KL+KU+1. 00087 *> \endverbatim 00088 *> 00089 *> \param[in] R 00090 *> \verbatim 00091 *> R is DOUBLE PRECISION array, dimension (M) 00092 *> The row scale factors for A. 00093 *> \endverbatim 00094 *> 00095 *> \param[in] C 00096 *> \verbatim 00097 *> C is DOUBLE PRECISION array, dimension (N) 00098 *> The column scale factors for A. 00099 *> \endverbatim 00100 *> 00101 *> \param[in] ROWCND 00102 *> \verbatim 00103 *> ROWCND is DOUBLE PRECISION 00104 *> Ratio of the smallest R(i) to the largest R(i). 00105 *> \endverbatim 00106 *> 00107 *> \param[in] COLCND 00108 *> \verbatim 00109 *> COLCND is DOUBLE PRECISION 00110 *> Ratio of the smallest C(i) to the largest C(i). 00111 *> \endverbatim 00112 *> 00113 *> \param[in] AMAX 00114 *> \verbatim 00115 *> AMAX is DOUBLE PRECISION 00116 *> Absolute value of largest matrix entry. 00117 *> \endverbatim 00118 *> 00119 *> \param[out] EQUED 00120 *> \verbatim 00121 *> EQUED is CHARACTER*1 00122 *> Specifies the form of equilibration that was done. 00123 *> = 'N': No equilibration 00124 *> = 'R': Row equilibration, i.e., A has been premultiplied by 00125 *> diag(R). 00126 *> = 'C': Column equilibration, i.e., A has been postmultiplied 00127 *> by diag(C). 00128 *> = 'B': Both row and column equilibration, i.e., A has been 00129 *> replaced by diag(R) * A * diag(C). 00130 *> \endverbatim 00131 * 00132 *> \par Internal Parameters: 00133 * ========================= 00134 *> 00135 *> \verbatim 00136 *> THRESH is a threshold value used to decide if row or column scaling 00137 *> should be done based on the ratio of the row or column scaling 00138 *> factors. If ROWCND < THRESH, row scaling is done, and if 00139 *> COLCND < THRESH, column scaling is done. 00140 *> 00141 *> LARGE and SMALL are threshold values used to decide if row scaling 00142 *> should be done based on the absolute size of the largest matrix 00143 *> element. If AMAX > LARGE or AMAX < SMALL, row scaling is done. 00144 *> \endverbatim 00145 * 00146 * Authors: 00147 * ======== 00148 * 00149 *> \author Univ. of Tennessee 00150 *> \author Univ. of California Berkeley 00151 *> \author Univ. of Colorado Denver 00152 *> \author NAG Ltd. 00153 * 00154 *> \date November 2011 00155 * 00156 *> \ingroup doubleGBauxiliary 00157 * 00158 * ===================================================================== 00159 SUBROUTINE DLAQGB( M, N, KL, KU, AB, LDAB, R, C, ROWCND, COLCND, 00160 $ AMAX, EQUED ) 00161 * 00162 * -- LAPACK auxiliary routine (version 3.4.0) -- 00163 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00164 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00165 * November 2011 00166 * 00167 * .. Scalar Arguments .. 00168 CHARACTER EQUED 00169 INTEGER KL, KU, LDAB, M, N 00170 DOUBLE PRECISION AMAX, COLCND, ROWCND 00171 * .. 00172 * .. Array Arguments .. 00173 DOUBLE PRECISION AB( LDAB, * ), C( * ), R( * ) 00174 * .. 00175 * 00176 * ===================================================================== 00177 * 00178 * .. Parameters .. 00179 DOUBLE PRECISION ONE, THRESH 00180 PARAMETER ( ONE = 1.0D+0, THRESH = 0.1D+0 ) 00181 * .. 00182 * .. Local Scalars .. 00183 INTEGER I, J 00184 DOUBLE PRECISION CJ, LARGE, SMALL 00185 * .. 00186 * .. External Functions .. 00187 DOUBLE PRECISION DLAMCH 00188 EXTERNAL DLAMCH 00189 * .. 00190 * .. Intrinsic Functions .. 00191 INTRINSIC MAX, MIN 00192 * .. 00193 * .. Executable Statements .. 00194 * 00195 * Quick return if possible 00196 * 00197 IF( M.LE.0 .OR. N.LE.0 ) THEN 00198 EQUED = 'N' 00199 RETURN 00200 END IF 00201 * 00202 * Initialize LARGE and SMALL. 00203 * 00204 SMALL = DLAMCH( 'Safe minimum' ) / DLAMCH( 'Precision' ) 00205 LARGE = ONE / SMALL 00206 * 00207 IF( ROWCND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE ) 00208 $ THEN 00209 * 00210 * No row scaling 00211 * 00212 IF( COLCND.GE.THRESH ) THEN 00213 * 00214 * No column scaling 00215 * 00216 EQUED = 'N' 00217 ELSE 00218 * 00219 * Column scaling 00220 * 00221 DO 20 J = 1, N 00222 CJ = C( J ) 00223 DO 10 I = MAX( 1, J-KU ), MIN( M, J+KL ) 00224 AB( KU+1+I-J, J ) = CJ*AB( KU+1+I-J, J ) 00225 10 CONTINUE 00226 20 CONTINUE 00227 EQUED = 'C' 00228 END IF 00229 ELSE IF( COLCND.GE.THRESH ) THEN 00230 * 00231 * Row scaling, no column scaling 00232 * 00233 DO 40 J = 1, N 00234 DO 30 I = MAX( 1, J-KU ), MIN( M, J+KL ) 00235 AB( KU+1+I-J, J ) = R( I )*AB( KU+1+I-J, J ) 00236 30 CONTINUE 00237 40 CONTINUE 00238 EQUED = 'R' 00239 ELSE 00240 * 00241 * Row and column scaling 00242 * 00243 DO 60 J = 1, N 00244 CJ = C( J ) 00245 DO 50 I = MAX( 1, J-KU ), MIN( M, J+KL ) 00246 AB( KU+1+I-J, J ) = CJ*R( I )*AB( KU+1+I-J, J ) 00247 50 CONTINUE 00248 60 CONTINUE 00249 EQUED = 'B' 00250 END IF 00251 * 00252 RETURN 00253 * 00254 * End of DLAQGB 00255 * 00256 END