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 static integer c__1 = 1;
00021
00022 int zsgt01_(integer *itype, char *uplo, integer *n, integer *
00023 m, doublecomplex *a, integer *lda, doublecomplex *b, integer *ldb,
00024 doublecomplex *z__, integer *ldz, doublereal *d__, doublecomplex *
00025 work, doublereal *rwork, doublereal *result)
00026 {
00027
00028 integer a_dim1, a_offset, b_dim1, b_offset, z_dim1, z_offset, i__1;
00029 doublecomplex z__1;
00030
00031
00032 integer i__;
00033 doublereal ulp, anorm;
00034 extern int zhemm_(char *, char *, integer *, integer *,
00035 doublecomplex *, doublecomplex *, integer *, doublecomplex *,
00036 integer *, doublecomplex *, doublecomplex *, integer *);
00037 extern doublereal dlamch_(char *), zlange_(char *, integer *,
00038 integer *, doublecomplex *, integer *, doublereal *),
00039 zlanhe_(char *, char *, integer *, doublecomplex *, integer *,
00040 doublereal *);
00041 extern int zdscal_(integer *, doublereal *,
00042 doublecomplex *, integer *);
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
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 a_dim1 = *lda;
00140 a_offset = 1 + a_dim1;
00141 a -= a_offset;
00142 b_dim1 = *ldb;
00143 b_offset = 1 + b_dim1;
00144 b -= b_offset;
00145 z_dim1 = *ldz;
00146 z_offset = 1 + z_dim1;
00147 z__ -= z_offset;
00148 --d__;
00149 --work;
00150 --rwork;
00151 --result;
00152
00153
00154 result[1] = 0.;
00155 if (*n <= 0) {
00156 return 0;
00157 }
00158
00159 ulp = dlamch_("Epsilon");
00160
00161
00162
00163 anorm = zlanhe_("1", uplo, n, &a[a_offset], lda, &rwork[1]) * zlange_("1", n, m, &z__[z_offset], ldz, &rwork[1]);
00164 if (anorm == 0.) {
00165 anorm = 1.;
00166 }
00167
00168 if (*itype == 1) {
00169
00170
00171
00172 zhemm_("Left", uplo, n, m, &c_b2, &a[a_offset], lda, &z__[z_offset],
00173 ldz, &c_b1, &work[1], n);
00174 i__1 = *m;
00175 for (i__ = 1; i__ <= i__1; ++i__) {
00176 zdscal_(n, &d__[i__], &z__[i__ * z_dim1 + 1], &c__1);
00177
00178 }
00179 z__1.r = -1., z__1.i = -0.;
00180 zhemm_("Left", uplo, n, m, &c_b2, &b[b_offset], ldb, &z__[z_offset],
00181 ldz, &z__1, &work[1], n);
00182
00183 result[1] = zlange_("1", n, m, &work[1], n, &rwork[1]) /
00184 anorm / (*n * ulp);
00185
00186 } else if (*itype == 2) {
00187
00188
00189
00190 zhemm_("Left", uplo, n, m, &c_b2, &b[b_offset], ldb, &z__[z_offset],
00191 ldz, &c_b1, &work[1], n);
00192 i__1 = *m;
00193 for (i__ = 1; i__ <= i__1; ++i__) {
00194 zdscal_(n, &d__[i__], &z__[i__ * z_dim1 + 1], &c__1);
00195
00196 }
00197 z__1.r = -1., z__1.i = -0.;
00198 zhemm_("Left", uplo, n, m, &c_b2, &a[a_offset], lda, &work[1], n, &
00199 z__1, &z__[z_offset], ldz);
00200
00201 result[1] = zlange_("1", n, m, &z__[z_offset], ldz, &rwork[1]) / anorm / (*n * ulp);
00202
00203 } else if (*itype == 3) {
00204
00205
00206
00207 zhemm_("Left", uplo, n, m, &c_b2, &a[a_offset], lda, &z__[z_offset],
00208 ldz, &c_b1, &work[1], n);
00209 i__1 = *m;
00210 for (i__ = 1; i__ <= i__1; ++i__) {
00211 zdscal_(n, &d__[i__], &z__[i__ * z_dim1 + 1], &c__1);
00212
00213 }
00214 z__1.r = -1., z__1.i = -0.;
00215 zhemm_("Left", uplo, n, m, &c_b2, &b[b_offset], ldb, &work[1], n, &
00216 z__1, &z__[z_offset], ldz);
00217
00218 result[1] = zlange_("1", n, m, &z__[z_offset], ldz, &rwork[1]) / anorm / (*n * ulp);
00219 }
00220
00221 return 0;
00222
00223
00224
00225 }