![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CLA_PORPVGRW 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download CLA_PORPVGRW + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cla_porpvgrw.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cla_porpvgrw.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cla_porpvgrw.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * REAL FUNCTION CLA_PORPVGRW( UPLO, NCOLS, A, LDA, AF, LDAF, WORK ) 00022 * 00023 * .. Scalar Arguments .. 00024 * CHARACTER*1 UPLO 00025 * INTEGER NCOLS, LDA, LDAF 00026 * .. 00027 * .. Array Arguments .. 00028 * COMPLEX A( LDA, * ), AF( LDAF, * ) 00029 * REAL WORK( * ) 00030 * .. 00031 * 00032 * 00033 *> \par Purpose: 00034 * ============= 00035 *> 00036 *> \verbatim 00037 *> 00038 *> 00039 *> CLA_PORPVGRW computes the reciprocal pivot growth factor 00040 *> norm(A)/norm(U). The "max absolute element" norm is used. If this is 00041 *> much less than 1, the stability of the LU factorization of the 00042 *> (equilibrated) matrix A could be poor. This also means that the 00043 *> solution X, estimated condition numbers, and error bounds could be 00044 *> unreliable. 00045 *> \endverbatim 00046 * 00047 * Arguments: 00048 * ========== 00049 * 00050 *> \param[in] UPLO 00051 *> \verbatim 00052 *> UPLO is CHARACTER*1 00053 *> = 'U': Upper triangle of A is stored; 00054 *> = 'L': Lower triangle of A is stored. 00055 *> \endverbatim 00056 *> 00057 *> \param[in] NCOLS 00058 *> \verbatim 00059 *> NCOLS is INTEGER 00060 *> The number of columns of the matrix A. NCOLS >= 0. 00061 *> \endverbatim 00062 *> 00063 *> \param[in] A 00064 *> \verbatim 00065 *> A is COMPLEX array, dimension (LDA,N) 00066 *> On entry, the N-by-N matrix A. 00067 *> \endverbatim 00068 *> 00069 *> \param[in] LDA 00070 *> \verbatim 00071 *> LDA is INTEGER 00072 *> The leading dimension of the array A. LDA >= max(1,N). 00073 *> \endverbatim 00074 *> 00075 *> \param[in] AF 00076 *> \verbatim 00077 *> AF is COMPLEX array, dimension (LDAF,N) 00078 *> The triangular factor U or L from the Cholesky factorization 00079 *> A = U**T*U or A = L*L**T, as computed by CPOTRF. 00080 *> \endverbatim 00081 *> 00082 *> \param[in] LDAF 00083 *> \verbatim 00084 *> LDAF is INTEGER 00085 *> The leading dimension of the array AF. LDAF >= max(1,N). 00086 *> \endverbatim 00087 *> 00088 *> \param[in] WORK 00089 *> \verbatim 00090 *> WORK is COMPLEX array, dimension (2*N) 00091 *> \endverbatim 00092 * 00093 * Authors: 00094 * ======== 00095 * 00096 *> \author Univ. of Tennessee 00097 *> \author Univ. of California Berkeley 00098 *> \author Univ. of Colorado Denver 00099 *> \author NAG Ltd. 00100 * 00101 *> \date November 2011 00102 * 00103 *> \ingroup complexPOcomputational 00104 * 00105 * ===================================================================== 00106 REAL FUNCTION CLA_PORPVGRW( UPLO, NCOLS, A, LDA, AF, LDAF, WORK ) 00107 * 00108 * -- LAPACK computational routine (version 3.4.0) -- 00109 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00110 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00111 * November 2011 00112 * 00113 * .. Scalar Arguments .. 00114 CHARACTER*1 UPLO 00115 INTEGER NCOLS, LDA, LDAF 00116 * .. 00117 * .. Array Arguments .. 00118 COMPLEX A( LDA, * ), AF( LDAF, * ) 00119 REAL WORK( * ) 00120 * .. 00121 * 00122 * ===================================================================== 00123 * 00124 * .. Local Scalars .. 00125 INTEGER I, J 00126 REAL AMAX, UMAX, RPVGRW 00127 LOGICAL UPPER 00128 COMPLEX ZDUM 00129 * .. 00130 * .. External Functions .. 00131 EXTERNAL LSAME, CLASET 00132 LOGICAL LSAME 00133 * .. 00134 * .. Intrinsic Functions .. 00135 INTRINSIC ABS, MAX, MIN, REAL, AIMAG 00136 * .. 00137 * .. Statement Functions .. 00138 REAL CABS1 00139 * .. 00140 * .. Statement Function Definitions .. 00141 CABS1( ZDUM ) = ABS( REAL( ZDUM ) ) + ABS( AIMAG( ZDUM ) ) 00142 * .. 00143 * .. Executable Statements .. 00144 UPPER = LSAME( 'Upper', UPLO ) 00145 * 00146 * SPOTRF will have factored only the NCOLSxNCOLS leading minor, so 00147 * we restrict the growth search to that minor and use only the first 00148 * 2*NCOLS workspace entries. 00149 * 00150 RPVGRW = 1.0 00151 DO I = 1, 2*NCOLS 00152 WORK( I ) = 0.0 00153 END DO 00154 * 00155 * Find the max magnitude entry of each column. 00156 * 00157 IF ( UPPER ) THEN 00158 DO J = 1, NCOLS 00159 DO I = 1, J 00160 WORK( NCOLS+J ) = 00161 $ MAX( CABS1( A( I, J ) ), WORK( NCOLS+J ) ) 00162 END DO 00163 END DO 00164 ELSE 00165 DO J = 1, NCOLS 00166 DO I = J, NCOLS 00167 WORK( NCOLS+J ) = 00168 $ MAX( CABS1( A( I, J ) ), WORK( NCOLS+J ) ) 00169 END DO 00170 END DO 00171 END IF 00172 * 00173 * Now find the max magnitude entry of each column of the factor in 00174 * AF. No pivoting, so no permutations. 00175 * 00176 IF ( LSAME( 'Upper', UPLO ) ) THEN 00177 DO J = 1, NCOLS 00178 DO I = 1, J 00179 WORK( J ) = MAX( CABS1( AF( I, J ) ), WORK( J ) ) 00180 END DO 00181 END DO 00182 ELSE 00183 DO J = 1, NCOLS 00184 DO I = J, NCOLS 00185 WORK( J ) = MAX( CABS1( AF( I, J ) ), WORK( J ) ) 00186 END DO 00187 END DO 00188 END IF 00189 * 00190 * Compute the *inverse* of the max element growth factor. Dividing 00191 * by zero would imply the largest entry of the factor's column is 00192 * zero. Than can happen when either the column of A is zero or 00193 * massive pivots made the factor underflow to zero. Neither counts 00194 * as growth in itself, so simply ignore terms with zero 00195 * denominators. 00196 * 00197 IF ( LSAME( 'Upper', UPLO ) ) THEN 00198 DO I = 1, NCOLS 00199 UMAX = WORK( I ) 00200 AMAX = WORK( NCOLS+I ) 00201 IF ( UMAX /= 0.0 ) THEN 00202 RPVGRW = MIN( AMAX / UMAX, RPVGRW ) 00203 END IF 00204 END DO 00205 ELSE 00206 DO I = 1, NCOLS 00207 UMAX = WORK( I ) 00208 AMAX = WORK( NCOLS+I ) 00209 IF ( UMAX /= 0.0 ) THEN 00210 RPVGRW = MIN( AMAX / UMAX, RPVGRW ) 00211 END IF 00212 END DO 00213 END IF 00214 00215 CLA_PORPVGRW = RPVGRW 00216 END