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 doublecomplex c_b1 = {0.,0.};
00019 static doublecomplex c_b2 = {1.,0.};
00020
00021 int zget54_(integer *n, doublecomplex *a, integer *lda,
00022 doublecomplex *b, integer *ldb, doublecomplex *s, integer *lds,
00023 doublecomplex *t, integer *ldt, doublecomplex *u, integer *ldu,
00024 doublecomplex *v, integer *ldv, doublecomplex *work, doublereal *
00025 result)
00026 {
00027
00028 integer a_dim1, a_offset, b_dim1, b_offset, s_dim1, s_offset, t_dim1,
00029 t_offset, u_dim1, u_offset, v_dim1, v_offset, i__1;
00030 doublereal d__1, d__2;
00031 doublecomplex z__1;
00032
00033
00034 doublereal dum[1], ulp, unfl;
00035 extern int zgemm_(char *, char *, integer *, integer *,
00036 integer *, doublecomplex *, doublecomplex *, integer *,
00037 doublecomplex *, integer *, doublecomplex *, doublecomplex *,
00038 integer *);
00039 doublereal wnorm;
00040 extern doublereal dlamch_(char *);
00041 doublereal abnorm;
00042 extern doublereal zlange_(char *, integer *, integer *, doublecomplex *,
00043 integer *, doublereal *);
00044 extern int zlacpy_(char *, integer *, integer *,
00045 doublecomplex *, integer *, doublecomplex *, integer *);
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
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144 a_dim1 = *lda;
00145 a_offset = 1 + a_dim1;
00146 a -= a_offset;
00147 b_dim1 = *ldb;
00148 b_offset = 1 + b_dim1;
00149 b -= b_offset;
00150 s_dim1 = *lds;
00151 s_offset = 1 + s_dim1;
00152 s -= s_offset;
00153 t_dim1 = *ldt;
00154 t_offset = 1 + t_dim1;
00155 t -= t_offset;
00156 u_dim1 = *ldu;
00157 u_offset = 1 + u_dim1;
00158 u -= u_offset;
00159 v_dim1 = *ldv;
00160 v_offset = 1 + v_dim1;
00161 v -= v_offset;
00162 --work;
00163
00164
00165 *result = 0.;
00166 if (*n <= 0) {
00167 return 0;
00168 }
00169
00170
00171
00172 unfl = dlamch_("Safe minimum");
00173 ulp = dlamch_("Epsilon") * dlamch_("Base");
00174
00175
00176
00177 zlacpy_("Full", n, n, &a[a_offset], lda, &work[1], n);
00178 zlacpy_("Full", n, n, &b[b_offset], ldb, &work[*n * *n + 1], n)
00179 ;
00180
00181 i__1 = *n << 1;
00182 d__1 = zlange_("1", n, &i__1, &work[1], n, dum);
00183 abnorm = max(d__1,unfl);
00184
00185
00186
00187 zlacpy_(" ", n, n, &a[a_offset], lda, &work[1], n);
00188 zgemm_("N", "N", n, n, n, &c_b2, &u[u_offset], ldu, &s[s_offset], lds, &
00189 c_b1, &work[*n * *n + 1], n);
00190
00191 z__1.r = -1., z__1.i = -0.;
00192 zgemm_("N", "C", n, n, n, &z__1, &work[*n * *n + 1], n, &v[v_offset], ldv,
00193 &c_b2, &work[1], n);
00194
00195
00196
00197 zlacpy_(" ", n, n, &b[b_offset], ldb, &work[*n * *n + 1], n);
00198 zgemm_("N", "N", n, n, n, &c_b2, &u[u_offset], ldu, &t[t_offset], ldt, &
00199 c_b1, &work[(*n << 1) * *n + 1], n);
00200
00201 z__1.r = -1., z__1.i = -0.;
00202 zgemm_("N", "C", n, n, n, &z__1, &work[(*n << 1) * *n + 1], n, &v[
00203 v_offset], ldv, &c_b2, &work[*n * *n + 1], n);
00204
00205
00206
00207 i__1 = *n << 1;
00208 wnorm = zlange_("1", n, &i__1, &work[1], n, dum);
00209
00210 if (abnorm > wnorm) {
00211 *result = wnorm / abnorm / ((*n << 1) * ulp);
00212 } else {
00213 if (abnorm < 1.) {
00214
00215 d__1 = wnorm, d__2 = (*n << 1) * abnorm;
00216 *result = min(d__1,d__2) / abnorm / ((*n << 1) * ulp);
00217 } else {
00218
00219 d__1 = wnorm / abnorm, d__2 = (doublereal) (*n << 1);
00220 *result = min(d__1,d__2) / ((*n << 1) * ulp);
00221 }
00222 }
00223
00224 return 0;
00225
00226
00227
00228 }