LAPACK 3.3.1 Linear Algebra PACKage

# sla_gbrpvgrw.f

Go to the documentation of this file.
```00001       REAL FUNCTION SLA_GBRPVGRW( N, KL, KU, NCOLS, AB, LDAB, AFB,
00002      \$                            LDAFB )
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       INTEGER            N, KL, KU, NCOLS, LDAB, LDAFB
00016 *     ..
00017 *     .. Array Arguments ..
00018       REAL               AB( LDAB, * ), AFB( LDAFB, * )
00019 *     ..
00020 *
00021 *  Purpose
00022 *  =======
00023 *
00024 *  SLA_GBRPVGRW computes the reciprocal pivot growth factor
00025 *  norm(A)/norm(U). The "max absolute element" norm is used. If this is
00026 *  much less than 1, the stability of the LU factorization of the
00027 *  (equilibrated) matrix A could be poor. This also means that the
00028 *  solution X, estimated condition numbers, and error bounds could be
00029 *  unreliable.
00030 *
00031 *  Arguments
00032 *  =========
00033 *
00034 *     N       (input) INTEGER
00035 *     The number of linear equations, i.e., the order of the
00036 *     matrix A.  N >= 0.
00037 *
00038 *     KL      (input) INTEGER
00039 *     The number of subdiagonals within the band of A.  KL >= 0.
00040 *
00041 *     KU      (input) INTEGER
00042 *     The number of superdiagonals within the band of A.  KU >= 0.
00043 *
00044 *     NCOLS   (input) INTEGER
00045 *     The number of columns of the matrix A.  NCOLS >= 0.
00046 *
00047 *     AB      (input) REAL array, dimension (LDAB,N)
00048 *     On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
00049 *     The j-th column of A is stored in the j-th column of the
00050 *     array AB as follows:
00051 *     AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
00052 *
00053 *     LDAB    (input) INTEGER
00054 *     The leading dimension of the array AB.  LDAB >= KL+KU+1.
00055 *
00056 *     AFB     (input) REAL array, dimension (LDAFB,N)
00057 *     Details of the LU factorization of the band matrix A, as
00058 *     computed by SGBTRF.  U is stored as an upper triangular
00059 *     band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1,
00060 *     and the multipliers used during the factorization are stored
00061 *     in rows KL+KU+2 to 2*KL+KU+1.
00062 *
00063 *     LDAFB   (input) INTEGER
00064 *     The leading dimension of the array AFB.  LDAFB >= 2*KL+KU+1.
00065 *
00066 *  =====================================================================
00067 *
00068 *     .. Local Scalars ..
00069       INTEGER            I, J, KD
00070       REAL               AMAX, UMAX, RPVGRW
00071 *     ..
00072 *     .. Intrinsic Functions ..
00073       INTRINSIC          ABS, MAX, MIN
00074 *     ..
00075 *     .. Executable Statements ..
00076 *
00077       RPVGRW = 1.0
00078
00079       KD = KU + 1
00080       DO J = 1, NCOLS
00081          AMAX = 0.0
00082          UMAX = 0.0
00083          DO I = MAX( J-KU, 1 ), MIN( J+KL, N )
00084             AMAX = MAX( ABS( AB( KD+I-J, J)), AMAX )
00085          END DO
00086          DO I = MAX( J-KU, 1 ), J
00087             UMAX = MAX( ABS( AFB( KD+I-J, J ) ), UMAX )
00088          END DO
00089          IF ( UMAX /= 0.0 ) THEN
00090             RPVGRW = MIN( AMAX / UMAX, RPVGRW )
00091          END IF
00092       END DO
00093       SLA_GBRPVGRW = RPVGRW
00094       END
```