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