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 real c_b13 = 1.f;
00020 static real c_b23 = -1.f;
00021
00022 int slarzb_(char *side, char *trans, char *direct, char *
00023 storev, integer *m, integer *n, integer *k, integer *l, real *v,
00024 integer *ldv, real *t, integer *ldt, real *c__, integer *ldc, real *
00025 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 logical lsame_(char *, char *);
00034 extern int sgemm_(char *, char *, integer *, integer *,
00035 integer *, real *, real *, integer *, real *, integer *, real *,
00036 real *, integer *), scopy_(integer *, real *,
00037 integer *, real *, integer *), strmm_(char *, char *, char *,
00038 char *, integer *, integer *, real *, real *, integer *, real *,
00039 integer *), xerbla_(char *,
00040 integer *);
00041 char transt[1];
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 v_dim1 = *ldv;
00149 v_offset = 1 + v_dim1;
00150 v -= v_offset;
00151 t_dim1 = *ldt;
00152 t_offset = 1 + t_dim1;
00153 t -= t_offset;
00154 c_dim1 = *ldc;
00155 c_offset = 1 + c_dim1;
00156 c__ -= c_offset;
00157 work_dim1 = *ldwork;
00158 work_offset = 1 + work_dim1;
00159 work -= work_offset;
00160
00161
00162 if (*m <= 0 || *n <= 0) {
00163 return 0;
00164 }
00165
00166
00167
00168 info = 0;
00169 if (! lsame_(direct, "B")) {
00170 info = -3;
00171 } else if (! lsame_(storev, "R")) {
00172 info = -4;
00173 }
00174 if (info != 0) {
00175 i__1 = -info;
00176 xerbla_("SLARZB", &i__1);
00177 return 0;
00178 }
00179
00180 if (lsame_(trans, "N")) {
00181 *(unsigned char *)transt = 'T';
00182 } else {
00183 *(unsigned char *)transt = 'N';
00184 }
00185
00186 if (lsame_(side, "L")) {
00187
00188
00189
00190
00191
00192 i__1 = *k;
00193 for (j = 1; j <= i__1; ++j) {
00194 scopy_(n, &c__[j + c_dim1], ldc, &work[j * work_dim1 + 1], &c__1);
00195
00196 }
00197
00198
00199
00200
00201 if (*l > 0) {
00202 sgemm_("Transpose", "Transpose", n, k, l, &c_b13, &c__[*m - *l +
00203 1 + c_dim1], ldc, &v[v_offset], ldv, &c_b13, &work[
00204 work_offset], ldwork);
00205 }
00206
00207
00208
00209 strmm_("Right", "Lower", transt, "Non-unit", n, k, &c_b13, &t[
00210 t_offset], ldt, &work[work_offset], ldwork);
00211
00212
00213
00214 i__1 = *n;
00215 for (j = 1; j <= i__1; ++j) {
00216 i__2 = *k;
00217 for (i__ = 1; i__ <= i__2; ++i__) {
00218 c__[i__ + j * c_dim1] -= work[j + i__ * work_dim1];
00219
00220 }
00221
00222 }
00223
00224
00225
00226
00227 if (*l > 0) {
00228 sgemm_("Transpose", "Transpose", l, n, k, &c_b23, &v[v_offset],
00229 ldv, &work[work_offset], ldwork, &c_b13, &c__[*m - *l + 1
00230 + c_dim1], ldc);
00231 }
00232
00233 } else if (lsame_(side, "R")) {
00234
00235
00236
00237
00238
00239 i__1 = *k;
00240 for (j = 1; j <= i__1; ++j) {
00241 scopy_(m, &c__[j * c_dim1 + 1], &c__1, &work[j * work_dim1 + 1], &
00242 c__1);
00243
00244 }
00245
00246
00247
00248
00249 if (*l > 0) {
00250 sgemm_("No transpose", "Transpose", m, k, l, &c_b13, &c__[(*n - *
00251 l + 1) * c_dim1 + 1], ldc, &v[v_offset], ldv, &c_b13, &
00252 work[work_offset], ldwork);
00253 }
00254
00255
00256
00257 strmm_("Right", "Lower", trans, "Non-unit", m, k, &c_b13, &t[t_offset]
00258 , ldt, &work[work_offset], ldwork);
00259
00260
00261
00262 i__1 = *k;
00263 for (j = 1; j <= i__1; ++j) {
00264 i__2 = *m;
00265 for (i__ = 1; i__ <= i__2; ++i__) {
00266 c__[i__ + j * c_dim1] -= work[i__ + j * work_dim1];
00267
00268 }
00269
00270 }
00271
00272
00273
00274
00275 if (*l > 0) {
00276 sgemm_("No transpose", "No transpose", m, l, k, &c_b23, &work[
00277 work_offset], ldwork, &v[v_offset], ldv, &c_b13, &c__[(*n
00278 - *l + 1) * c_dim1 + 1], ldc);
00279 }
00280
00281 }
00282
00283 return 0;
00284
00285
00286
00287 }