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