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