00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016 int zsymm_(char *side, char *uplo, integer *m, integer *n,
00017 doublecomplex *alpha, doublecomplex *a, integer *lda, doublecomplex *
00018 b, integer *ldb, doublecomplex *beta, doublecomplex *c__, integer *
00019 ldc)
00020 {
00021
00022 integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2,
00023 i__3, i__4, i__5, i__6;
00024 doublecomplex z__1, z__2, z__3, z__4, z__5;
00025
00026
00027 integer i__, j, k, info;
00028 doublecomplex temp1, temp2;
00029 extern logical lsame_(char *, char *);
00030 integer nrowa;
00031 logical upper;
00032 extern int xerbla_(char *, integer *);
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
00176
00177 a_dim1 = *lda;
00178 a_offset = 1 + a_dim1;
00179 a -= a_offset;
00180 b_dim1 = *ldb;
00181 b_offset = 1 + b_dim1;
00182 b -= b_offset;
00183 c_dim1 = *ldc;
00184 c_offset = 1 + c_dim1;
00185 c__ -= c_offset;
00186
00187
00188 if (lsame_(side, "L")) {
00189 nrowa = *m;
00190 } else {
00191 nrowa = *n;
00192 }
00193 upper = lsame_(uplo, "U");
00194
00195
00196
00197 info = 0;
00198 if (! lsame_(side, "L") && ! lsame_(side, "R")) {
00199 info = 1;
00200 } else if (! upper && ! lsame_(uplo, "L")) {
00201 info = 2;
00202 } else if (*m < 0) {
00203 info = 3;
00204 } else if (*n < 0) {
00205 info = 4;
00206 } else if (*lda < max(1,nrowa)) {
00207 info = 7;
00208 } else if (*ldb < max(1,*m)) {
00209 info = 9;
00210 } else if (*ldc < max(1,*m)) {
00211 info = 12;
00212 }
00213 if (info != 0) {
00214 xerbla_("ZSYMM ", &info);
00215 return 0;
00216 }
00217
00218
00219
00220 if (*m == 0 || *n == 0 || alpha->r == 0. && alpha->i == 0. && (beta->r ==
00221 1. && beta->i == 0.)) {
00222 return 0;
00223 }
00224
00225
00226
00227 if (alpha->r == 0. && alpha->i == 0.) {
00228 if (beta->r == 0. && beta->i == 0.) {
00229 i__1 = *n;
00230 for (j = 1; j <= i__1; ++j) {
00231 i__2 = *m;
00232 for (i__ = 1; i__ <= i__2; ++i__) {
00233 i__3 = i__ + j * c_dim1;
00234 c__[i__3].r = 0., c__[i__3].i = 0.;
00235
00236 }
00237
00238 }
00239 } else {
00240 i__1 = *n;
00241 for (j = 1; j <= i__1; ++j) {
00242 i__2 = *m;
00243 for (i__ = 1; i__ <= i__2; ++i__) {
00244 i__3 = i__ + j * c_dim1;
00245 i__4 = i__ + j * c_dim1;
00246 z__1.r = beta->r * c__[i__4].r - beta->i * c__[i__4].i,
00247 z__1.i = beta->r * c__[i__4].i + beta->i * c__[
00248 i__4].r;
00249 c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
00250
00251 }
00252
00253 }
00254 }
00255 return 0;
00256 }
00257
00258
00259
00260 if (lsame_(side, "L")) {
00261
00262
00263
00264 if (upper) {
00265 i__1 = *n;
00266 for (j = 1; j <= i__1; ++j) {
00267 i__2 = *m;
00268 for (i__ = 1; i__ <= i__2; ++i__) {
00269 i__3 = i__ + j * b_dim1;
00270 z__1.r = alpha->r * b[i__3].r - alpha->i * b[i__3].i,
00271 z__1.i = alpha->r * b[i__3].i + alpha->i * b[i__3]
00272 .r;
00273 temp1.r = z__1.r, temp1.i = z__1.i;
00274 temp2.r = 0., temp2.i = 0.;
00275 i__3 = i__ - 1;
00276 for (k = 1; k <= i__3; ++k) {
00277 i__4 = k + j * c_dim1;
00278 i__5 = k + j * c_dim1;
00279 i__6 = k + i__ * a_dim1;
00280 z__2.r = temp1.r * a[i__6].r - temp1.i * a[i__6].i,
00281 z__2.i = temp1.r * a[i__6].i + temp1.i * a[
00282 i__6].r;
00283 z__1.r = c__[i__5].r + z__2.r, z__1.i = c__[i__5].i +
00284 z__2.i;
00285 c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
00286 i__4 = k + j * b_dim1;
00287 i__5 = k + i__ * a_dim1;
00288 z__2.r = b[i__4].r * a[i__5].r - b[i__4].i * a[i__5]
00289 .i, z__2.i = b[i__4].r * a[i__5].i + b[i__4]
00290 .i * a[i__5].r;
00291 z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i;
00292 temp2.r = z__1.r, temp2.i = z__1.i;
00293
00294 }
00295 if (beta->r == 0. && beta->i == 0.) {
00296 i__3 = i__ + j * c_dim1;
00297 i__4 = i__ + i__ * a_dim1;
00298 z__2.r = temp1.r * a[i__4].r - temp1.i * a[i__4].i,
00299 z__2.i = temp1.r * a[i__4].i + temp1.i * a[
00300 i__4].r;
00301 z__3.r = alpha->r * temp2.r - alpha->i * temp2.i,
00302 z__3.i = alpha->r * temp2.i + alpha->i *
00303 temp2.r;
00304 z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
00305 c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
00306 } else {
00307 i__3 = i__ + j * c_dim1;
00308 i__4 = i__ + j * c_dim1;
00309 z__3.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
00310 .i, z__3.i = beta->r * c__[i__4].i + beta->i *
00311 c__[i__4].r;
00312 i__5 = i__ + i__ * a_dim1;
00313 z__4.r = temp1.r * a[i__5].r - temp1.i * a[i__5].i,
00314 z__4.i = temp1.r * a[i__5].i + temp1.i * a[
00315 i__5].r;
00316 z__2.r = z__3.r + z__4.r, z__2.i = z__3.i + z__4.i;
00317 z__5.r = alpha->r * temp2.r - alpha->i * temp2.i,
00318 z__5.i = alpha->r * temp2.i + alpha->i *
00319 temp2.r;
00320 z__1.r = z__2.r + z__5.r, z__1.i = z__2.i + z__5.i;
00321 c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
00322 }
00323
00324 }
00325
00326 }
00327 } else {
00328 i__1 = *n;
00329 for (j = 1; j <= i__1; ++j) {
00330 for (i__ = *m; i__ >= 1; --i__) {
00331 i__2 = i__ + j * b_dim1;
00332 z__1.r = alpha->r * b[i__2].r - alpha->i * b[i__2].i,
00333 z__1.i = alpha->r * b[i__2].i + alpha->i * b[i__2]
00334 .r;
00335 temp1.r = z__1.r, temp1.i = z__1.i;
00336 temp2.r = 0., temp2.i = 0.;
00337 i__2 = *m;
00338 for (k = i__ + 1; k <= i__2; ++k) {
00339 i__3 = k + j * c_dim1;
00340 i__4 = k + j * c_dim1;
00341 i__5 = k + i__ * a_dim1;
00342 z__2.r = temp1.r * a[i__5].r - temp1.i * a[i__5].i,
00343 z__2.i = temp1.r * a[i__5].i + temp1.i * a[
00344 i__5].r;
00345 z__1.r = c__[i__4].r + z__2.r, z__1.i = c__[i__4].i +
00346 z__2.i;
00347 c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
00348 i__3 = k + j * b_dim1;
00349 i__4 = k + i__ * a_dim1;
00350 z__2.r = b[i__3].r * a[i__4].r - b[i__3].i * a[i__4]
00351 .i, z__2.i = b[i__3].r * a[i__4].i + b[i__3]
00352 .i * a[i__4].r;
00353 z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i;
00354 temp2.r = z__1.r, temp2.i = z__1.i;
00355
00356 }
00357 if (beta->r == 0. && beta->i == 0.) {
00358 i__2 = i__ + j * c_dim1;
00359 i__3 = i__ + i__ * a_dim1;
00360 z__2.r = temp1.r * a[i__3].r - temp1.i * a[i__3].i,
00361 z__2.i = temp1.r * a[i__3].i + temp1.i * a[
00362 i__3].r;
00363 z__3.r = alpha->r * temp2.r - alpha->i * temp2.i,
00364 z__3.i = alpha->r * temp2.i + alpha->i *
00365 temp2.r;
00366 z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
00367 c__[i__2].r = z__1.r, c__[i__2].i = z__1.i;
00368 } else {
00369 i__2 = i__ + j * c_dim1;
00370 i__3 = i__ + j * c_dim1;
00371 z__3.r = beta->r * c__[i__3].r - beta->i * c__[i__3]
00372 .i, z__3.i = beta->r * c__[i__3].i + beta->i *
00373 c__[i__3].r;
00374 i__4 = i__ + i__ * a_dim1;
00375 z__4.r = temp1.r * a[i__4].r - temp1.i * a[i__4].i,
00376 z__4.i = temp1.r * a[i__4].i + temp1.i * a[
00377 i__4].r;
00378 z__2.r = z__3.r + z__4.r, z__2.i = z__3.i + z__4.i;
00379 z__5.r = alpha->r * temp2.r - alpha->i * temp2.i,
00380 z__5.i = alpha->r * temp2.i + alpha->i *
00381 temp2.r;
00382 z__1.r = z__2.r + z__5.r, z__1.i = z__2.i + z__5.i;
00383 c__[i__2].r = z__1.r, c__[i__2].i = z__1.i;
00384 }
00385
00386 }
00387
00388 }
00389 }
00390 } else {
00391
00392
00393
00394 i__1 = *n;
00395 for (j = 1; j <= i__1; ++j) {
00396 i__2 = j + j * a_dim1;
00397 z__1.r = alpha->r * a[i__2].r - alpha->i * a[i__2].i, z__1.i =
00398 alpha->r * a[i__2].i + alpha->i * a[i__2].r;
00399 temp1.r = z__1.r, temp1.i = z__1.i;
00400 if (beta->r == 0. && beta->i == 0.) {
00401 i__2 = *m;
00402 for (i__ = 1; i__ <= i__2; ++i__) {
00403 i__3 = i__ + j * c_dim1;
00404 i__4 = i__ + j * b_dim1;
00405 z__1.r = temp1.r * b[i__4].r - temp1.i * b[i__4].i,
00406 z__1.i = temp1.r * b[i__4].i + temp1.i * b[i__4]
00407 .r;
00408 c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
00409
00410 }
00411 } else {
00412 i__2 = *m;
00413 for (i__ = 1; i__ <= i__2; ++i__) {
00414 i__3 = i__ + j * c_dim1;
00415 i__4 = i__ + j * c_dim1;
00416 z__2.r = beta->r * c__[i__4].r - beta->i * c__[i__4].i,
00417 z__2.i = beta->r * c__[i__4].i + beta->i * c__[
00418 i__4].r;
00419 i__5 = i__ + j * b_dim1;
00420 z__3.r = temp1.r * b[i__5].r - temp1.i * b[i__5].i,
00421 z__3.i = temp1.r * b[i__5].i + temp1.i * b[i__5]
00422 .r;
00423 z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
00424 c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
00425
00426 }
00427 }
00428 i__2 = j - 1;
00429 for (k = 1; k <= i__2; ++k) {
00430 if (upper) {
00431 i__3 = k + j * a_dim1;
00432 z__1.r = alpha->r * a[i__3].r - alpha->i * a[i__3].i,
00433 z__1.i = alpha->r * a[i__3].i + alpha->i * a[i__3]
00434 .r;
00435 temp1.r = z__1.r, temp1.i = z__1.i;
00436 } else {
00437 i__3 = j + k * a_dim1;
00438 z__1.r = alpha->r * a[i__3].r - alpha->i * a[i__3].i,
00439 z__1.i = alpha->r * a[i__3].i + alpha->i * a[i__3]
00440 .r;
00441 temp1.r = z__1.r, temp1.i = z__1.i;
00442 }
00443 i__3 = *m;
00444 for (i__ = 1; i__ <= i__3; ++i__) {
00445 i__4 = i__ + j * c_dim1;
00446 i__5 = i__ + j * c_dim1;
00447 i__6 = i__ + k * b_dim1;
00448 z__2.r = temp1.r * b[i__6].r - temp1.i * b[i__6].i,
00449 z__2.i = temp1.r * b[i__6].i + temp1.i * b[i__6]
00450 .r;
00451 z__1.r = c__[i__5].r + z__2.r, z__1.i = c__[i__5].i +
00452 z__2.i;
00453 c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
00454
00455 }
00456
00457 }
00458 i__2 = *n;
00459 for (k = j + 1; k <= i__2; ++k) {
00460 if (upper) {
00461 i__3 = j + k * a_dim1;
00462 z__1.r = alpha->r * a[i__3].r - alpha->i * a[i__3].i,
00463 z__1.i = alpha->r * a[i__3].i + alpha->i * a[i__3]
00464 .r;
00465 temp1.r = z__1.r, temp1.i = z__1.i;
00466 } else {
00467 i__3 = k + j * a_dim1;
00468 z__1.r = alpha->r * a[i__3].r - alpha->i * a[i__3].i,
00469 z__1.i = alpha->r * a[i__3].i + alpha->i * a[i__3]
00470 .r;
00471 temp1.r = z__1.r, temp1.i = z__1.i;
00472 }
00473 i__3 = *m;
00474 for (i__ = 1; i__ <= i__3; ++i__) {
00475 i__4 = i__ + j * c_dim1;
00476 i__5 = i__ + j * c_dim1;
00477 i__6 = i__ + k * b_dim1;
00478 z__2.r = temp1.r * b[i__6].r - temp1.i * b[i__6].i,
00479 z__2.i = temp1.r * b[i__6].i + temp1.i * b[i__6]
00480 .r;
00481 z__1.r = c__[i__5].r + z__2.r, z__1.i = c__[i__5].i +
00482 z__2.i;
00483 c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
00484
00485 }
00486
00487 }
00488
00489 }
00490 }
00491
00492 return 0;
00493
00494
00495
00496 }