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 real c_b5 = -1.f;
00019 static real c_b6 = 1.f;
00020 static integer c__1 = 1;
00021 static real c_b16 = 0.f;
00022
00023 int slatrd_(char *uplo, integer *n, integer *nb, real *a,
00024 integer *lda, real *e, real *tau, real *w, integer *ldw)
00025 {
00026
00027 integer a_dim1, a_offset, w_dim1, w_offset, i__1, i__2, i__3;
00028
00029
00030 integer i__, iw;
00031 extern doublereal sdot_(integer *, real *, integer *, real *, integer *);
00032 real alpha;
00033 extern logical lsame_(char *, char *);
00034 extern int sscal_(integer *, real *, real *, integer *),
00035 sgemv_(char *, integer *, integer *, real *, real *, integer *,
00036 real *, integer *, real *, real *, integer *), saxpy_(
00037 integer *, real *, real *, integer *, real *, integer *), ssymv_(
00038 char *, integer *, real *, real *, integer *, real *, integer *,
00039 real *, real *, integer *), slarfg_(integer *, real *,
00040 real *, integer *, real *);
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
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 a_dim1 = *lda;
00191 a_offset = 1 + a_dim1;
00192 a -= a_offset;
00193 --e;
00194 --tau;
00195 w_dim1 = *ldw;
00196 w_offset = 1 + w_dim1;
00197 w -= w_offset;
00198
00199
00200 if (*n <= 0) {
00201 return 0;
00202 }
00203
00204 if (lsame_(uplo, "U")) {
00205
00206
00207
00208 i__1 = *n - *nb + 1;
00209 for (i__ = *n; i__ >= i__1; --i__) {
00210 iw = i__ - *n + *nb;
00211 if (i__ < *n) {
00212
00213
00214
00215 i__2 = *n - i__;
00216 sgemv_("No transpose", &i__, &i__2, &c_b5, &a[(i__ + 1) *
00217 a_dim1 + 1], lda, &w[i__ + (iw + 1) * w_dim1], ldw, &
00218 c_b6, &a[i__ * a_dim1 + 1], &c__1);
00219 i__2 = *n - i__;
00220 sgemv_("No transpose", &i__, &i__2, &c_b5, &w[(iw + 1) *
00221 w_dim1 + 1], ldw, &a[i__ + (i__ + 1) * a_dim1], lda, &
00222 c_b6, &a[i__ * a_dim1 + 1], &c__1);
00223 }
00224 if (i__ > 1) {
00225
00226
00227
00228
00229 i__2 = i__ - 1;
00230 slarfg_(&i__2, &a[i__ - 1 + i__ * a_dim1], &a[i__ * a_dim1 +
00231 1], &c__1, &tau[i__ - 1]);
00232 e[i__ - 1] = a[i__ - 1 + i__ * a_dim1];
00233 a[i__ - 1 + i__ * a_dim1] = 1.f;
00234
00235
00236
00237 i__2 = i__ - 1;
00238 ssymv_("Upper", &i__2, &c_b6, &a[a_offset], lda, &a[i__ *
00239 a_dim1 + 1], &c__1, &c_b16, &w[iw * w_dim1 + 1], &
00240 c__1);
00241 if (i__ < *n) {
00242 i__2 = i__ - 1;
00243 i__3 = *n - i__;
00244 sgemv_("Transpose", &i__2, &i__3, &c_b6, &w[(iw + 1) *
00245 w_dim1 + 1], ldw, &a[i__ * a_dim1 + 1], &c__1, &
00246 c_b16, &w[i__ + 1 + iw * w_dim1], &c__1);
00247 i__2 = i__ - 1;
00248 i__3 = *n - i__;
00249 sgemv_("No transpose", &i__2, &i__3, &c_b5, &a[(i__ + 1) *
00250 a_dim1 + 1], lda, &w[i__ + 1 + iw * w_dim1], &
00251 c__1, &c_b6, &w[iw * w_dim1 + 1], &c__1);
00252 i__2 = i__ - 1;
00253 i__3 = *n - i__;
00254 sgemv_("Transpose", &i__2, &i__3, &c_b6, &a[(i__ + 1) *
00255 a_dim1 + 1], lda, &a[i__ * a_dim1 + 1], &c__1, &
00256 c_b16, &w[i__ + 1 + iw * w_dim1], &c__1);
00257 i__2 = i__ - 1;
00258 i__3 = *n - i__;
00259 sgemv_("No transpose", &i__2, &i__3, &c_b5, &w[(iw + 1) *
00260 w_dim1 + 1], ldw, &w[i__ + 1 + iw * w_dim1], &
00261 c__1, &c_b6, &w[iw * w_dim1 + 1], &c__1);
00262 }
00263 i__2 = i__ - 1;
00264 sscal_(&i__2, &tau[i__ - 1], &w[iw * w_dim1 + 1], &c__1);
00265 i__2 = i__ - 1;
00266 alpha = tau[i__ - 1] * -.5f * sdot_(&i__2, &w[iw * w_dim1 + 1]
00267 , &c__1, &a[i__ * a_dim1 + 1], &c__1);
00268 i__2 = i__ - 1;
00269 saxpy_(&i__2, &alpha, &a[i__ * a_dim1 + 1], &c__1, &w[iw *
00270 w_dim1 + 1], &c__1);
00271 }
00272
00273
00274 }
00275 } else {
00276
00277
00278
00279 i__1 = *nb;
00280 for (i__ = 1; i__ <= i__1; ++i__) {
00281
00282
00283
00284 i__2 = *n - i__ + 1;
00285 i__3 = i__ - 1;
00286 sgemv_("No transpose", &i__2, &i__3, &c_b5, &a[i__ + a_dim1], lda,
00287 &w[i__ + w_dim1], ldw, &c_b6, &a[i__ + i__ * a_dim1], &
00288 c__1);
00289 i__2 = *n - i__ + 1;
00290 i__3 = i__ - 1;
00291 sgemv_("No transpose", &i__2, &i__3, &c_b5, &w[i__ + w_dim1], ldw,
00292 &a[i__ + a_dim1], lda, &c_b6, &a[i__ + i__ * a_dim1], &
00293 c__1);
00294 if (i__ < *n) {
00295
00296
00297
00298
00299 i__2 = *n - i__;
00300
00301 i__3 = i__ + 2;
00302 slarfg_(&i__2, &a[i__ + 1 + i__ * a_dim1], &a[min(i__3, *n)+
00303 i__ * a_dim1], &c__1, &tau[i__]);
00304 e[i__] = a[i__ + 1 + i__ * a_dim1];
00305 a[i__ + 1 + i__ * a_dim1] = 1.f;
00306
00307
00308
00309 i__2 = *n - i__;
00310 ssymv_("Lower", &i__2, &c_b6, &a[i__ + 1 + (i__ + 1) * a_dim1]
00311 , lda, &a[i__ + 1 + i__ * a_dim1], &c__1, &c_b16, &w[
00312 i__ + 1 + i__ * w_dim1], &c__1);
00313 i__2 = *n - i__;
00314 i__3 = i__ - 1;
00315 sgemv_("Transpose", &i__2, &i__3, &c_b6, &w[i__ + 1 + w_dim1],
00316 ldw, &a[i__ + 1 + i__ * a_dim1], &c__1, &c_b16, &w[
00317 i__ * w_dim1 + 1], &c__1);
00318 i__2 = *n - i__;
00319 i__3 = i__ - 1;
00320 sgemv_("No transpose", &i__2, &i__3, &c_b5, &a[i__ + 1 +
00321 a_dim1], lda, &w[i__ * w_dim1 + 1], &c__1, &c_b6, &w[
00322 i__ + 1 + i__ * w_dim1], &c__1);
00323 i__2 = *n - i__;
00324 i__3 = i__ - 1;
00325 sgemv_("Transpose", &i__2, &i__3, &c_b6, &a[i__ + 1 + a_dim1],
00326 lda, &a[i__ + 1 + i__ * a_dim1], &c__1, &c_b16, &w[
00327 i__ * w_dim1 + 1], &c__1);
00328 i__2 = *n - i__;
00329 i__3 = i__ - 1;
00330 sgemv_("No transpose", &i__2, &i__3, &c_b5, &w[i__ + 1 +
00331 w_dim1], ldw, &w[i__ * w_dim1 + 1], &c__1, &c_b6, &w[
00332 i__ + 1 + i__ * w_dim1], &c__1);
00333 i__2 = *n - i__;
00334 sscal_(&i__2, &tau[i__], &w[i__ + 1 + i__ * w_dim1], &c__1);
00335 i__2 = *n - i__;
00336 alpha = tau[i__] * -.5f * sdot_(&i__2, &w[i__ + 1 + i__ *
00337 w_dim1], &c__1, &a[i__ + 1 + i__ * a_dim1], &c__1);
00338 i__2 = *n - i__;
00339 saxpy_(&i__2, &alpha, &a[i__ + 1 + i__ * a_dim1], &c__1, &w[
00340 i__ + 1 + i__ * w_dim1], &c__1);
00341 }
00342
00343
00344 }
00345 }
00346
00347 return 0;
00348
00349
00350
00351 }