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