![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CLAQSY 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download CLAQSY + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/claqsy.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/claqsy.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/claqsy.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE CLAQSY( 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 *> CLAQSY equilibrates a symmetric 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 *> symmetric 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 symmetric 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 complexSYauxiliary 00133 * 00134 * ===================================================================== 00135 SUBROUTINE CLAQSY( 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 * .. Executable Statements .. 00168 * 00169 * Quick return if possible 00170 * 00171 IF( N.LE.0 ) THEN 00172 EQUED = 'N' 00173 RETURN 00174 END IF 00175 * 00176 * Initialize LARGE and SMALL. 00177 * 00178 SMALL = SLAMCH( 'Safe minimum' ) / SLAMCH( 'Precision' ) 00179 LARGE = ONE / SMALL 00180 * 00181 IF( SCOND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE ) THEN 00182 * 00183 * No equilibration 00184 * 00185 EQUED = 'N' 00186 ELSE 00187 * 00188 * Replace A by diag(S) * A * diag(S). 00189 * 00190 IF( LSAME( UPLO, 'U' ) ) THEN 00191 * 00192 * Upper triangle of A is stored. 00193 * 00194 DO 20 J = 1, N 00195 CJ = S( J ) 00196 DO 10 I = 1, J 00197 A( I, J ) = CJ*S( I )*A( I, J ) 00198 10 CONTINUE 00199 20 CONTINUE 00200 ELSE 00201 * 00202 * Lower triangle of A is stored. 00203 * 00204 DO 40 J = 1, N 00205 CJ = S( J ) 00206 DO 30 I = J, N 00207 A( I, J ) = CJ*S( I )*A( I, J ) 00208 30 CONTINUE 00209 40 CONTINUE 00210 END IF 00211 EQUED = 'Y' 00212 END IF 00213 * 00214 RETURN 00215 * 00216 * End of CLAQSY 00217 * 00218 END