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


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:34