cla_gbrpvgrw.c
Go to the documentation of this file.
00001 /* cla_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 cla_gbrpvgrw__(integer *n, integer *kl, integer *ku, integer *
00017         ncols, complex *ab, integer *ldab, complex *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     real ret_val, r__1, r__2, r__3;
00022 
00023     /* Builtin functions */
00024     double r_imag(complex *);
00025 
00026     /* Local variables */
00027     integer i__, j, kd;
00028     real amax, umax, rpvgrw;
00029 
00030 
00031 /*     -- LAPACK routine (version 3.2.1)                                 -- */
00032 /*     -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- */
00033 /*     -- Jason Riedy of Univ. of California Berkeley.                 -- */
00034 /*     -- April 2009                                                   -- */
00035 
00036 /*     -- LAPACK is a software package provided by Univ. of Tennessee, -- */
00037 /*     -- Univ. of California Berkeley and NAG Ltd.                    -- */
00038 
00039 /*     .. */
00040 /*     .. Scalar Arguments .. */
00041 /*     .. */
00042 /*     .. Array Arguments .. */
00043 /*     .. */
00044 
00045 /*  Purpose */
00046 /*  ======= */
00047 
00048 /*  CLA_GBRPVGRW computes the reciprocal pivot growth factor */
00049 /*  norm(A)/norm(U). The "max absolute element" norm is used. If this is */
00050 /*  much less than 1, the stability of the LU factorization of the */
00051 /*  (equilibrated) matrix A could be poor. This also means that the */
00052 /*  solution X, estimated condition numbers, and error bounds could be */
00053 /*  unreliable. */
00054 
00055 /*  Arguments */
00056 /*  ========= */
00057 
00058 /*     N       (input) INTEGER */
00059 /*     The number of linear equations, i.e., the order of the */
00060 /*     matrix A.  N >= 0. */
00061 
00062 /*     KL      (input) INTEGER */
00063 /*     The number of subdiagonals within the band of A.  KL >= 0. */
00064 
00065 /*     KU      (input) INTEGER */
00066 /*     The number of superdiagonals within the band of A.  KU >= 0. */
00067 
00068 /*     NCOLS   (input) INTEGER */
00069 /*     The number of columns of the matrix A.  NCOLS >= 0. */
00070 
00071 /*     AB      (input) COMPLEX array, dimension (LDAB,N) */
00072 /*     On entry, the matrix A in band storage, in rows 1 to KL+KU+1. */
00073 /*     The j-th column of A is stored in the j-th column of the */
00074 /*     array AB as follows: */
00075 /*     AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) */
00076 
00077 /*     LDAB    (input) INTEGER */
00078 /*     The leading dimension of the array AB.  LDAB >= KL+KU+1. */
00079 
00080 /*     AFB     (input) COMPLEX array, dimension (LDAFB,N) */
00081 /*     Details of the LU factorization of the band matrix A, as */
00082 /*     computed by CGBTRF.  U is stored as an upper triangular */
00083 /*     band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, */
00084 /*     and the multipliers used during the factorization are stored */
00085 /*     in rows KL+KU+2 to 2*KL+KU+1. */
00086 
00087 /*     LDAFB   (input) INTEGER */
00088 /*     The leading dimension of the array AFB.  LDAFB >= 2*KL+KU+1. */
00089 
00090 /*  ===================================================================== */
00091 
00092 /*     .. Local Scalars .. */
00093 /*     .. */
00094 /*     .. Intrinsic Functions .. */
00095 /*     .. */
00096 /*     .. Statement Functions .. */
00097 /*     .. */
00098 /*     .. Statement Function Definitions .. */
00099 /*     .. */
00100 /*     .. Executable Statements .. */
00101 
00102     /* Parameter adjustments */
00103     ab_dim1 = *ldab;
00104     ab_offset = 1 + ab_dim1;
00105     ab -= ab_offset;
00106     afb_dim1 = *ldafb;
00107     afb_offset = 1 + afb_dim1;
00108     afb -= afb_offset;
00109 
00110     /* Function Body */
00111     rpvgrw = 1.f;
00112     kd = *ku + 1;
00113     i__1 = *ncols;
00114     for (j = 1; j <= i__1; ++j) {
00115         amax = 0.f;
00116         umax = 0.f;
00117 /* Computing MAX */
00118         i__2 = j - *ku;
00119 /* Computing MIN */
00120         i__4 = j + *kl;
00121         i__3 = min(i__4,*n);
00122         for (i__ = max(i__2,1); i__ <= i__3; ++i__) {
00123 /* Computing MAX */
00124             i__2 = kd + i__ - j + j * ab_dim1;
00125             r__3 = (r__1 = ab[i__2].r, dabs(r__1)) + (r__2 = r_imag(&ab[kd + 
00126                     i__ - j + j * ab_dim1]), dabs(r__2));
00127             amax = dmax(r__3,amax);
00128         }
00129 /* Computing MAX */
00130         i__3 = j - *ku;
00131         i__2 = j;
00132         for (i__ = max(i__3,1); i__ <= i__2; ++i__) {
00133 /* Computing MAX */
00134             i__3 = kd + i__ - j + j * afb_dim1;
00135             r__3 = (r__1 = afb[i__3].r, dabs(r__1)) + (r__2 = r_imag(&afb[kd 
00136                     + i__ - j + j * afb_dim1]), dabs(r__2));
00137             umax = dmax(r__3,umax);
00138         }
00139         if (umax != 0.f) {
00140 /* Computing MIN */
00141             r__1 = amax / umax;
00142             rpvgrw = dmin(r__1,rpvgrw);
00143         }
00144     }
00145     ret_val = rpvgrw;
00146     return ret_val;
00147 } /* cla_gbrpvgrw__ */


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