1 /* ../netlib/zla_gerpvgrw.f -- translated by f2c (version 20100827). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib;
2  on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */
3 #include "FLA_f2c.h" /* > \brief \b ZLA_GERPVGRW multiplies a square real matrix by a complex matrix. */
4 /* =========== DOCUMENTATION =========== */
5 /* Online html documentation available at */
6 /* http://www.netlib.org/lapack/explore-html/ */
7 /* > \htmlonly */
8 /* > Download ZLA_GERPVGRW + dependencies */
9 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_ger pvgrw.f"> */
10 /* > [TGZ]</a> */
11 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_ger pvgrw.f"> */
12 /* > [ZIP]</a> */
13 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_ger pvgrw.f"> */
14 /* > [TXT]</a> */
15 /* > \endhtmlonly */
16 /* Definition: */
17 /* =========== */
18 /* DOUBLE PRECISION FUNCTION ZLA_GERPVGRW( N, NCOLS, A, LDA, AF, */
19 /* LDAF ) */
20 /* .. Scalar Arguments .. */
21 /* INTEGER N, NCOLS, LDA, LDAF */
22 /* .. */
23 /* .. Array Arguments .. */
24 /* COMPLEX*16 A( LDA, * ), AF( LDAF, * ) */
25 /* .. */
26 /* > \par Purpose: */
27 /* ============= */
28 /* > */
29 /* > \verbatim */
30 /* > */
31 /* > */
32 /* > ZLA_GERPVGRW computes the reciprocal pivot growth factor */
33 /* > norm(A)/norm(U). The "max absolute element" norm is used. If this is */
34 /* > much less than 1, the stability of the LU factorization of the */
35 /* > (equilibrated) matrix A could be poor. This also means that the */
36 /* > solution X, estimated condition numbers, and error bounds could be */
37 /* > unreliable. */
38 /* > \endverbatim */
39 /* Arguments: */
40 /* ========== */
41 /* > \param[in] N */
42 /* > \verbatim */
43 /* > N is INTEGER */
44 /* > The number of linear equations, i.e., the order of the */
45 /* > matrix A. N >= 0. */
46 /* > \endverbatim */
47 /* > */
48 /* > \param[in] NCOLS */
49 /* > \verbatim */
50 /* > NCOLS is INTEGER */
51 /* > The number of columns of the matrix A. NCOLS >= 0. */
52 /* > \endverbatim */
53 /* > */
54 /* > \param[in] A */
55 /* > \verbatim */
56 /* > A is DOUBLE PRECISION array, dimension (LDA,N) */
57 /* > On entry, the N-by-N matrix A. */
58 /* > \endverbatim */
59 /* > */
60 /* > \param[in] LDA */
61 /* > \verbatim */
62 /* > LDA is INTEGER */
63 /* > The leading dimension of the array A. LDA >= max(1,N). */
64 /* > \endverbatim */
65 /* > */
66 /* > \param[in] AF */
67 /* > \verbatim */
68 /* > AF is DOUBLE PRECISION array, dimension (LDAF,N) */
69 /* > The factors L and U from the factorization */
70 /* > A = P*L*U as computed by ZGETRF. */
71 /* > \endverbatim */
72 /* > */
73 /* > \param[in] LDAF */
74 /* > \verbatim */
75 /* > LDAF is INTEGER */
76 /* > The leading dimension of the array AF. LDAF >= max(1,N). */
77 /* > \endverbatim */
78 /* Authors: */
79 /* ======== */
80 /* > \author Univ. of Tennessee */
81 /* > \author Univ. of California Berkeley */
82 /* > \author Univ. of Colorado Denver */
83 /* > \author NAG Ltd. */
84 /* > \date September 2012 */
85 /* > \ingroup complex16GEcomputational */
86 /* ===================================================================== */
zla_gerpvgrw_(integer * n,integer * ncols,doublecomplex * a,integer * lda,doublecomplex * af,integer * ldaf)87 doublereal zla_gerpvgrw_(integer *n, integer *ncols, doublecomplex *a, integer *lda, doublecomplex *af, integer *ldaf)
88 {
89     /* System generated locals */
90     integer a_dim1, a_offset, af_dim1, af_offset, i__1, i__2, i__3;
91     doublereal ret_val, d__1, d__2, d__3;
92     /* Builtin functions */
93     double d_imag(doublecomplex *);
94     /* Local variables */
95     integer i__, j;
96     doublereal amax, umax, rpvgrw;
97     /* -- LAPACK computational routine (version 3.4.2) -- */
98     /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
99     /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
100     /* September 2012 */
101     /* .. Scalar Arguments .. */
102     /* .. */
103     /* .. Array Arguments .. */
104     /* .. */
105     /* ===================================================================== */
106     /* .. Local Scalars .. */
107     /* .. */
108     /* .. Intrinsic Functions .. */
109     /* .. */
110     /* .. Statement Functions .. */
111     /* .. */
112     /* .. Statement Function Definitions .. */
113     /* .. */
114     /* .. Executable Statements .. */
115     /* Parameter adjustments */
116     a_dim1 = *lda;
117     a_offset = 1 + a_dim1;
118     a -= a_offset;
119     af_dim1 = *ldaf;
120     af_offset = 1 + af_dim1;
121     af -= af_offset;
122     /* Function Body */
123     rpvgrw = 1.;
124     i__1 = *ncols;
125     for (j = 1;
126             j <= i__1;
127             ++j)
128     {
129         amax = 0.;
130         umax = 0.;
131         i__2 = *n;
132         for (i__ = 1;
133                 i__ <= i__2;
134                 ++i__)
135         {
136             /* Computing MAX */
137             i__3 = i__ + j * a_dim1;
138             d__3 = (d__1 = a[i__3].r, f2c_abs(d__1)) + (d__2 = d_imag(&a[i__ + j * a_dim1]), f2c_abs(d__2));
139             amax = max(d__3,amax);
140         }
141         i__2 = j;
142         for (i__ = 1;
143                 i__ <= i__2;
144                 ++i__)
145         {
146             /* Computing MAX */
147             i__3 = i__ + j * af_dim1;
148             d__3 = (d__1 = af[i__3].r, f2c_abs(d__1)) + (d__2 = d_imag(&af[i__ + j * af_dim1]), f2c_abs(d__2));
149             umax = max(d__3,umax);
150         }
151         if (umax != 0.)
152         {
153             /* Computing MIN */
154             d__1 = amax / umax;
155             rpvgrw = min(d__1,rpvgrw);
156         }
157     }
158     ret_val = rpvgrw;
159     return ret_val;
160 }
161 /* zla_gerpvgrw__ */
162