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 doublecomplex c_b1 = {1.,0.};
00019 static integer c__1 = 1;
00020 static integer c_n1 = -1;
00021 static doublereal c_b21 = -1.;
00022 static doublereal c_b22 = 1.;
00023 static integer c__33 = 33;
00024
00025 int zpbtrf_(char *uplo, integer *n, integer *kd,
00026 doublecomplex *ab, integer *ldab, integer *info)
00027 {
00028
00029 integer ab_dim1, ab_offset, i__1, i__2, i__3, i__4, i__5, i__6;
00030 doublecomplex z__1;
00031
00032
00033 integer i__, j, i2, i3, ib, nb, ii, jj;
00034 doublecomplex work[1056] ;
00035 extern logical lsame_(char *, char *);
00036 extern int zgemm_(char *, char *, integer *, integer *,
00037 integer *, doublecomplex *, doublecomplex *, integer *,
00038 doublecomplex *, integer *, doublecomplex *, doublecomplex *,
00039 integer *), zherk_(char *, char *, integer *,
00040 integer *, doublereal *, doublecomplex *, integer *, doublereal *,
00041 doublecomplex *, integer *), ztrsm_(char *, char
00042 *, char *, char *, integer *, integer *, doublecomplex *,
00043 doublecomplex *, integer *, doublecomplex *, integer *), zpbtf2_(char *, integer *, integer *,
00044 doublecomplex *, integer *, integer *), zpotf2_(char *,
00045 integer *, doublecomplex *, integer *, integer *),
00046 xerbla_(char *, integer *);
00047 extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
00048 integer *, integer *);
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 ab_dim1 = *ldab;
00152 ab_offset = 1 + ab_dim1;
00153 ab -= ab_offset;
00154
00155
00156 *info = 0;
00157 if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) {
00158 *info = -1;
00159 } else if (*n < 0) {
00160 *info = -2;
00161 } else if (*kd < 0) {
00162 *info = -3;
00163 } else if (*ldab < *kd + 1) {
00164 *info = -5;
00165 }
00166 if (*info != 0) {
00167 i__1 = -(*info);
00168 xerbla_("ZPBTRF", &i__1);
00169 return 0;
00170 }
00171
00172
00173
00174 if (*n == 0) {
00175 return 0;
00176 }
00177
00178
00179
00180 nb = ilaenv_(&c__1, "ZPBTRF", uplo, n, kd, &c_n1, &c_n1);
00181
00182
00183
00184
00185 nb = min(nb,32);
00186
00187 if (nb <= 1 || nb > *kd) {
00188
00189
00190
00191 zpbtf2_(uplo, n, kd, &ab[ab_offset], ldab, info);
00192 } else {
00193
00194
00195
00196 if (lsame_(uplo, "U")) {
00197
00198
00199
00200
00201
00202
00203
00204 i__1 = nb;
00205 for (j = 1; j <= i__1; ++j) {
00206 i__2 = j - 1;
00207 for (i__ = 1; i__ <= i__2; ++i__) {
00208 i__3 = i__ + j * 33 - 34;
00209 work[i__3].r = 0., work[i__3].i = 0.;
00210
00211 }
00212
00213 }
00214
00215
00216
00217 i__1 = *n;
00218 i__2 = nb;
00219 for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
00220
00221 i__3 = nb, i__4 = *n - i__ + 1;
00222 ib = min(i__3,i__4);
00223
00224
00225
00226 i__3 = *ldab - 1;
00227 zpotf2_(uplo, &ib, &ab[*kd + 1 + i__ * ab_dim1], &i__3, &ii);
00228 if (ii != 0) {
00229 *info = i__ + ii - 1;
00230 goto L150;
00231 }
00232 if (i__ + ib <= *n) {
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249 i__3 = *kd - ib, i__4 = *n - i__ - ib + 1;
00250 i2 = min(i__3,i__4);
00251
00252 i__3 = ib, i__4 = *n - i__ - *kd + 1;
00253 i3 = min(i__3,i__4);
00254
00255 if (i2 > 0) {
00256
00257
00258
00259 i__3 = *ldab - 1;
00260 i__4 = *ldab - 1;
00261 ztrsm_("Left", "Upper", "Conjugate transpose", "Non-"
00262 "unit", &ib, &i2, &c_b1, &ab[*kd + 1 + i__ *
00263 ab_dim1], &i__3, &ab[*kd + 1 - ib + (i__ + ib)
00264 * ab_dim1], &i__4);
00265
00266
00267
00268 i__3 = *ldab - 1;
00269 i__4 = *ldab - 1;
00270 zherk_("Upper", "Conjugate transpose", &i2, &ib, &
00271 c_b21, &ab[*kd + 1 - ib + (i__ + ib) *
00272 ab_dim1], &i__3, &c_b22, &ab[*kd + 1 + (i__ +
00273 ib) * ab_dim1], &i__4);
00274 }
00275
00276 if (i3 > 0) {
00277
00278
00279
00280 i__3 = i3;
00281 for (jj = 1; jj <= i__3; ++jj) {
00282 i__4 = ib;
00283 for (ii = jj; ii <= i__4; ++ii) {
00284 i__5 = ii + jj * 33 - 34;
00285 i__6 = ii - jj + 1 + (jj + i__ + *kd - 1) *
00286 ab_dim1;
00287 work[i__5].r = ab[i__6].r, work[i__5].i = ab[
00288 i__6].i;
00289
00290 }
00291
00292 }
00293
00294
00295
00296 i__3 = *ldab - 1;
00297 ztrsm_("Left", "Upper", "Conjugate transpose", "Non-"
00298 "unit", &ib, &i3, &c_b1, &ab[*kd + 1 + i__ *
00299 ab_dim1], &i__3, work, &c__33);
00300
00301
00302
00303 if (i2 > 0) {
00304 z__1.r = -1., z__1.i = -0.;
00305 i__3 = *ldab - 1;
00306 i__4 = *ldab - 1;
00307 zgemm_("Conjugate transpose", "No transpose", &i2,
00308 &i3, &ib, &z__1, &ab[*kd + 1 - ib + (i__
00309 + ib) * ab_dim1], &i__3, work, &c__33, &
00310 c_b1, &ab[ib + 1 + (i__ + *kd) * ab_dim1],
00311 &i__4);
00312 }
00313
00314
00315
00316 i__3 = *ldab - 1;
00317 zherk_("Upper", "Conjugate transpose", &i3, &ib, &
00318 c_b21, work, &c__33, &c_b22, &ab[*kd + 1 + (
00319 i__ + *kd) * ab_dim1], &i__3);
00320
00321
00322
00323 i__3 = i3;
00324 for (jj = 1; jj <= i__3; ++jj) {
00325 i__4 = ib;
00326 for (ii = jj; ii <= i__4; ++ii) {
00327 i__5 = ii - jj + 1 + (jj + i__ + *kd - 1) *
00328 ab_dim1;
00329 i__6 = ii + jj * 33 - 34;
00330 ab[i__5].r = work[i__6].r, ab[i__5].i = work[
00331 i__6].i;
00332
00333 }
00334
00335 }
00336 }
00337 }
00338
00339 }
00340 } else {
00341
00342
00343
00344
00345
00346
00347
00348 i__2 = nb;
00349 for (j = 1; j <= i__2; ++j) {
00350 i__1 = nb;
00351 for (i__ = j + 1; i__ <= i__1; ++i__) {
00352 i__3 = i__ + j * 33 - 34;
00353 work[i__3].r = 0., work[i__3].i = 0.;
00354
00355 }
00356
00357 }
00358
00359
00360
00361 i__2 = *n;
00362 i__1 = nb;
00363 for (i__ = 1; i__1 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__1) {
00364
00365 i__3 = nb, i__4 = *n - i__ + 1;
00366 ib = min(i__3,i__4);
00367
00368
00369
00370 i__3 = *ldab - 1;
00371 zpotf2_(uplo, &ib, &ab[i__ * ab_dim1 + 1], &i__3, &ii);
00372 if (ii != 0) {
00373 *info = i__ + ii - 1;
00374 goto L150;
00375 }
00376 if (i__ + ib <= *n) {
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393 i__3 = *kd - ib, i__4 = *n - i__ - ib + 1;
00394 i2 = min(i__3,i__4);
00395
00396 i__3 = ib, i__4 = *n - i__ - *kd + 1;
00397 i3 = min(i__3,i__4);
00398
00399 if (i2 > 0) {
00400
00401
00402
00403 i__3 = *ldab - 1;
00404 i__4 = *ldab - 1;
00405 ztrsm_("Right", "Lower", "Conjugate transpose", "Non"
00406 "-unit", &i2, &ib, &c_b1, &ab[i__ * ab_dim1 +
00407 1], &i__3, &ab[ib + 1 + i__ * ab_dim1], &i__4);
00408
00409
00410
00411 i__3 = *ldab - 1;
00412 i__4 = *ldab - 1;
00413 zherk_("Lower", "No transpose", &i2, &ib, &c_b21, &ab[
00414 ib + 1 + i__ * ab_dim1], &i__3, &c_b22, &ab[(
00415 i__ + ib) * ab_dim1 + 1], &i__4);
00416 }
00417
00418 if (i3 > 0) {
00419
00420
00421
00422 i__3 = ib;
00423 for (jj = 1; jj <= i__3; ++jj) {
00424 i__4 = min(jj,i3);
00425 for (ii = 1; ii <= i__4; ++ii) {
00426 i__5 = ii + jj * 33 - 34;
00427 i__6 = *kd + 1 - jj + ii + (jj + i__ - 1) *
00428 ab_dim1;
00429 work[i__5].r = ab[i__6].r, work[i__5].i = ab[
00430 i__6].i;
00431
00432 }
00433
00434 }
00435
00436
00437
00438 i__3 = *ldab - 1;
00439 ztrsm_("Right", "Lower", "Conjugate transpose", "Non"
00440 "-unit", &i3, &ib, &c_b1, &ab[i__ * ab_dim1 +
00441 1], &i__3, work, &c__33);
00442
00443
00444
00445 if (i2 > 0) {
00446 z__1.r = -1., z__1.i = -0.;
00447 i__3 = *ldab - 1;
00448 i__4 = *ldab - 1;
00449 zgemm_("No transpose", "Conjugate transpose", &i3,
00450 &i2, &ib, &z__1, work, &c__33, &ab[ib +
00451 1 + i__ * ab_dim1], &i__3, &c_b1, &ab[*kd
00452 + 1 - ib + (i__ + ib) * ab_dim1], &i__4);
00453 }
00454
00455
00456
00457 i__3 = *ldab - 1;
00458 zherk_("Lower", "No transpose", &i3, &ib, &c_b21,
00459 work, &c__33, &c_b22, &ab[(i__ + *kd) *
00460 ab_dim1 + 1], &i__3);
00461
00462
00463
00464 i__3 = ib;
00465 for (jj = 1; jj <= i__3; ++jj) {
00466 i__4 = min(jj,i3);
00467 for (ii = 1; ii <= i__4; ++ii) {
00468 i__5 = *kd + 1 - jj + ii + (jj + i__ - 1) *
00469 ab_dim1;
00470 i__6 = ii + jj * 33 - 34;
00471 ab[i__5].r = work[i__6].r, ab[i__5].i = work[
00472 i__6].i;
00473
00474 }
00475
00476 }
00477 }
00478 }
00479
00480 }
00481 }
00482 }
00483 return 0;
00484
00485 L150:
00486 return 0;
00487
00488
00489
00490 }