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 complex c_b1 = {1.f,0.f};
00019 static integer c__1 = 1;
00020
00021 int clarzb_(char *side, char *trans, char *direct, char *
00022 storev, integer *m, integer *n, integer *k, integer *l, complex *v,
00023 integer *ldv, complex *t, integer *ldt, complex *c__, integer *ldc,
00024 complex *work, integer *ldwork)
00025 {
00026
00027 integer c_dim1, c_offset, t_dim1, t_offset, v_dim1, v_offset, work_dim1,
00028 work_offset, i__1, i__2, i__3, i__4, i__5;
00029 complex q__1;
00030
00031
00032 integer i__, j, info;
00033 extern int cgemm_(char *, char *, integer *, integer *,
00034 integer *, complex *, complex *, integer *, complex *, integer *,
00035 complex *, complex *, integer *);
00036 extern logical lsame_(char *, char *);
00037 extern int ccopy_(integer *, complex *, integer *,
00038 complex *, integer *), ctrmm_(char *, char *, char *, char *,
00039 integer *, integer *, complex *, complex *, integer *, complex *,
00040 integer *), clacgv_(integer *,
00041 complex *, integer *), xerbla_(char *, integer *);
00042 char transt[1];
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 v_dim1 = *ldv;
00150 v_offset = 1 + v_dim1;
00151 v -= v_offset;
00152 t_dim1 = *ldt;
00153 t_offset = 1 + t_dim1;
00154 t -= t_offset;
00155 c_dim1 = *ldc;
00156 c_offset = 1 + c_dim1;
00157 c__ -= c_offset;
00158 work_dim1 = *ldwork;
00159 work_offset = 1 + work_dim1;
00160 work -= work_offset;
00161
00162
00163 if (*m <= 0 || *n <= 0) {
00164 return 0;
00165 }
00166
00167
00168
00169 info = 0;
00170 if (! lsame_(direct, "B")) {
00171 info = -3;
00172 } else if (! lsame_(storev, "R")) {
00173 info = -4;
00174 }
00175 if (info != 0) {
00176 i__1 = -info;
00177 xerbla_("CLARZB", &i__1);
00178 return 0;
00179 }
00180
00181 if (lsame_(trans, "N")) {
00182 *(unsigned char *)transt = 'C';
00183 } else {
00184 *(unsigned char *)transt = 'N';
00185 }
00186
00187 if (lsame_(side, "L")) {
00188
00189
00190
00191
00192
00193 i__1 = *k;
00194 for (j = 1; j <= i__1; ++j) {
00195 ccopy_(n, &c__[j + c_dim1], ldc, &work[j * work_dim1 + 1], &c__1);
00196
00197 }
00198
00199
00200
00201
00202 if (*l > 0) {
00203 cgemm_("Transpose", "Conjugate transpose", n, k, l, &c_b1, &c__[*
00204 m - *l + 1 + c_dim1], ldc, &v[v_offset], ldv, &c_b1, &
00205 work[work_offset], ldwork);
00206 }
00207
00208
00209
00210 ctrmm_("Right", "Lower", transt, "Non-unit", n, k, &c_b1, &t[t_offset]
00211 , ldt, &work[work_offset], ldwork);
00212
00213
00214
00215 i__1 = *n;
00216 for (j = 1; j <= i__1; ++j) {
00217 i__2 = *k;
00218 for (i__ = 1; i__ <= i__2; ++i__) {
00219 i__3 = i__ + j * c_dim1;
00220 i__4 = i__ + j * c_dim1;
00221 i__5 = j + i__ * work_dim1;
00222 q__1.r = c__[i__4].r - work[i__5].r, q__1.i = c__[i__4].i -
00223 work[i__5].i;
00224 c__[i__3].r = q__1.r, c__[i__3].i = q__1.i;
00225
00226 }
00227
00228 }
00229
00230
00231
00232
00233 if (*l > 0) {
00234 q__1.r = -1.f, q__1.i = -0.f;
00235 cgemm_("Transpose", "Transpose", l, n, k, &q__1, &v[v_offset],
00236 ldv, &work[work_offset], ldwork, &c_b1, &c__[*m - *l + 1
00237 + c_dim1], ldc);
00238 }
00239
00240 } else if (lsame_(side, "R")) {
00241
00242
00243
00244
00245
00246 i__1 = *k;
00247 for (j = 1; j <= i__1; ++j) {
00248 ccopy_(m, &c__[j * c_dim1 + 1], &c__1, &work[j * work_dim1 + 1], &
00249 c__1);
00250
00251 }
00252
00253
00254
00255
00256 if (*l > 0) {
00257 cgemm_("No transpose", "Transpose", m, k, l, &c_b1, &c__[(*n - *l
00258 + 1) * c_dim1 + 1], ldc, &v[v_offset], ldv, &c_b1, &work[
00259 work_offset], ldwork);
00260 }
00261
00262
00263
00264
00265 i__1 = *k;
00266 for (j = 1; j <= i__1; ++j) {
00267 i__2 = *k - j + 1;
00268 clacgv_(&i__2, &t[j + j * t_dim1], &c__1);
00269
00270 }
00271 ctrmm_("Right", "Lower", trans, "Non-unit", m, k, &c_b1, &t[t_offset],
00272 ldt, &work[work_offset], ldwork);
00273 i__1 = *k;
00274 for (j = 1; j <= i__1; ++j) {
00275 i__2 = *k - j + 1;
00276 clacgv_(&i__2, &t[j + j * t_dim1], &c__1);
00277
00278 }
00279
00280
00281
00282 i__1 = *k;
00283 for (j = 1; j <= i__1; ++j) {
00284 i__2 = *m;
00285 for (i__ = 1; i__ <= i__2; ++i__) {
00286 i__3 = i__ + j * c_dim1;
00287 i__4 = i__ + j * c_dim1;
00288 i__5 = i__ + j * work_dim1;
00289 q__1.r = c__[i__4].r - work[i__5].r, q__1.i = c__[i__4].i -
00290 work[i__5].i;
00291 c__[i__3].r = q__1.r, c__[i__3].i = q__1.i;
00292
00293 }
00294
00295 }
00296
00297
00298
00299
00300 i__1 = *l;
00301 for (j = 1; j <= i__1; ++j) {
00302 clacgv_(k, &v[j * v_dim1 + 1], &c__1);
00303
00304 }
00305 if (*l > 0) {
00306 q__1.r = -1.f, q__1.i = -0.f;
00307 cgemm_("No transpose", "No transpose", m, l, k, &q__1, &work[
00308 work_offset], ldwork, &v[v_offset], ldv, &c_b1, &c__[(*n
00309 - *l + 1) * c_dim1 + 1], ldc);
00310 }
00311 i__1 = *l;
00312 for (j = 1; j <= i__1; ++j) {
00313 clacgv_(k, &v[j * v_dim1 + 1], &c__1);
00314
00315 }
00316
00317 }
00318
00319 return 0;
00320
00321
00322
00323 }