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
00020 int zpbcon_(char *uplo, integer *n, integer *kd,
00021 doublecomplex *ab, integer *ldab, doublereal *anorm, doublereal *
00022 rcond, doublecomplex *work, doublereal *rwork, integer *info)
00023 {
00024
00025 integer ab_dim1, ab_offset, i__1;
00026 doublereal d__1, d__2;
00027
00028
00029 double d_imag(doublecomplex *);
00030
00031
00032 integer ix, kase;
00033 doublereal scale;
00034 extern logical lsame_(char *, char *);
00035 integer isave[3];
00036 logical upper;
00037 extern int zlacn2_(integer *, doublecomplex *,
00038 doublecomplex *, doublereal *, integer *, integer *);
00039 extern doublereal dlamch_(char *);
00040 doublereal scalel, scaleu;
00041 extern int xerbla_(char *, integer *);
00042 doublereal ainvnm;
00043 extern integer izamax_(integer *, doublecomplex *, integer *);
00044 extern int zlatbs_(char *, char *, char *, char *,
00045 integer *, integer *, doublecomplex *, integer *, doublecomplex *,
00046 doublereal *, doublereal *, integer *), zdrscl_(integer *, doublereal *, doublecomplex *,
00047 integer *);
00048 char normin[1];
00049 doublereal smlnum;
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 ab_dim1 = *ldab;
00139 ab_offset = 1 + ab_dim1;
00140 ab -= ab_offset;
00141 --work;
00142 --rwork;
00143
00144
00145 *info = 0;
00146 upper = lsame_(uplo, "U");
00147 if (! upper && ! lsame_(uplo, "L")) {
00148 *info = -1;
00149 } else if (*n < 0) {
00150 *info = -2;
00151 } else if (*kd < 0) {
00152 *info = -3;
00153 } else if (*ldab < *kd + 1) {
00154 *info = -5;
00155 } else if (*anorm < 0.) {
00156 *info = -6;
00157 }
00158 if (*info != 0) {
00159 i__1 = -(*info);
00160 xerbla_("ZPBCON", &i__1);
00161 return 0;
00162 }
00163
00164
00165
00166 *rcond = 0.;
00167 if (*n == 0) {
00168 *rcond = 1.;
00169 return 0;
00170 } else if (*anorm == 0.) {
00171 return 0;
00172 }
00173
00174 smlnum = dlamch_("Safe minimum");
00175
00176
00177
00178 kase = 0;
00179 *(unsigned char *)normin = 'N';
00180 L10:
00181 zlacn2_(n, &work[*n + 1], &work[1], &ainvnm, &kase, isave);
00182 if (kase != 0) {
00183 if (upper) {
00184
00185
00186
00187 zlatbs_("Upper", "Conjugate transpose", "Non-unit", normin, n, kd,
00188 &ab[ab_offset], ldab, &work[1], &scalel, &rwork[1], info);
00189 *(unsigned char *)normin = 'Y';
00190
00191
00192
00193 zlatbs_("Upper", "No transpose", "Non-unit", normin, n, kd, &ab[
00194 ab_offset], ldab, &work[1], &scaleu, &rwork[1], info);
00195 } else {
00196
00197
00198
00199 zlatbs_("Lower", "No transpose", "Non-unit", normin, n, kd, &ab[
00200 ab_offset], ldab, &work[1], &scalel, &rwork[1], info);
00201 *(unsigned char *)normin = 'Y';
00202
00203
00204
00205 zlatbs_("Lower", "Conjugate transpose", "Non-unit", normin, n, kd,
00206 &ab[ab_offset], ldab, &work[1], &scaleu, &rwork[1], info);
00207 }
00208
00209
00210
00211 scale = scalel * scaleu;
00212 if (scale != 1.) {
00213 ix = izamax_(n, &work[1], &c__1);
00214 i__1 = ix;
00215 if (scale < ((d__1 = work[i__1].r, abs(d__1)) + (d__2 = d_imag(&
00216 work[ix]), abs(d__2))) * smlnum || scale == 0.) {
00217 goto L20;
00218 }
00219 zdrscl_(n, &scale, &work[1], &c__1);
00220 }
00221 goto L10;
00222 }
00223
00224
00225
00226 if (ainvnm != 0.) {
00227 *rcond = 1. / ainvnm / *anorm;
00228 }
00229
00230 L20:
00231
00232 return 0;
00233
00234
00235
00236 }