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 zlahrd_(integer *n, integer *k, integer *nb,
00023 doublecomplex *a, integer *lda, doublecomplex *tau, doublecomplex *t,
00024 integer *ldt, doublecomplex *y, integer *ldy)
00025 {
00026
00027 integer a_dim1, a_offset, t_dim1, t_offset, y_dim1, y_offset, i__1, i__2,
00028 i__3;
00029 doublecomplex z__1;
00030
00031
00032 integer i__;
00033 doublecomplex ei;
00034 extern int zscal_(integer *, doublecomplex *,
00035 doublecomplex *, integer *), zgemv_(char *, integer *, integer *,
00036 doublecomplex *, doublecomplex *, integer *, doublecomplex *,
00037 integer *, doublecomplex *, doublecomplex *, integer *),
00038 zcopy_(integer *, doublecomplex *, integer *, doublecomplex *,
00039 integer *), zaxpy_(integer *, doublecomplex *, doublecomplex *,
00040 integer *, doublecomplex *, integer *), ztrmv_(char *, char *,
00041 char *, integer *, doublecomplex *, integer *, doublecomplex *,
00042 integer *), zlarfg_(integer *,
00043 doublecomplex *, doublecomplex *, integer *, doublecomplex *),
00044 zlacgv_(integer *, doublecomplex *, integer *);
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 --tau;
00161 a_dim1 = *lda;
00162 a_offset = 1 + a_dim1;
00163 a -= a_offset;
00164 t_dim1 = *ldt;
00165 t_offset = 1 + t_dim1;
00166 t -= t_offset;
00167 y_dim1 = *ldy;
00168 y_offset = 1 + y_dim1;
00169 y -= y_offset;
00170
00171
00172 if (*n <= 1) {
00173 return 0;
00174 }
00175
00176 i__1 = *nb;
00177 for (i__ = 1; i__ <= i__1; ++i__) {
00178 if (i__ > 1) {
00179
00180
00181
00182
00183
00184 i__2 = i__ - 1;
00185 zlacgv_(&i__2, &a[*k + i__ - 1 + a_dim1], lda);
00186 i__2 = i__ - 1;
00187 z__1.r = -1., z__1.i = -0.;
00188 zgemv_("No transpose", n, &i__2, &z__1, &y[y_offset], ldy, &a[*k
00189 + i__ - 1 + a_dim1], lda, &c_b2, &a[i__ * a_dim1 + 1], &
00190 c__1);
00191 i__2 = i__ - 1;
00192 zlacgv_(&i__2, &a[*k + i__ - 1 + a_dim1], lda);
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204 i__2 = i__ - 1;
00205 zcopy_(&i__2, &a[*k + 1 + i__ * a_dim1], &c__1, &t[*nb * t_dim1 +
00206 1], &c__1);
00207 i__2 = i__ - 1;
00208 ztrmv_("Lower", "Conjugate transpose", "Unit", &i__2, &a[*k + 1 +
00209 a_dim1], lda, &t[*nb * t_dim1 + 1], &c__1);
00210
00211
00212
00213 i__2 = *n - *k - i__ + 1;
00214 i__3 = i__ - 1;
00215 zgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*k + i__ +
00216 a_dim1], lda, &a[*k + i__ + i__ * a_dim1], &c__1, &c_b2, &
00217 t[*nb * t_dim1 + 1], &c__1);
00218
00219
00220
00221 i__2 = i__ - 1;
00222 ztrmv_("Upper", "Conjugate transpose", "Non-unit", &i__2, &t[
00223 t_offset], ldt, &t[*nb * t_dim1 + 1], &c__1);
00224
00225
00226
00227 i__2 = *n - *k - i__ + 1;
00228 i__3 = i__ - 1;
00229 z__1.r = -1., z__1.i = -0.;
00230 zgemv_("No transpose", &i__2, &i__3, &z__1, &a[*k + i__ + a_dim1],
00231 lda, &t[*nb * t_dim1 + 1], &c__1, &c_b2, &a[*k + i__ +
00232 i__ * a_dim1], &c__1);
00233
00234
00235
00236 i__2 = i__ - 1;
00237 ztrmv_("Lower", "No transpose", "Unit", &i__2, &a[*k + 1 + a_dim1]
00238 , lda, &t[*nb * t_dim1 + 1], &c__1);
00239 i__2 = i__ - 1;
00240 z__1.r = -1., z__1.i = -0.;
00241 zaxpy_(&i__2, &z__1, &t[*nb * t_dim1 + 1], &c__1, &a[*k + 1 + i__
00242 * a_dim1], &c__1);
00243
00244 i__2 = *k + i__ - 1 + (i__ - 1) * a_dim1;
00245 a[i__2].r = ei.r, a[i__2].i = ei.i;
00246 }
00247
00248
00249
00250
00251 i__2 = *k + i__ + i__ * a_dim1;
00252 ei.r = a[i__2].r, ei.i = a[i__2].i;
00253 i__2 = *n - *k - i__ + 1;
00254
00255 i__3 = *k + i__ + 1;
00256 zlarfg_(&i__2, &ei, &a[min(i__3, *n)+ i__ * a_dim1], &c__1, &tau[i__])
00257 ;
00258 i__2 = *k + i__ + i__ * a_dim1;
00259 a[i__2].r = 1., a[i__2].i = 0.;
00260
00261
00262
00263 i__2 = *n - *k - i__ + 1;
00264 zgemv_("No transpose", n, &i__2, &c_b2, &a[(i__ + 1) * a_dim1 + 1],
00265 lda, &a[*k + i__ + i__ * a_dim1], &c__1, &c_b1, &y[i__ *
00266 y_dim1 + 1], &c__1);
00267 i__2 = *n - *k - i__ + 1;
00268 i__3 = i__ - 1;
00269 zgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*k + i__ +
00270 a_dim1], lda, &a[*k + i__ + i__ * a_dim1], &c__1, &c_b1, &t[
00271 i__ * t_dim1 + 1], &c__1);
00272 i__2 = i__ - 1;
00273 z__1.r = -1., z__1.i = -0.;
00274 zgemv_("No transpose", n, &i__2, &z__1, &y[y_offset], ldy, &t[i__ *
00275 t_dim1 + 1], &c__1, &c_b2, &y[i__ * y_dim1 + 1], &c__1);
00276 zscal_(n, &tau[i__], &y[i__ * y_dim1 + 1], &c__1);
00277
00278
00279
00280 i__2 = i__ - 1;
00281 i__3 = i__;
00282 z__1.r = -tau[i__3].r, z__1.i = -tau[i__3].i;
00283 zscal_(&i__2, &z__1, &t[i__ * t_dim1 + 1], &c__1);
00284 i__2 = i__ - 1;
00285 ztrmv_("Upper", "No transpose", "Non-unit", &i__2, &t[t_offset], ldt,
00286 &t[i__ * t_dim1 + 1], &c__1)
00287 ;
00288 i__2 = i__ + i__ * t_dim1;
00289 i__3 = i__;
00290 t[i__2].r = tau[i__3].r, t[i__2].i = tau[i__3].i;
00291
00292
00293 }
00294 i__1 = *k + *nb + *nb * a_dim1;
00295 a[i__1].r = ei.r, a[i__1].i = ei.i;
00296
00297 return 0;
00298
00299
00300
00301 }