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