00001 /* sla_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 sla_rpvgrw__(integer *n, integer *ncols, real *a, integer *lda, 00017 real *af, integer *ldaf) 00018 { 00019 /* System generated locals */ 00020 integer a_dim1, a_offset, af_dim1, af_offset, i__1, i__2; 00021 real ret_val, r__1, r__2; 00022 00023 /* Local variables */ 00024 integer i__, j; 00025 real 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 /* SLA_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) REAL 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) REAL array, dimension (LDAF,N) */ 00069 /* The factors L and U from the factorization */ 00070 /* A = P*L*U as computed by SGETRF. */ 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.f; 00093 i__1 = *ncols; 00094 for (j = 1; j <= i__1; ++j) { 00095 amax = 0.f; 00096 umax = 0.f; 00097 i__2 = *n; 00098 for (i__ = 1; i__ <= i__2; ++i__) { 00099 /* Computing MAX */ 00100 r__2 = (r__1 = a[i__ + j * a_dim1], dabs(r__1)); 00101 amax = dmax(r__2,amax); 00102 } 00103 i__2 = j; 00104 for (i__ = 1; i__ <= i__2; ++i__) { 00105 /* Computing MAX */ 00106 r__2 = (r__1 = af[i__ + j * af_dim1], dabs(r__1)); 00107 umax = dmax(r__2,umax); 00108 } 00109 if (umax != 0.f) { 00110 /* Computing MIN */ 00111 r__1 = amax / umax; 00112 rpvgrw = dmin(r__1,rpvgrw); 00113 } 00114 } 00115 ret_val = rpvgrw; 00116 return ret_val; 00117 } /* sla_rpvgrw__ */