LAPACK 3.3.0

sla_rpvgrw.f

Go to the documentation of this file.
00001       REAL FUNCTION SLA_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       REAL               A( LDA, * ), AF( LDAF, * )
00018 *     ..
00019 *
00020 *  Purpose
00021 *  =======
00022 *
00023 *  SLA_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) REAL 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) REAL array, dimension (LDAF,N)
00047 *     The factors L and U from the factorization
00048 *     A = P*L*U as computed by SGETRF.
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 *     ..
00059 *     .. Intrinsic Functions ..
00060       INTRINSIC          ABS, MAX, MIN
00061 *     ..
00062 *     .. Executable Statements ..
00063 *
00064       RPVGRW = 1.0
00065 
00066       DO J = 1, NCOLS
00067          AMAX = 0.0
00068          UMAX = 0.0
00069          DO I = 1, N
00070             AMAX = MAX( ABS( A( I, J ) ), AMAX )
00071          END DO
00072          DO I = 1, J
00073             UMAX = MAX( ABS( AF( I, J ) ), UMAX )
00074          END DO
00075          IF ( UMAX /= 0.0 ) THEN
00076             RPVGRW = MIN( AMAX / UMAX, RPVGRW )
00077          END IF
00078       END DO
00079       SLA_RPVGRW = RPVGRW
00080       END
 All Files Functions