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_b5 = -1.;
00019 static doublereal c_b6 = 1.;
00020 static integer c__1 = 1;
00021 static doublereal c_b16 = 0.;
00022
00023 int dlatrd_(char *uplo, integer *n, integer *nb, doublereal *
00024 a, integer *lda, doublereal *e, doublereal *tau, doublereal *w,
00025 integer *ldw)
00026 {
00027
00028 integer a_dim1, a_offset, w_dim1, w_offset, i__1, i__2, i__3;
00029
00030
00031 integer i__, iw;
00032 extern doublereal ddot_(integer *, doublereal *, integer *, doublereal *,
00033 integer *);
00034 doublereal alpha;
00035 extern int dscal_(integer *, doublereal *, doublereal *,
00036 integer *);
00037 extern logical lsame_(char *, char *);
00038 extern int dgemv_(char *, integer *, integer *,
00039 doublereal *, doublereal *, integer *, doublereal *, integer *,
00040 doublereal *, doublereal *, integer *), daxpy_(integer *,
00041 doublereal *, doublereal *, integer *, doublereal *, integer *),
00042 dsymv_(char *, integer *, doublereal *, doublereal *, integer *,
00043 doublereal *, integer *, doublereal *, doublereal *, integer *), dlarfg_(integer *, doublereal *, doublereal *, integer *,
00044 doublereal *);
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
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194 a_dim1 = *lda;
00195 a_offset = 1 + a_dim1;
00196 a -= a_offset;
00197 --e;
00198 --tau;
00199 w_dim1 = *ldw;
00200 w_offset = 1 + w_dim1;
00201 w -= w_offset;
00202
00203
00204 if (*n <= 0) {
00205 return 0;
00206 }
00207
00208 if (lsame_(uplo, "U")) {
00209
00210
00211
00212 i__1 = *n - *nb + 1;
00213 for (i__ = *n; i__ >= i__1; --i__) {
00214 iw = i__ - *n + *nb;
00215 if (i__ < *n) {
00216
00217
00218
00219 i__2 = *n - i__;
00220 dgemv_("No transpose", &i__, &i__2, &c_b5, &a[(i__ + 1) *
00221 a_dim1 + 1], lda, &w[i__ + (iw + 1) * w_dim1], ldw, &
00222 c_b6, &a[i__ * a_dim1 + 1], &c__1);
00223 i__2 = *n - i__;
00224 dgemv_("No transpose", &i__, &i__2, &c_b5, &w[(iw + 1) *
00225 w_dim1 + 1], ldw, &a[i__ + (i__ + 1) * a_dim1], lda, &
00226 c_b6, &a[i__ * a_dim1 + 1], &c__1);
00227 }
00228 if (i__ > 1) {
00229
00230
00231
00232
00233 i__2 = i__ - 1;
00234 dlarfg_(&i__2, &a[i__ - 1 + i__ * a_dim1], &a[i__ * a_dim1 +
00235 1], &c__1, &tau[i__ - 1]);
00236 e[i__ - 1] = a[i__ - 1 + i__ * a_dim1];
00237 a[i__ - 1 + i__ * a_dim1] = 1.;
00238
00239
00240
00241 i__2 = i__ - 1;
00242 dsymv_("Upper", &i__2, &c_b6, &a[a_offset], lda, &a[i__ *
00243 a_dim1 + 1], &c__1, &c_b16, &w[iw * w_dim1 + 1], &
00244 c__1);
00245 if (i__ < *n) {
00246 i__2 = i__ - 1;
00247 i__3 = *n - i__;
00248 dgemv_("Transpose", &i__2, &i__3, &c_b6, &w[(iw + 1) *
00249 w_dim1 + 1], ldw, &a[i__ * a_dim1 + 1], &c__1, &
00250 c_b16, &w[i__ + 1 + iw * w_dim1], &c__1);
00251 i__2 = i__ - 1;
00252 i__3 = *n - i__;
00253 dgemv_("No transpose", &i__2, &i__3, &c_b5, &a[(i__ + 1) *
00254 a_dim1 + 1], lda, &w[i__ + 1 + iw * w_dim1], &
00255 c__1, &c_b6, &w[iw * w_dim1 + 1], &c__1);
00256 i__2 = i__ - 1;
00257 i__3 = *n - i__;
00258 dgemv_("Transpose", &i__2, &i__3, &c_b6, &a[(i__ + 1) *
00259 a_dim1 + 1], lda, &a[i__ * a_dim1 + 1], &c__1, &
00260 c_b16, &w[i__ + 1 + iw * w_dim1], &c__1);
00261 i__2 = i__ - 1;
00262 i__3 = *n - i__;
00263 dgemv_("No transpose", &i__2, &i__3, &c_b5, &w[(iw + 1) *
00264 w_dim1 + 1], ldw, &w[i__ + 1 + iw * w_dim1], &
00265 c__1, &c_b6, &w[iw * w_dim1 + 1], &c__1);
00266 }
00267 i__2 = i__ - 1;
00268 dscal_(&i__2, &tau[i__ - 1], &w[iw * w_dim1 + 1], &c__1);
00269 i__2 = i__ - 1;
00270 alpha = tau[i__ - 1] * -.5 * ddot_(&i__2, &w[iw * w_dim1 + 1],
00271 &c__1, &a[i__ * a_dim1 + 1], &c__1);
00272 i__2 = i__ - 1;
00273 daxpy_(&i__2, &alpha, &a[i__ * a_dim1 + 1], &c__1, &w[iw *
00274 w_dim1 + 1], &c__1);
00275 }
00276
00277
00278 }
00279 } else {
00280
00281
00282
00283 i__1 = *nb;
00284 for (i__ = 1; i__ <= i__1; ++i__) {
00285
00286
00287
00288 i__2 = *n - i__ + 1;
00289 i__3 = i__ - 1;
00290 dgemv_("No transpose", &i__2, &i__3, &c_b5, &a[i__ + a_dim1], lda,
00291 &w[i__ + w_dim1], ldw, &c_b6, &a[i__ + i__ * a_dim1], &
00292 c__1);
00293 i__2 = *n - i__ + 1;
00294 i__3 = i__ - 1;
00295 dgemv_("No transpose", &i__2, &i__3, &c_b5, &w[i__ + w_dim1], ldw,
00296 &a[i__ + a_dim1], lda, &c_b6, &a[i__ + i__ * a_dim1], &
00297 c__1);
00298 if (i__ < *n) {
00299
00300
00301
00302
00303 i__2 = *n - i__;
00304
00305 i__3 = i__ + 2;
00306 dlarfg_(&i__2, &a[i__ + 1 + i__ * a_dim1], &a[min(i__3, *n)+
00307 i__ * a_dim1], &c__1, &tau[i__]);
00308 e[i__] = a[i__ + 1 + i__ * a_dim1];
00309 a[i__ + 1 + i__ * a_dim1] = 1.;
00310
00311
00312
00313 i__2 = *n - i__;
00314 dsymv_("Lower", &i__2, &c_b6, &a[i__ + 1 + (i__ + 1) * a_dim1]
00315 , lda, &a[i__ + 1 + i__ * a_dim1], &c__1, &c_b16, &w[
00316 i__ + 1 + i__ * w_dim1], &c__1);
00317 i__2 = *n - i__;
00318 i__3 = i__ - 1;
00319 dgemv_("Transpose", &i__2, &i__3, &c_b6, &w[i__ + 1 + w_dim1],
00320 ldw, &a[i__ + 1 + i__ * a_dim1], &c__1, &c_b16, &w[
00321 i__ * w_dim1 + 1], &c__1);
00322 i__2 = *n - i__;
00323 i__3 = i__ - 1;
00324 dgemv_("No transpose", &i__2, &i__3, &c_b5, &a[i__ + 1 +
00325 a_dim1], lda, &w[i__ * w_dim1 + 1], &c__1, &c_b6, &w[
00326 i__ + 1 + i__ * w_dim1], &c__1);
00327 i__2 = *n - i__;
00328 i__3 = i__ - 1;
00329 dgemv_("Transpose", &i__2, &i__3, &c_b6, &a[i__ + 1 + a_dim1],
00330 lda, &a[i__ + 1 + i__ * a_dim1], &c__1, &c_b16, &w[
00331 i__ * w_dim1 + 1], &c__1);
00332 i__2 = *n - i__;
00333 i__3 = i__ - 1;
00334 dgemv_("No transpose", &i__2, &i__3, &c_b5, &w[i__ + 1 +
00335 w_dim1], ldw, &w[i__ * w_dim1 + 1], &c__1, &c_b6, &w[
00336 i__ + 1 + i__ * w_dim1], &c__1);
00337 i__2 = *n - i__;
00338 dscal_(&i__2, &tau[i__], &w[i__ + 1 + i__ * w_dim1], &c__1);
00339 i__2 = *n - i__;
00340 alpha = tau[i__] * -.5 * ddot_(&i__2, &w[i__ + 1 + i__ *
00341 w_dim1], &c__1, &a[i__ + 1 + i__ * a_dim1], &c__1);
00342 i__2 = *n - i__;
00343 daxpy_(&i__2, &alpha, &a[i__ + 1 + i__ * a_dim1], &c__1, &w[
00344 i__ + 1 + i__ * w_dim1], &c__1);
00345 }
00346
00347
00348 }
00349 }
00350
00351 return 0;
00352
00353
00354
00355 }