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