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