dla_rpvgrw.c
Go to the documentation of this file.
00001 /* dla_rpvgrw.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_rpvgrw__(integer *n, integer *ncols, doublereal *a, integer *
00017         lda, doublereal *af, integer *ldaf)
00018 {
00019     /* System generated locals */
00020     integer a_dim1, a_offset, af_dim1, af_offset, i__1, i__2;
00021     doublereal ret_val, d__1, d__2;
00022 
00023     /* Local variables */
00024     integer i__, j;
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_RPVGRW 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 /*     NCOLS   (input) INTEGER */
00060 /*     The number of columns of the matrix A. NCOLS >= 0. */
00061 
00062 /*     A       (input) DOUBLE PRECISION array, dimension (LDA,N) */
00063 /*     On entry, the N-by-N matrix A. */
00064 
00065 /*     LDA     (input) INTEGER */
00066 /*     The leading dimension of the array A.  LDA >= max(1,N). */
00067 
00068 /*     AF      (input) DOUBLE PRECISION array, dimension (LDAF,N) */
00069 /*     The factors L and U from the factorization */
00070 /*     A = P*L*U as computed by DGETRF. */
00071 
00072 /*     LDAF    (input) INTEGER */
00073 /*     The leading dimension of the array AF.  LDAF >= max(1,N). */
00074 
00075 /*  ===================================================================== */
00076 
00077 /*     .. Local Scalars .. */
00078 /*     .. */
00079 /*     .. Intrinsic Functions .. */
00080 /*     .. */
00081 /*     .. Executable Statements .. */
00082 
00083     /* Parameter adjustments */
00084     a_dim1 = *lda;
00085     a_offset = 1 + a_dim1;
00086     a -= a_offset;
00087     af_dim1 = *ldaf;
00088     af_offset = 1 + af_dim1;
00089     af -= af_offset;
00090 
00091     /* Function Body */
00092     rpvgrw = 1.;
00093     i__1 = *ncols;
00094     for (j = 1; j <= i__1; ++j) {
00095         amax = 0.;
00096         umax = 0.;
00097         i__2 = *n;
00098         for (i__ = 1; i__ <= i__2; ++i__) {
00099 /* Computing MAX */
00100             d__2 = (d__1 = a[i__ + j * a_dim1], abs(d__1));
00101             amax = max(d__2,amax);
00102         }
00103         i__2 = j;
00104         for (i__ = 1; i__ <= i__2; ++i__) {
00105 /* Computing MAX */
00106             d__2 = (d__1 = af[i__ + j * af_dim1], abs(d__1));
00107             umax = max(d__2,umax);
00108         }
00109         if (umax != 0.) {
00110 /* Computing MIN */
00111             d__1 = amax / umax;
00112             rpvgrw = min(d__1,rpvgrw);
00113         }
00114     }
00115     ret_val = rpvgrw;
00116     return ret_val;
00117 } /* dla_rpvgrw__ */


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