ztbrfs.c
Go to the documentation of this file.
00001 /* ztbrfs.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Table of constant values */
00017 
00018 static integer c__1 = 1;
00019 
00020 /* Subroutine */ int ztbrfs_(char *uplo, char *trans, char *diag, integer *n, 
00021         integer *kd, integer *nrhs, doublecomplex *ab, integer *ldab, 
00022         doublecomplex *b, integer *ldb, doublecomplex *x, integer *ldx, 
00023         doublereal *ferr, doublereal *berr, doublecomplex *work, doublereal *
00024         rwork, integer *info)
00025 {
00026     /* System generated locals */
00027     integer ab_dim1, ab_offset, b_dim1, b_offset, x_dim1, x_offset, i__1, 
00028             i__2, i__3, i__4, i__5;
00029     doublereal d__1, d__2, d__3, d__4;
00030     doublecomplex z__1;
00031 
00032     /* Builtin functions */
00033     double d_imag(doublecomplex *);
00034 
00035     /* Local variables */
00036     integer i__, j, k;
00037     doublereal s, xk;
00038     integer nz;
00039     doublereal eps;
00040     integer kase;
00041     doublereal safe1, safe2;
00042     extern logical lsame_(char *, char *);
00043     integer isave[3];
00044     logical upper;
00045     extern /* Subroutine */ int ztbmv_(char *, char *, char *, integer *, 
00046             integer *, doublecomplex *, integer *, doublecomplex *, integer *), zcopy_(integer *, doublecomplex *, 
00047             integer *, doublecomplex *, integer *), ztbsv_(char *, char *, 
00048             char *, integer *, integer *, doublecomplex *, integer *, 
00049             doublecomplex *, integer *), zaxpy_(
00050             integer *, doublecomplex *, doublecomplex *, integer *, 
00051             doublecomplex *, integer *), zlacn2_(integer *, doublecomplex *, 
00052             doublecomplex *, doublereal *, integer *, integer *);
00053     extern doublereal dlamch_(char *);
00054     doublereal safmin;
00055     extern /* Subroutine */ int xerbla_(char *, integer *);
00056     logical notran;
00057     char transn[1], transt[1];
00058     logical nounit;
00059     doublereal lstres;
00060 
00061 
00062 /*  -- LAPACK routine (version 3.2) -- */
00063 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00064 /*     November 2006 */
00065 
00066 /*     Modified to call ZLACN2 in place of ZLACON, 10 Feb 03, SJH. */
00067 
00068 /*     .. Scalar Arguments .. */
00069 /*     .. */
00070 /*     .. Array Arguments .. */
00071 /*     .. */
00072 
00073 /*  Purpose */
00074 /*  ======= */
00075 
00076 /*  ZTBRFS provides error bounds and backward error estimates for the */
00077 /*  solution to a system of linear equations with a triangular band */
00078 /*  coefficient matrix. */
00079 
00080 /*  The solution matrix X must be computed by ZTBTRS or some other */
00081 /*  means before entering this routine.  ZTBRFS does not do iterative */
00082 /*  refinement because doing so cannot improve the backward error. */
00083 
00084 /*  Arguments */
00085 /*  ========= */
00086 
00087 /*  UPLO    (input) CHARACTER*1 */
00088 /*          = 'U':  A is upper triangular; */
00089 /*          = 'L':  A is lower triangular. */
00090 
00091 /*  TRANS   (input) CHARACTER*1 */
00092 /*          Specifies the form of the system of equations: */
00093 /*          = 'N':  A * X = B     (No transpose) */
00094 /*          = 'T':  A**T * X = B  (Transpose) */
00095 /*          = 'C':  A**H * X = B  (Conjugate transpose) */
00096 
00097 /*  DIAG    (input) CHARACTER*1 */
00098 /*          = 'N':  A is non-unit triangular; */
00099 /*          = 'U':  A is unit triangular. */
00100 
00101 /*  N       (input) INTEGER */
00102 /*          The order of the matrix A.  N >= 0. */
00103 
00104 /*  KD      (input) INTEGER */
00105 /*          The number of superdiagonals or subdiagonals of the */
00106 /*          triangular band matrix A.  KD >= 0. */
00107 
00108 /*  NRHS    (input) INTEGER */
00109 /*          The number of right hand sides, i.e., the number of columns */
00110 /*          of the matrices B and X.  NRHS >= 0. */
00111 
00112 /*  AB      (input) COMPLEX*16 array, dimension (LDAB,N) */
00113 /*          The upper or lower triangular band matrix A, stored in the */
00114 /*          first kd+1 rows of the array. The j-th column of A is stored */
00115 /*          in the j-th column of the array AB as follows: */
00116 /*          if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j; */
00117 /*          if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j<=i<=min(n,j+kd). */
00118 /*          If DIAG = 'U', the diagonal elements of A are not referenced */
00119 /*          and are assumed to be 1. */
00120 
00121 /*  LDAB    (input) INTEGER */
00122 /*          The leading dimension of the array AB.  LDAB >= KD+1. */
00123 
00124 /*  B       (input) COMPLEX*16 array, dimension (LDB,NRHS) */
00125 /*          The right hand side matrix B. */
00126 
00127 /*  LDB     (input) INTEGER */
00128 /*          The leading dimension of the array B.  LDB >= max(1,N). */
00129 
00130 /*  X       (input) COMPLEX*16 array, dimension (LDX,NRHS) */
00131 /*          The solution matrix X. */
00132 
00133 /*  LDX     (input) INTEGER */
00134 /*          The leading dimension of the array X.  LDX >= max(1,N). */
00135 
00136 /*  FERR    (output) DOUBLE PRECISION array, dimension (NRHS) */
00137 /*          The estimated forward error bound for each solution vector */
00138 /*          X(j) (the j-th column of the solution matrix X). */
00139 /*          If XTRUE is the true solution corresponding to X(j), FERR(j) */
00140 /*          is an estimated upper bound for the magnitude of the largest */
00141 /*          element in (X(j) - XTRUE) divided by the magnitude of the */
00142 /*          largest element in X(j).  The estimate is as reliable as */
00143 /*          the estimate for RCOND, and is almost always a slight */
00144 /*          overestimate of the true error. */
00145 
00146 /*  BERR    (output) DOUBLE PRECISION array, dimension (NRHS) */
00147 /*          The componentwise relative backward error of each solution */
00148 /*          vector X(j) (i.e., the smallest relative change in */
00149 /*          any element of A or B that makes X(j) an exact solution). */
00150 
00151 /*  WORK    (workspace) COMPLEX*16 array, dimension (2*N) */
00152 
00153 /*  RWORK   (workspace) DOUBLE PRECISION array, dimension (N) */
00154 
00155 /*  INFO    (output) INTEGER */
00156 /*          = 0:  successful exit */
00157 /*          < 0:  if INFO = -i, the i-th argument had an illegal value */
00158 
00159 /*  ===================================================================== */
00160 
00161 /*     .. Parameters .. */
00162 /*     .. */
00163 /*     .. Local Scalars .. */
00164 /*     .. */
00165 /*     .. Local Arrays .. */
00166 /*     .. */
00167 /*     .. External Subroutines .. */
00168 /*     .. */
00169 /*     .. Intrinsic Functions .. */
00170 /*     .. */
00171 /*     .. External Functions .. */
00172 /*     .. */
00173 /*     .. Statement Functions .. */
00174 /*     .. */
00175 /*     .. Statement Function definitions .. */
00176 /*     .. */
00177 /*     .. Executable Statements .. */
00178 
00179 /*     Test the input parameters. */
00180 
00181     /* Parameter adjustments */
00182     ab_dim1 = *ldab;
00183     ab_offset = 1 + ab_dim1;
00184     ab -= ab_offset;
00185     b_dim1 = *ldb;
00186     b_offset = 1 + b_dim1;
00187     b -= b_offset;
00188     x_dim1 = *ldx;
00189     x_offset = 1 + x_dim1;
00190     x -= x_offset;
00191     --ferr;
00192     --berr;
00193     --work;
00194     --rwork;
00195 
00196     /* Function Body */
00197     *info = 0;
00198     upper = lsame_(uplo, "U");
00199     notran = lsame_(trans, "N");
00200     nounit = lsame_(diag, "N");
00201 
00202     if (! upper && ! lsame_(uplo, "L")) {
00203         *info = -1;
00204     } else if (! notran && ! lsame_(trans, "T") && ! 
00205             lsame_(trans, "C")) {
00206         *info = -2;
00207     } else if (! nounit && ! lsame_(diag, "U")) {
00208         *info = -3;
00209     } else if (*n < 0) {
00210         *info = -4;
00211     } else if (*kd < 0) {
00212         *info = -5;
00213     } else if (*nrhs < 0) {
00214         *info = -6;
00215     } else if (*ldab < *kd + 1) {
00216         *info = -8;
00217     } else if (*ldb < max(1,*n)) {
00218         *info = -10;
00219     } else if (*ldx < max(1,*n)) {
00220         *info = -12;
00221     }
00222     if (*info != 0) {
00223         i__1 = -(*info);
00224         xerbla_("ZTBRFS", &i__1);
00225         return 0;
00226     }
00227 
00228 /*     Quick return if possible */
00229 
00230     if (*n == 0 || *nrhs == 0) {
00231         i__1 = *nrhs;
00232         for (j = 1; j <= i__1; ++j) {
00233             ferr[j] = 0.;
00234             berr[j] = 0.;
00235 /* L10: */
00236         }
00237         return 0;
00238     }
00239 
00240     if (notran) {
00241         *(unsigned char *)transn = 'N';
00242         *(unsigned char *)transt = 'C';
00243     } else {
00244         *(unsigned char *)transn = 'C';
00245         *(unsigned char *)transt = 'N';
00246     }
00247 
00248 /*     NZ = maximum number of nonzero elements in each row of A, plus 1 */
00249 
00250     nz = *kd + 2;
00251     eps = dlamch_("Epsilon");
00252     safmin = dlamch_("Safe minimum");
00253     safe1 = nz * safmin;
00254     safe2 = safe1 / eps;
00255 
00256 /*     Do for each right hand side */
00257 
00258     i__1 = *nrhs;
00259     for (j = 1; j <= i__1; ++j) {
00260 
00261 /*        Compute residual R = B - op(A) * X, */
00262 /*        where op(A) = A, A**T, or A**H, depending on TRANS. */
00263 
00264         zcopy_(n, &x[j * x_dim1 + 1], &c__1, &work[1], &c__1);
00265         ztbmv_(uplo, trans, diag, n, kd, &ab[ab_offset], ldab, &work[1], &
00266                 c__1);
00267         z__1.r = -1., z__1.i = -0.;
00268         zaxpy_(n, &z__1, &b[j * b_dim1 + 1], &c__1, &work[1], &c__1);
00269 
00270 /*        Compute componentwise relative backward error from formula */
00271 
00272 /*        max(i) ( abs(R(i)) / ( abs(op(A))*abs(X) + abs(B) )(i) ) */
00273 
00274 /*        where abs(Z) is the componentwise absolute value of the matrix */
00275 /*        or vector Z.  If the i-th component of the denominator is less */
00276 /*        than SAFE2, then SAFE1 is added to the i-th components of the */
00277 /*        numerator and denominator before dividing. */
00278 
00279         i__2 = *n;
00280         for (i__ = 1; i__ <= i__2; ++i__) {
00281             i__3 = i__ + j * b_dim1;
00282             rwork[i__] = (d__1 = b[i__3].r, abs(d__1)) + (d__2 = d_imag(&b[
00283                     i__ + j * b_dim1]), abs(d__2));
00284 /* L20: */
00285         }
00286 
00287         if (notran) {
00288 
00289 /*           Compute abs(A)*abs(X) + abs(B). */
00290 
00291             if (upper) {
00292                 if (nounit) {
00293                     i__2 = *n;
00294                     for (k = 1; k <= i__2; ++k) {
00295                         i__3 = k + j * x_dim1;
00296                         xk = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&
00297                                 x[k + j * x_dim1]), abs(d__2));
00298 /* Computing MAX */
00299                         i__3 = 1, i__4 = k - *kd;
00300                         i__5 = k;
00301                         for (i__ = max(i__3,i__4); i__ <= i__5; ++i__) {
00302                             i__3 = *kd + 1 + i__ - k + k * ab_dim1;
00303                             rwork[i__] += ((d__1 = ab[i__3].r, abs(d__1)) + (
00304                                     d__2 = d_imag(&ab[*kd + 1 + i__ - k + k * 
00305                                     ab_dim1]), abs(d__2))) * xk;
00306 /* L30: */
00307                         }
00308 /* L40: */
00309                     }
00310                 } else {
00311                     i__2 = *n;
00312                     for (k = 1; k <= i__2; ++k) {
00313                         i__5 = k + j * x_dim1;
00314                         xk = (d__1 = x[i__5].r, abs(d__1)) + (d__2 = d_imag(&
00315                                 x[k + j * x_dim1]), abs(d__2));
00316 /* Computing MAX */
00317                         i__5 = 1, i__3 = k - *kd;
00318                         i__4 = k - 1;
00319                         for (i__ = max(i__5,i__3); i__ <= i__4; ++i__) {
00320                             i__5 = *kd + 1 + i__ - k + k * ab_dim1;
00321                             rwork[i__] += ((d__1 = ab[i__5].r, abs(d__1)) + (
00322                                     d__2 = d_imag(&ab[*kd + 1 + i__ - k + k * 
00323                                     ab_dim1]), abs(d__2))) * xk;
00324 /* L50: */
00325                         }
00326                         rwork[k] += xk;
00327 /* L60: */
00328                     }
00329                 }
00330             } else {
00331                 if (nounit) {
00332                     i__2 = *n;
00333                     for (k = 1; k <= i__2; ++k) {
00334                         i__4 = k + j * x_dim1;
00335                         xk = (d__1 = x[i__4].r, abs(d__1)) + (d__2 = d_imag(&
00336                                 x[k + j * x_dim1]), abs(d__2));
00337 /* Computing MIN */
00338                         i__5 = *n, i__3 = k + *kd;
00339                         i__4 = min(i__5,i__3);
00340                         for (i__ = k; i__ <= i__4; ++i__) {
00341                             i__5 = i__ + 1 - k + k * ab_dim1;
00342                             rwork[i__] += ((d__1 = ab[i__5].r, abs(d__1)) + (
00343                                     d__2 = d_imag(&ab[i__ + 1 - k + k * 
00344                                     ab_dim1]), abs(d__2))) * xk;
00345 /* L70: */
00346                         }
00347 /* L80: */
00348                     }
00349                 } else {
00350                     i__2 = *n;
00351                     for (k = 1; k <= i__2; ++k) {
00352                         i__4 = k + j * x_dim1;
00353                         xk = (d__1 = x[i__4].r, abs(d__1)) + (d__2 = d_imag(&
00354                                 x[k + j * x_dim1]), abs(d__2));
00355 /* Computing MIN */
00356                         i__5 = *n, i__3 = k + *kd;
00357                         i__4 = min(i__5,i__3);
00358                         for (i__ = k + 1; i__ <= i__4; ++i__) {
00359                             i__5 = i__ + 1 - k + k * ab_dim1;
00360                             rwork[i__] += ((d__1 = ab[i__5].r, abs(d__1)) + (
00361                                     d__2 = d_imag(&ab[i__ + 1 - k + k * 
00362                                     ab_dim1]), abs(d__2))) * xk;
00363 /* L90: */
00364                         }
00365                         rwork[k] += xk;
00366 /* L100: */
00367                     }
00368                 }
00369             }
00370         } else {
00371 
00372 /*           Compute abs(A**H)*abs(X) + abs(B). */
00373 
00374             if (upper) {
00375                 if (nounit) {
00376                     i__2 = *n;
00377                     for (k = 1; k <= i__2; ++k) {
00378                         s = 0.;
00379 /* Computing MAX */
00380                         i__4 = 1, i__5 = k - *kd;
00381                         i__3 = k;
00382                         for (i__ = max(i__4,i__5); i__ <= i__3; ++i__) {
00383                             i__4 = *kd + 1 + i__ - k + k * ab_dim1;
00384                             i__5 = i__ + j * x_dim1;
00385                             s += ((d__1 = ab[i__4].r, abs(d__1)) + (d__2 = 
00386                                     d_imag(&ab[*kd + 1 + i__ - k + k * 
00387                                     ab_dim1]), abs(d__2))) * ((d__3 = x[i__5]
00388                                     .r, abs(d__3)) + (d__4 = d_imag(&x[i__ + 
00389                                     j * x_dim1]), abs(d__4)));
00390 /* L110: */
00391                         }
00392                         rwork[k] += s;
00393 /* L120: */
00394                     }
00395                 } else {
00396                     i__2 = *n;
00397                     for (k = 1; k <= i__2; ++k) {
00398                         i__3 = k + j * x_dim1;
00399                         s = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&x[
00400                                 k + j * x_dim1]), abs(d__2));
00401 /* Computing MAX */
00402                         i__3 = 1, i__4 = k - *kd;
00403                         i__5 = k - 1;
00404                         for (i__ = max(i__3,i__4); i__ <= i__5; ++i__) {
00405                             i__3 = *kd + 1 + i__ - k + k * ab_dim1;
00406                             i__4 = i__ + j * x_dim1;
00407                             s += ((d__1 = ab[i__3].r, abs(d__1)) + (d__2 = 
00408                                     d_imag(&ab[*kd + 1 + i__ - k + k * 
00409                                     ab_dim1]), abs(d__2))) * ((d__3 = x[i__4]
00410                                     .r, abs(d__3)) + (d__4 = d_imag(&x[i__ + 
00411                                     j * x_dim1]), abs(d__4)));
00412 /* L130: */
00413                         }
00414                         rwork[k] += s;
00415 /* L140: */
00416                     }
00417                 }
00418             } else {
00419                 if (nounit) {
00420                     i__2 = *n;
00421                     for (k = 1; k <= i__2; ++k) {
00422                         s = 0.;
00423 /* Computing MIN */
00424                         i__3 = *n, i__4 = k + *kd;
00425                         i__5 = min(i__3,i__4);
00426                         for (i__ = k; i__ <= i__5; ++i__) {
00427                             i__3 = i__ + 1 - k + k * ab_dim1;
00428                             i__4 = i__ + j * x_dim1;
00429                             s += ((d__1 = ab[i__3].r, abs(d__1)) + (d__2 = 
00430                                     d_imag(&ab[i__ + 1 - k + k * ab_dim1]), 
00431                                     abs(d__2))) * ((d__3 = x[i__4].r, abs(
00432                                     d__3)) + (d__4 = d_imag(&x[i__ + j * 
00433                                     x_dim1]), abs(d__4)));
00434 /* L150: */
00435                         }
00436                         rwork[k] += s;
00437 /* L160: */
00438                     }
00439                 } else {
00440                     i__2 = *n;
00441                     for (k = 1; k <= i__2; ++k) {
00442                         i__5 = k + j * x_dim1;
00443                         s = (d__1 = x[i__5].r, abs(d__1)) + (d__2 = d_imag(&x[
00444                                 k + j * x_dim1]), abs(d__2));
00445 /* Computing MIN */
00446                         i__3 = *n, i__4 = k + *kd;
00447                         i__5 = min(i__3,i__4);
00448                         for (i__ = k + 1; i__ <= i__5; ++i__) {
00449                             i__3 = i__ + 1 - k + k * ab_dim1;
00450                             i__4 = i__ + j * x_dim1;
00451                             s += ((d__1 = ab[i__3].r, abs(d__1)) + (d__2 = 
00452                                     d_imag(&ab[i__ + 1 - k + k * ab_dim1]), 
00453                                     abs(d__2))) * ((d__3 = x[i__4].r, abs(
00454                                     d__3)) + (d__4 = d_imag(&x[i__ + j * 
00455                                     x_dim1]), abs(d__4)));
00456 /* L170: */
00457                         }
00458                         rwork[k] += s;
00459 /* L180: */
00460                     }
00461                 }
00462             }
00463         }
00464         s = 0.;
00465         i__2 = *n;
00466         for (i__ = 1; i__ <= i__2; ++i__) {
00467             if (rwork[i__] > safe2) {
00468 /* Computing MAX */
00469                 i__5 = i__;
00470                 d__3 = s, d__4 = ((d__1 = work[i__5].r, abs(d__1)) + (d__2 = 
00471                         d_imag(&work[i__]), abs(d__2))) / rwork[i__];
00472                 s = max(d__3,d__4);
00473             } else {
00474 /* Computing MAX */
00475                 i__5 = i__;
00476                 d__3 = s, d__4 = ((d__1 = work[i__5].r, abs(d__1)) + (d__2 = 
00477                         d_imag(&work[i__]), abs(d__2)) + safe1) / (rwork[i__] 
00478                         + safe1);
00479                 s = max(d__3,d__4);
00480             }
00481 /* L190: */
00482         }
00483         berr[j] = s;
00484 
00485 /*        Bound error from formula */
00486 
00487 /*        norm(X - XTRUE) / norm(X) .le. FERR = */
00488 /*        norm( abs(inv(op(A)))* */
00489 /*           ( abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) / norm(X) */
00490 
00491 /*        where */
00492 /*          norm(Z) is the magnitude of the largest component of Z */
00493 /*          inv(op(A)) is the inverse of op(A) */
00494 /*          abs(Z) is the componentwise absolute value of the matrix or */
00495 /*             vector Z */
00496 /*          NZ is the maximum number of nonzeros in any row of A, plus 1 */
00497 /*          EPS is machine epsilon */
00498 
00499 /*        The i-th component of abs(R)+NZ*EPS*(abs(op(A))*abs(X)+abs(B)) */
00500 /*        is incremented by SAFE1 if the i-th component of */
00501 /*        abs(op(A))*abs(X) + abs(B) is less than SAFE2. */
00502 
00503 /*        Use ZLACN2 to estimate the infinity-norm of the matrix */
00504 /*           inv(op(A)) * diag(W), */
00505 /*        where W = abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) */
00506 
00507         i__2 = *n;
00508         for (i__ = 1; i__ <= i__2; ++i__) {
00509             if (rwork[i__] > safe2) {
00510                 i__5 = i__;
00511                 rwork[i__] = (d__1 = work[i__5].r, abs(d__1)) + (d__2 = 
00512                         d_imag(&work[i__]), abs(d__2)) + nz * eps * rwork[i__]
00513                         ;
00514             } else {
00515                 i__5 = i__;
00516                 rwork[i__] = (d__1 = work[i__5].r, abs(d__1)) + (d__2 = 
00517                         d_imag(&work[i__]), abs(d__2)) + nz * eps * rwork[i__]
00518                          + safe1;
00519             }
00520 /* L200: */
00521         }
00522 
00523         kase = 0;
00524 L210:
00525         zlacn2_(n, &work[*n + 1], &work[1], &ferr[j], &kase, isave);
00526         if (kase != 0) {
00527             if (kase == 1) {
00528 
00529 /*              Multiply by diag(W)*inv(op(A)**H). */
00530 
00531                 ztbsv_(uplo, transt, diag, n, kd, &ab[ab_offset], ldab, &work[
00532                         1], &c__1);
00533                 i__2 = *n;
00534                 for (i__ = 1; i__ <= i__2; ++i__) {
00535                     i__5 = i__;
00536                     i__3 = i__;
00537                     i__4 = i__;
00538                     z__1.r = rwork[i__3] * work[i__4].r, z__1.i = rwork[i__3] 
00539                             * work[i__4].i;
00540                     work[i__5].r = z__1.r, work[i__5].i = z__1.i;
00541 /* L220: */
00542                 }
00543             } else {
00544 
00545 /*              Multiply by inv(op(A))*diag(W). */
00546 
00547                 i__2 = *n;
00548                 for (i__ = 1; i__ <= i__2; ++i__) {
00549                     i__5 = i__;
00550                     i__3 = i__;
00551                     i__4 = i__;
00552                     z__1.r = rwork[i__3] * work[i__4].r, z__1.i = rwork[i__3] 
00553                             * work[i__4].i;
00554                     work[i__5].r = z__1.r, work[i__5].i = z__1.i;
00555 /* L230: */
00556                 }
00557                 ztbsv_(uplo, transn, diag, n, kd, &ab[ab_offset], ldab, &work[
00558                         1], &c__1);
00559             }
00560             goto L210;
00561         }
00562 
00563 /*        Normalize error. */
00564 
00565         lstres = 0.;
00566         i__2 = *n;
00567         for (i__ = 1; i__ <= i__2; ++i__) {
00568 /* Computing MAX */
00569             i__5 = i__ + j * x_dim1;
00570             d__3 = lstres, d__4 = (d__1 = x[i__5].r, abs(d__1)) + (d__2 = 
00571                     d_imag(&x[i__ + j * x_dim1]), abs(d__2));
00572             lstres = max(d__3,d__4);
00573 /* L240: */
00574         }
00575         if (lstres != 0.) {
00576             ferr[j] /= lstres;
00577         }
00578 
00579 /* L250: */
00580     }
00581 
00582     return 0;
00583 
00584 /*     End of ZTBRFS */
00585 
00586 } /* ztbrfs_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:43