LAPACK 3.3.0

dla_porpvgrw.f

Go to the documentation of this file.
00001       DOUBLE PRECISION FUNCTION DLA_PORPVGRW( UPLO, NCOLS, A, LDA, AF, 
00002      $                                        LDAF, WORK )
00003 *
00004 *     -- LAPACK routine (version 3.2.2)                                 --
00005 *     -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and --
00006 *     -- Jason Riedy of Univ. of California Berkeley.                 --
00007 *     -- June 2010                                                    --
00008 *
00009 *     -- LAPACK is a software package provided by Univ. of Tennessee, --
00010 *     -- Univ. of California Berkeley and NAG Ltd.                    --
00011 *
00012       IMPLICIT NONE
00013 *     ..
00014 *     .. Scalar Arguments ..
00015       CHARACTER*1        UPLO
00016       INTEGER            NCOLS, LDA, LDAF
00017 *     ..
00018 *     .. Array Arguments ..
00019       DOUBLE PRECISION   A( LDA, * ), AF( LDAF, * ), WORK( * )
00020 *     ..
00021 *
00022 *  Purpose
00023 *  =======
00024 * 
00025 *  DLA_PORPVGRW computes the reciprocal pivot growth factor
00026 *  norm(A)/norm(U). The "max absolute element" norm is used. If this is
00027 *  much less than 1, the stability of the LU factorization of the
00028 *  (equilibrated) matrix A could be poor. This also means that the
00029 *  solution X, estimated condition numbers, and error bounds could be
00030 *  unreliable.
00031 *
00032 *  Arguments
00033 *  =========
00034 *
00035 *     UPLO    (input) CHARACTER*1
00036 *       = 'U':  Upper triangle of A is stored;
00037 *       = 'L':  Lower triangle of A is stored.
00038 *
00039 *     NCOLS   (input) INTEGER
00040 *     The number of columns of the matrix A. NCOLS >= 0.
00041 *
00042 *     A       (input) DOUBLE PRECISION array, dimension (LDA,N)
00043 *     On entry, the N-by-N matrix A.
00044 *
00045 *     LDA     (input) INTEGER
00046 *     The leading dimension of the array A.  LDA >= max(1,N).
00047 *
00048 *     AF      (input) DOUBLE PRECISION array, dimension (LDAF,N)
00049 *     The triangular factor U or L from the Cholesky factorization
00050 *     A = U**T*U or A = L*L**T, as computed by DPOTRF.
00051 *
00052 *     LDAF    (input) INTEGER
00053 *     The leading dimension of the array AF.  LDAF >= max(1,N).
00054 *
00055 *     WORK    (input) DOUBLE PRECISION array, dimension (2*N)
00056 *
00057 *  =====================================================================
00058 *
00059 *     .. Local Scalars ..
00060       INTEGER            I, J
00061       DOUBLE PRECISION   AMAX, UMAX, RPVGRW
00062       LOGICAL            UPPER
00063 *     ..
00064 *     .. Intrinsic Functions ..
00065       INTRINSIC          ABS, MAX, MIN
00066 *     ..
00067 *     .. External Functions ..
00068       EXTERNAL           LSAME, DLASET
00069       LOGICAL            LSAME
00070 *     ..
00071 *     .. Executable Statements ..
00072 *
00073       UPPER = LSAME( 'Upper', UPLO )
00074 *
00075 *     DPOTRF will have factored only the NCOLSxNCOLS leading minor, so
00076 *     we restrict the growth search to that minor and use only the first
00077 *     2*NCOLS workspace entries.
00078 *
00079       RPVGRW = 1.0D+0
00080       DO I = 1, 2*NCOLS
00081          WORK( I ) = 0.0D+0
00082       END DO
00083 *
00084 *     Find the max magnitude entry of each column.
00085 *
00086       IF ( UPPER ) THEN
00087          DO J = 1, NCOLS
00088             DO I = 1, J
00089                WORK( NCOLS+J ) =
00090      $              MAX( ABS( A( I, J ) ), WORK( NCOLS+J ) )
00091             END DO
00092          END DO
00093       ELSE
00094          DO J = 1, NCOLS
00095             DO I = J, NCOLS
00096                WORK( NCOLS+J ) =
00097      $              MAX( ABS( A( I, J ) ), WORK( NCOLS+J ) )
00098             END DO
00099          END DO
00100       END IF
00101 *
00102 *     Now find the max magnitude entry of each column of the factor in
00103 *     AF.  No pivoting, so no permutations.
00104 *
00105       IF ( LSAME( 'Upper', UPLO ) ) THEN
00106          DO J = 1, NCOLS
00107             DO I = 1, J
00108                WORK( J ) = MAX( ABS( AF( I, J ) ), WORK( J ) )
00109             END DO
00110          END DO
00111       ELSE
00112          DO J = 1, NCOLS
00113             DO I = J, NCOLS
00114                WORK( J ) = MAX( ABS( AF( I, J ) ), WORK( J ) )
00115             END DO
00116          END DO
00117       END IF
00118 *
00119 *     Compute the *inverse* of the max element growth factor.  Dividing
00120 *     by zero would imply the largest entry of the factor's column is
00121 *     zero.  Than can happen when either the column of A is zero or
00122 *     massive pivots made the factor underflow to zero.  Neither counts
00123 *     as growth in itself, so simply ignore terms with zero
00124 *     denominators.
00125 *
00126       IF ( LSAME( 'Upper', UPLO ) ) THEN
00127          DO I = 1, NCOLS
00128             UMAX = WORK( I )
00129             AMAX = WORK( NCOLS+I )
00130             IF ( UMAX /= 0.0D+0 ) THEN
00131                RPVGRW = MIN( AMAX / UMAX, RPVGRW )
00132             END IF
00133          END DO
00134       ELSE
00135          DO I = 1, NCOLS
00136             UMAX = WORK( I )
00137             AMAX = WORK( NCOLS+I )
00138             IF ( UMAX /= 0.0D+0 ) THEN
00139                RPVGRW = MIN( AMAX / UMAX, RPVGRW )
00140             END IF
00141          END DO
00142       END IF
00143 
00144       DLA_PORPVGRW = RPVGRW
00145       END
 All Files Functions