dla_gbrpvgrw.c
Go to the documentation of this file.
00001 /* dla_gbrpvgrw.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 doublereal dla_gbrpvgrw__(integer *n, integer *kl, integer *ku, integer *
00017         ncols, doublereal *ab, integer *ldab, doublereal *afb, integer *ldafb)
00018 {
00019     /* System generated locals */
00020     integer ab_dim1, ab_offset, afb_dim1, afb_offset, i__1, i__2, i__3, i__4;
00021     doublereal ret_val, d__1, d__2;
00022 
00023     /* Local variables */
00024     integer i__, j, kd;
00025     doublereal amax, umax, rpvgrw;
00026 
00027 
00028 /*     -- LAPACK routine (version 3.2.1)                                 -- */
00029 /*     -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- */
00030 /*     -- Jason Riedy of Univ. of California Berkeley.                 -- */
00031 /*     -- April 2009                                                   -- */
00032 
00033 /*     -- LAPACK is a software package provided by Univ. of Tennessee, -- */
00034 /*     -- Univ. of California Berkeley and NAG Ltd.                    -- */
00035 
00036 /*     .. */
00037 /*     .. Scalar Arguments .. */
00038 /*     .. */
00039 /*     .. Array Arguments .. */
00040 /*     .. */
00041 
00042 /*  Purpose */
00043 /*  ======= */
00044 
00045 /*  DLA_GBRPVGRW computes the reciprocal pivot growth factor */
00046 /*  norm(A)/norm(U). The "max absolute element" norm is used. If this is */
00047 /*  much less than 1, the stability of the LU factorization of the */
00048 /*  (equilibrated) matrix A could be poor. This also means that the */
00049 /*  solution X, estimated condition numbers, and error bounds could be */
00050 /*  unreliable. */
00051 
00052 /*  Arguments */
00053 /*  ========= */
00054 
00055 /*     N       (input) INTEGER */
00056 /*     The number of linear equations, i.e., the order of the */
00057 /*     matrix A.  N >= 0. */
00058 
00059 /*     KL      (input) INTEGER */
00060 /*     The number of subdiagonals within the band of A.  KL >= 0. */
00061 
00062 /*     KU      (input) INTEGER */
00063 /*     The number of superdiagonals within the band of A.  KU >= 0. */
00064 
00065 /*     NCOLS   (input) INTEGER */
00066 /*     The number of columns of the matrix A.  NCOLS >= 0. */
00067 
00068 /*     AB      (input) DOUBLE PRECISION array, dimension (LDAB,N) */
00069 /*     On entry, the matrix A in band storage, in rows 1 to KL+KU+1. */
00070 /*     The j-th column of A is stored in the j-th column of the */
00071 /*     array AB as follows: */
00072 /*     AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) */
00073 
00074 /*     LDAB    (input) INTEGER */
00075 /*     The leading dimension of the array AB.  LDAB >= KL+KU+1. */
00076 
00077 /*     AFB     (input) DOUBLE PRECISION array, dimension (LDAFB,N) */
00078 /*     Details of the LU factorization of the band matrix A, as */
00079 /*     computed by DGBTRF.  U is stored as an upper triangular */
00080 /*     band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, */
00081 /*     and the multipliers used during the factorization are stored */
00082 /*     in rows KL+KU+2 to 2*KL+KU+1. */
00083 
00084 /*     LDAFB   (input) INTEGER */
00085 /*     The leading dimension of the array AFB.  LDAFB >= 2*KL+KU+1. */
00086 
00087 /*  ===================================================================== */
00088 
00089 /*     .. Local Scalars .. */
00090 /*     .. */
00091 /*     .. Intrinsic Functions .. */
00092 /*     .. */
00093 /*     .. Executable Statements .. */
00094 
00095     /* Parameter adjustments */
00096     ab_dim1 = *ldab;
00097     ab_offset = 1 + ab_dim1;
00098     ab -= ab_offset;
00099     afb_dim1 = *ldafb;
00100     afb_offset = 1 + afb_dim1;
00101     afb -= afb_offset;
00102 
00103     /* Function Body */
00104     rpvgrw = 1.;
00105     kd = *ku + 1;
00106     i__1 = *ncols;
00107     for (j = 1; j <= i__1; ++j) {
00108         amax = 0.;
00109         umax = 0.;
00110 /* Computing MAX */
00111         i__2 = j - *ku;
00112 /* Computing MIN */
00113         i__4 = j + *kl;
00114         i__3 = min(i__4,*n);
00115         for (i__ = max(i__2,1); i__ <= i__3; ++i__) {
00116 /* Computing MAX */
00117             d__2 = (d__1 = ab[kd + i__ - j + j * ab_dim1], abs(d__1));
00118             amax = max(d__2,amax);
00119         }
00120 /* Computing MAX */
00121         i__3 = j - *ku;
00122         i__2 = j;
00123         for (i__ = max(i__3,1); i__ <= i__2; ++i__) {
00124 /* Computing MAX */
00125             d__2 = (d__1 = afb[kd + i__ - j + j * afb_dim1], abs(d__1));
00126             umax = max(d__2,umax);
00127         }
00128         if (umax != 0.) {
00129 /* Computing MIN */
00130             d__1 = amax / umax;
00131             rpvgrw = min(d__1,rpvgrw);
00132         }
00133     }
00134     ret_val = rpvgrw;
00135     return ret_val;
00136 } /* dla_gbrpvgrw__ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:45