LAPACK 3.3.0

cla_rpvgrw.f

Go to the documentation of this file.
00001       REAL FUNCTION CLA_RPVGRW( N, NCOLS, A, LDA, AF, LDAF )
00002 *
00003 *     -- LAPACK routine (version 3.2.2)                                 --
00004 *     -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and --
00005 *     -- Jason Riedy of Univ. of California Berkeley.                 --
00006 *     -- June 2010                                                    --
00007 *
00008 *     -- LAPACK is a software package provided by Univ. of Tennessee, --
00009 *     -- Univ. of California Berkeley and NAG Ltd.                    --
00010 *
00011       IMPLICIT NONE
00012 *     ..
00013 *     .. Scalar Arguments ..
00014       INTEGER            N, NCOLS, LDA, LDAF
00015 *     ..
00016 *     .. Array Arguments ..
00017       COMPLEX            A( LDA, * ), AF( LDAF, * )
00018 *     ..
00019 *
00020 *  Purpose
00021 *  =======
00022 * 
00023 *  CLA_RPVGRW computes the reciprocal pivot growth factor
00024 *  norm(A)/norm(U). The "max absolute element" norm is used. If this is
00025 *  much less than 1, the stability of the LU factorization of the
00026 *  (equilibrated) matrix A could be poor. This also means that the
00027 *  solution X, estimated condition numbers, and error bounds could be
00028 *  unreliable.
00029 *
00030 *  Arguments
00031 *  =========
00032 *
00033 *     N       (input) INTEGER
00034 *     The number of linear equations, i.e., the order of the
00035 *     matrix A.  N >= 0.
00036 *
00037 *     NCOLS   (input) INTEGER
00038 *     The number of columns of the matrix A. NCOLS >= 0.
00039 *
00040 *     A       (input) COMPLEX array, dimension (LDA,N)
00041 *     On entry, the N-by-N matrix A.
00042 *
00043 *     LDA     (input) INTEGER
00044 *     The leading dimension of the array A.  LDA >= max(1,N).
00045 *
00046 *     AF      (input) COMPLEX array, dimension (LDAF,N)
00047 *     The factors L and U from the factorization
00048 *     A = P*L*U as computed by CGETRF.
00049 *
00050 *     LDAF    (input) INTEGER
00051 *     The leading dimension of the array AF.  LDAF >= max(1,N).
00052 *
00053 *  =====================================================================
00054 *
00055 *     .. Local Scalars ..
00056       INTEGER            I, J
00057       REAL               AMAX, UMAX, RPVGRW
00058       COMPLEX            ZDUM
00059 *     ..
00060 *     .. Intrinsic Functions ..
00061       INTRINSIC          MAX, MIN, ABS, REAL, AIMAG
00062 *     ..
00063 *     .. Statement Functions ..
00064       REAL               CABS1
00065 *     ..
00066 *     .. Statement Function Definitions ..
00067       CABS1( ZDUM ) = ABS( REAL( ZDUM ) ) + ABS( AIMAG( ZDUM ) )
00068 *     ..
00069 *     .. Executable Statements ..
00070 *
00071       RPVGRW = 1.0
00072 
00073       DO J = 1, NCOLS
00074          AMAX = 0.0
00075          UMAX = 0.0
00076          DO I = 1, N
00077             AMAX = MAX( CABS1( A( I, J ) ), AMAX )
00078          END DO
00079          DO I = 1, J
00080             UMAX = MAX( CABS1( AF( I, J ) ), UMAX )
00081          END DO
00082          IF ( UMAX /= 0.0 ) THEN
00083             RPVGRW = MIN( AMAX / UMAX, RPVGRW )
00084          END IF
00085       END DO
00086       CLA_RPVGRW = RPVGRW
00087       END
 All Files Functions