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 integer c__1 = 1;
00019 static doublereal c_b13 = 1.;
00020 static doublereal c_b23 = -1.;
00021
00022 int dlarzb_(char *side, char *trans, char *direct, char *
00023 storev, integer *m, integer *n, integer *k, integer *l, doublereal *v,
00024 integer *ldv, doublereal *t, integer *ldt, doublereal *c__, integer *
00025 ldc, doublereal *work, integer *ldwork)
00026 {
00027
00028 integer c_dim1, c_offset, t_dim1, t_offset, v_dim1, v_offset, work_dim1,
00029 work_offset, i__1, i__2;
00030
00031
00032 integer i__, j, info;
00033 extern int dgemm_(char *, char *, integer *, integer *,
00034 integer *, doublereal *, doublereal *, integer *, doublereal *,
00035 integer *, doublereal *, doublereal *, integer *);
00036 extern logical lsame_(char *, char *);
00037 extern int dcopy_(integer *, doublereal *, integer *,
00038 doublereal *, integer *), dtrmm_(char *, char *, char *, char *,
00039 integer *, integer *, doublereal *, doublereal *, integer *,
00040 doublereal *, integer *), xerbla_(
00041 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_("DLARZB", &i__1);
00178 return 0;
00179 }
00180
00181 if (lsame_(trans, "N")) {
00182 *(unsigned char *)transt = 'T';
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 dcopy_(n, &c__[j + c_dim1], ldc, &work[j * work_dim1 + 1], &c__1);
00196
00197 }
00198
00199
00200
00201
00202 if (*l > 0) {
00203 dgemm_("Transpose", "Transpose", n, k, l, &c_b13, &c__[*m - *l +
00204 1 + c_dim1], ldc, &v[v_offset], ldv, &c_b13, &work[
00205 work_offset], ldwork);
00206 }
00207
00208
00209
00210 dtrmm_("Right", "Lower", transt, "Non-unit", n, k, &c_b13, &t[
00211 t_offset], 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 c__[i__ + j * c_dim1] -= work[j + i__ * work_dim1];
00220
00221 }
00222
00223 }
00224
00225
00226
00227
00228 if (*l > 0) {
00229 dgemm_("Transpose", "Transpose", l, n, k, &c_b23, &v[v_offset],
00230 ldv, &work[work_offset], ldwork, &c_b13, &c__[*m - *l + 1
00231 + c_dim1], ldc);
00232 }
00233
00234 } else if (lsame_(side, "R")) {
00235
00236
00237
00238
00239
00240 i__1 = *k;
00241 for (j = 1; j <= i__1; ++j) {
00242 dcopy_(m, &c__[j * c_dim1 + 1], &c__1, &work[j * work_dim1 + 1], &
00243 c__1);
00244
00245 }
00246
00247
00248
00249
00250 if (*l > 0) {
00251 dgemm_("No transpose", "Transpose", m, k, l, &c_b13, &c__[(*n - *
00252 l + 1) * c_dim1 + 1], ldc, &v[v_offset], ldv, &c_b13, &
00253 work[work_offset], ldwork);
00254 }
00255
00256
00257
00258 dtrmm_("Right", "Lower", trans, "Non-unit", m, k, &c_b13, &t[t_offset]
00259 , ldt, &work[work_offset], ldwork);
00260
00261
00262
00263 i__1 = *k;
00264 for (j = 1; j <= i__1; ++j) {
00265 i__2 = *m;
00266 for (i__ = 1; i__ <= i__2; ++i__) {
00267 c__[i__ + j * c_dim1] -= work[i__ + j * work_dim1];
00268
00269 }
00270
00271 }
00272
00273
00274
00275
00276 if (*l > 0) {
00277 dgemm_("No transpose", "No transpose", m, l, k, &c_b23, &work[
00278 work_offset], ldwork, &v[v_offset], ldv, &c_b13, &c__[(*n
00279 - *l + 1) * c_dim1 + 1], ldc);
00280 }
00281
00282 }
00283
00284 return 0;
00285
00286
00287
00288 }