00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 static integer c__1 = 1;
00019 static doublecomplex c_b9 = {-1.,0.};
00020
00021 int zget10_(integer *m, integer *n, doublecomplex *a,
00022 integer *lda, doublecomplex *b, integer *ldb, doublecomplex *work,
00023 doublereal *rwork, doublereal *result)
00024 {
00025
00026 integer a_dim1, a_offset, b_dim1, b_offset, i__1;
00027 doublereal d__1, d__2;
00028
00029
00030 integer j;
00031 doublereal eps, unfl, anorm, wnorm;
00032 extern int zcopy_(integer *, doublecomplex *, integer *,
00033 doublecomplex *, integer *), zaxpy_(integer *, doublecomplex *,
00034 doublecomplex *, integer *, doublecomplex *, integer *);
00035 extern doublereal dlamch_(char *), zlange_(char *, integer *,
00036 integer *, doublecomplex *, integer *, doublereal *),
00037 dzasum_(integer *, doublecomplex *, integer *);
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 a_dim1 = *lda;
00101 a_offset = 1 + a_dim1;
00102 a -= a_offset;
00103 b_dim1 = *ldb;
00104 b_offset = 1 + b_dim1;
00105 b -= b_offset;
00106 --work;
00107 --rwork;
00108
00109
00110 if (*m <= 0 || *n <= 0) {
00111 *result = 0.;
00112 return 0;
00113 }
00114
00115 unfl = dlamch_("Safe minimum");
00116 eps = dlamch_("Precision");
00117
00118 wnorm = 0.;
00119 i__1 = *n;
00120 for (j = 1; j <= i__1; ++j) {
00121 zcopy_(m, &a[j * a_dim1 + 1], &c__1, &work[1], &c__1);
00122 zaxpy_(m, &c_b9, &b[j * b_dim1 + 1], &c__1, &work[1], &c__1);
00123
00124 d__1 = wnorm, d__2 = dzasum_(n, &work[1], &c__1);
00125 wnorm = max(d__1,d__2);
00126
00127 }
00128
00129
00130 d__1 = zlange_("1", m, n, &a[a_offset], lda, &rwork[1]);
00131 anorm = max(d__1,unfl);
00132
00133 if (anorm > wnorm) {
00134 *result = wnorm / anorm / (*m * eps);
00135 } else {
00136 if (anorm < 1.) {
00137
00138 d__1 = wnorm, d__2 = *m * anorm;
00139 *result = min(d__1,d__2) / anorm / (*m * eps);
00140 } else {
00141
00142 d__1 = wnorm / anorm, d__2 = (doublereal) (*m);
00143 *result = min(d__1,d__2) / (*m * eps);
00144 }
00145 }
00146
00147 return 0;
00148
00149
00150
00151 }