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