Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016 int dsymm_(char *side, char *uplo, integer *m, integer *n,
00017 doublereal *alpha, doublereal *a, integer *lda, doublereal *b,
00018 integer *ldb, doublereal *beta, doublereal *c__, integer *ldc)
00019 {
00020
00021 integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2,
00022 i__3;
00023
00024
00025 integer i__, j, k, info;
00026 doublereal temp1, temp2;
00027 extern logical lsame_(char *, char *);
00028 integer nrowa;
00029 logical upper;
00030 extern int xerbla_(char *, integer *);
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
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 a_dim1 = *lda;
00176 a_offset = 1 + a_dim1;
00177 a -= a_offset;
00178 b_dim1 = *ldb;
00179 b_offset = 1 + b_dim1;
00180 b -= b_offset;
00181 c_dim1 = *ldc;
00182 c_offset = 1 + c_dim1;
00183 c__ -= c_offset;
00184
00185
00186 if (lsame_(side, "L")) {
00187 nrowa = *m;
00188 } else {
00189 nrowa = *n;
00190 }
00191 upper = lsame_(uplo, "U");
00192
00193
00194
00195 info = 0;
00196 if (! lsame_(side, "L") && ! lsame_(side, "R")) {
00197 info = 1;
00198 } else if (! upper && ! lsame_(uplo, "L")) {
00199 info = 2;
00200 } else if (*m < 0) {
00201 info = 3;
00202 } else if (*n < 0) {
00203 info = 4;
00204 } else if (*lda < max(1,nrowa)) {
00205 info = 7;
00206 } else if (*ldb < max(1,*m)) {
00207 info = 9;
00208 } else if (*ldc < max(1,*m)) {
00209 info = 12;
00210 }
00211 if (info != 0) {
00212 xerbla_("DSYMM ", &info);
00213 return 0;
00214 }
00215
00216
00217
00218 if (*m == 0 || *n == 0 || *alpha == 0. && *beta == 1.) {
00219 return 0;
00220 }
00221
00222
00223
00224 if (*alpha == 0.) {
00225 if (*beta == 0.) {
00226 i__1 = *n;
00227 for (j = 1; j <= i__1; ++j) {
00228 i__2 = *m;
00229 for (i__ = 1; i__ <= i__2; ++i__) {
00230 c__[i__ + j * c_dim1] = 0.;
00231
00232 }
00233
00234 }
00235 } else {
00236 i__1 = *n;
00237 for (j = 1; j <= i__1; ++j) {
00238 i__2 = *m;
00239 for (i__ = 1; i__ <= i__2; ++i__) {
00240 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
00241
00242 }
00243
00244 }
00245 }
00246 return 0;
00247 }
00248
00249
00250
00251 if (lsame_(side, "L")) {
00252
00253
00254
00255 if (upper) {
00256 i__1 = *n;
00257 for (j = 1; j <= i__1; ++j) {
00258 i__2 = *m;
00259 for (i__ = 1; i__ <= i__2; ++i__) {
00260 temp1 = *alpha * b[i__ + j * b_dim1];
00261 temp2 = 0.;
00262 i__3 = i__ - 1;
00263 for (k = 1; k <= i__3; ++k) {
00264 c__[k + j * c_dim1] += temp1 * a[k + i__ * a_dim1];
00265 temp2 += b[k + j * b_dim1] * a[k + i__ * a_dim1];
00266
00267 }
00268 if (*beta == 0.) {
00269 c__[i__ + j * c_dim1] = temp1 * a[i__ + i__ * a_dim1]
00270 + *alpha * temp2;
00271 } else {
00272 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1]
00273 + temp1 * a[i__ + i__ * a_dim1] + *alpha *
00274 temp2;
00275 }
00276
00277 }
00278
00279 }
00280 } else {
00281 i__1 = *n;
00282 for (j = 1; j <= i__1; ++j) {
00283 for (i__ = *m; i__ >= 1; --i__) {
00284 temp1 = *alpha * b[i__ + j * b_dim1];
00285 temp2 = 0.;
00286 i__2 = *m;
00287 for (k = i__ + 1; k <= i__2; ++k) {
00288 c__[k + j * c_dim1] += temp1 * a[k + i__ * a_dim1];
00289 temp2 += b[k + j * b_dim1] * a[k + i__ * a_dim1];
00290
00291 }
00292 if (*beta == 0.) {
00293 c__[i__ + j * c_dim1] = temp1 * a[i__ + i__ * a_dim1]
00294 + *alpha * temp2;
00295 } else {
00296 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1]
00297 + temp1 * a[i__ + i__ * a_dim1] + *alpha *
00298 temp2;
00299 }
00300
00301 }
00302
00303 }
00304 }
00305 } else {
00306
00307
00308
00309 i__1 = *n;
00310 for (j = 1; j <= i__1; ++j) {
00311 temp1 = *alpha * a[j + j * a_dim1];
00312 if (*beta == 0.) {
00313 i__2 = *m;
00314 for (i__ = 1; i__ <= i__2; ++i__) {
00315 c__[i__ + j * c_dim1] = temp1 * b[i__ + j * b_dim1];
00316
00317 }
00318 } else {
00319 i__2 = *m;
00320 for (i__ = 1; i__ <= i__2; ++i__) {
00321 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1] +
00322 temp1 * b[i__ + j * b_dim1];
00323
00324 }
00325 }
00326 i__2 = j - 1;
00327 for (k = 1; k <= i__2; ++k) {
00328 if (upper) {
00329 temp1 = *alpha * a[k + j * a_dim1];
00330 } else {
00331 temp1 = *alpha * a[j + k * a_dim1];
00332 }
00333 i__3 = *m;
00334 for (i__ = 1; i__ <= i__3; ++i__) {
00335 c__[i__ + j * c_dim1] += temp1 * b[i__ + k * b_dim1];
00336
00337 }
00338
00339 }
00340 i__2 = *n;
00341 for (k = j + 1; k <= i__2; ++k) {
00342 if (upper) {
00343 temp1 = *alpha * a[j + k * a_dim1];
00344 } else {
00345 temp1 = *alpha * a[k + j * a_dim1];
00346 }
00347 i__3 = *m;
00348 for (i__ = 1; i__ <= i__3; ++i__) {
00349 c__[i__ + j * c_dim1] += temp1 * b[i__ + k * b_dim1];
00350
00351 }
00352
00353 }
00354
00355 }
00356 }
00357
00358 return 0;
00359
00360
00361
00362 }