zlatbs.c
Go to the documentation of this file.
00001 /* zlatbs.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 static doublereal c_b36 = .5;
00020 
00021 /* Subroutine */ int zlatbs_(char *uplo, char *trans, char *diag, char *
00022         normin, integer *n, integer *kd, doublecomplex *ab, integer *ldab, 
00023         doublecomplex *x, doublereal *scale, doublereal *cnorm, integer *info)
00024 {
00025     /* System generated locals */
00026     integer ab_dim1, ab_offset, i__1, i__2, i__3, i__4, i__5;
00027     doublereal d__1, d__2, d__3, d__4;
00028     doublecomplex z__1, z__2, z__3, z__4;
00029 
00030     /* Builtin functions */
00031     double d_imag(doublecomplex *);
00032     void d_cnjg(doublecomplex *, doublecomplex *);
00033 
00034     /* Local variables */
00035     integer i__, j;
00036     doublereal xj, rec, tjj;
00037     integer jinc, jlen;
00038     doublereal xbnd;
00039     integer imax;
00040     doublereal tmax;
00041     doublecomplex tjjs;
00042     doublereal xmax, grow;
00043     extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, 
00044             integer *);
00045     integer maind;
00046     extern logical lsame_(char *, char *);
00047     doublereal tscal;
00048     doublecomplex uscal;
00049     integer jlast;
00050     doublecomplex csumj;
00051     extern /* Double Complex */ VOID zdotc_(doublecomplex *, integer *, 
00052             doublecomplex *, integer *, doublecomplex *, integer *);
00053     logical upper;
00054     extern /* Double Complex */ VOID zdotu_(doublecomplex *, integer *, 
00055             doublecomplex *, integer *, doublecomplex *, integer *);
00056     extern /* Subroutine */ int ztbsv_(char *, char *, char *, integer *, 
00057             integer *, doublecomplex *, integer *, doublecomplex *, integer *), zaxpy_(integer *, doublecomplex *, 
00058             doublecomplex *, integer *, doublecomplex *, integer *), dlabad_(
00059             doublereal *, doublereal *);
00060     extern doublereal dlamch_(char *);
00061     extern integer idamax_(integer *, doublereal *, integer *);
00062     extern /* Subroutine */ int xerbla_(char *, integer *), zdscal_(
00063             integer *, doublereal *, doublecomplex *, integer *);
00064     doublereal bignum;
00065     extern integer izamax_(integer *, doublecomplex *, integer *);
00066     extern /* Double Complex */ VOID zladiv_(doublecomplex *, doublecomplex *, 
00067              doublecomplex *);
00068     logical notran;
00069     integer jfirst;
00070     extern doublereal dzasum_(integer *, doublecomplex *, integer *);
00071     doublereal smlnum;
00072     logical nounit;
00073 
00074 
00075 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00076 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00077 /*     November 2006 */
00078 
00079 /*     .. Scalar Arguments .. */
00080 /*     .. */
00081 /*     .. Array Arguments .. */
00082 /*     .. */
00083 
00084 /*  Purpose */
00085 /*  ======= */
00086 
00087 /*  ZLATBS solves one of the triangular systems */
00088 
00089 /*     A * x = s*b,  A**T * x = s*b,  or  A**H * x = s*b, */
00090 
00091 /*  with scaling to prevent overflow, where A is an upper or lower */
00092 /*  triangular band matrix.  Here A' denotes the transpose of A, x and b */
00093 /*  are n-element vectors, and s is a scaling factor, usually less than */
00094 /*  or equal to 1, chosen so that the components of x will be less than */
00095 /*  the overflow threshold.  If the unscaled problem will not cause */
00096 /*  overflow, the Level 2 BLAS routine ZTBSV is called.  If the matrix A */
00097 /*  is singular (A(j,j) = 0 for some j), then s is set to 0 and a */
00098 /*  non-trivial solution to A*x = 0 is returned. */
00099 
00100 /*  Arguments */
00101 /*  ========= */
00102 
00103 /*  UPLO    (input) CHARACTER*1 */
00104 /*          Specifies whether the matrix A is upper or lower triangular. */
00105 /*          = 'U':  Upper triangular */
00106 /*          = 'L':  Lower triangular */
00107 
00108 /*  TRANS   (input) CHARACTER*1 */
00109 /*          Specifies the operation applied to A. */
00110 /*          = 'N':  Solve A * x = s*b     (No transpose) */
00111 /*          = 'T':  Solve A**T * x = s*b  (Transpose) */
00112 /*          = 'C':  Solve A**H * x = s*b  (Conjugate transpose) */
00113 
00114 /*  DIAG    (input) CHARACTER*1 */
00115 /*          Specifies whether or not the matrix A is unit triangular. */
00116 /*          = 'N':  Non-unit triangular */
00117 /*          = 'U':  Unit triangular */
00118 
00119 /*  NORMIN  (input) CHARACTER*1 */
00120 /*          Specifies whether CNORM has been set or not. */
00121 /*          = 'Y':  CNORM contains the column norms on entry */
00122 /*          = 'N':  CNORM is not set on entry.  On exit, the norms will */
00123 /*                  be computed and stored in CNORM. */
00124 
00125 /*  N       (input) INTEGER */
00126 /*          The order of the matrix A.  N >= 0. */
00127 
00128 /*  KD      (input) INTEGER */
00129 /*          The number of subdiagonals or superdiagonals in the */
00130 /*          triangular matrix A.  KD >= 0. */
00131 
00132 /*  AB      (input) COMPLEX*16 array, dimension (LDAB,N) */
00133 /*          The upper or lower triangular band matrix A, stored in the */
00134 /*          first KD+1 rows of the array. The j-th column of A is stored */
00135 /*          in the j-th column of the array AB as follows: */
00136 /*          if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j; */
00137 /*          if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j<=i<=min(n,j+kd). */
00138 
00139 /*  LDAB    (input) INTEGER */
00140 /*          The leading dimension of the array AB.  LDAB >= KD+1. */
00141 
00142 /*  X       (input/output) COMPLEX*16 array, dimension (N) */
00143 /*          On entry, the right hand side b of the triangular system. */
00144 /*          On exit, X is overwritten by the solution vector x. */
00145 
00146 /*  SCALE   (output) DOUBLE PRECISION */
00147 /*          The scaling factor s for the triangular system */
00148 /*             A * x = s*b,  A**T * x = s*b,  or  A**H * x = s*b. */
00149 /*          If SCALE = 0, the matrix A is singular or badly scaled, and */
00150 /*          the vector x is an exact or approximate solution to A*x = 0. */
00151 
00152 /*  CNORM   (input or output) DOUBLE PRECISION array, dimension (N) */
00153 
00154 /*          If NORMIN = 'Y', CNORM is an input argument and CNORM(j) */
00155 /*          contains the norm of the off-diagonal part of the j-th column */
00156 /*          of A.  If TRANS = 'N', CNORM(j) must be greater than or equal */
00157 /*          to the infinity-norm, and if TRANS = 'T' or 'C', CNORM(j) */
00158 /*          must be greater than or equal to the 1-norm. */
00159 
00160 /*          If NORMIN = 'N', CNORM is an output argument and CNORM(j) */
00161 /*          returns the 1-norm of the offdiagonal part of the j-th column */
00162 /*          of A. */
00163 
00164 /*  INFO    (output) INTEGER */
00165 /*          = 0:  successful exit */
00166 /*          < 0:  if INFO = -k, the k-th argument had an illegal value */
00167 
00168 /*  Further Details */
00169 /*  ======= ======= */
00170 
00171 /*  A rough bound on x is computed; if that is less than overflow, ZTBSV */
00172 /*  is called, otherwise, specific code is used which checks for possible */
00173 /*  overflow or divide-by-zero at every operation. */
00174 
00175 /*  A columnwise scheme is used for solving A*x = b.  The basic algorithm */
00176 /*  if A is lower triangular is */
00177 
00178 /*       x[1:n] := b[1:n] */
00179 /*       for j = 1, ..., n */
00180 /*            x(j) := x(j) / A(j,j) */
00181 /*            x[j+1:n] := x[j+1:n] - x(j) * A[j+1:n,j] */
00182 /*       end */
00183 
00184 /*  Define bounds on the components of x after j iterations of the loop: */
00185 /*     M(j) = bound on x[1:j] */
00186 /*     G(j) = bound on x[j+1:n] */
00187 /*  Initially, let M(0) = 0 and G(0) = max{x(i), i=1,...,n}. */
00188 
00189 /*  Then for iteration j+1 we have */
00190 /*     M(j+1) <= G(j) / | A(j+1,j+1) | */
00191 /*     G(j+1) <= G(j) + M(j+1) * | A[j+2:n,j+1] | */
00192 /*            <= G(j) ( 1 + CNORM(j+1) / | A(j+1,j+1) | ) */
00193 
00194 /*  where CNORM(j+1) is greater than or equal to the infinity-norm of */
00195 /*  column j+1 of A, not counting the diagonal.  Hence */
00196 
00197 /*     G(j) <= G(0) product ( 1 + CNORM(i) / | A(i,i) | ) */
00198 /*                  1<=i<=j */
00199 /*  and */
00200 
00201 /*     |x(j)| <= ( G(0) / |A(j,j)| ) product ( 1 + CNORM(i) / |A(i,i)| ) */
00202 /*                                   1<=i< j */
00203 
00204 /*  Since |x(j)| <= M(j), we use the Level 2 BLAS routine ZTBSV if the */
00205 /*  reciprocal of the largest M(j), j=1,..,n, is larger than */
00206 /*  max(underflow, 1/overflow). */
00207 
00208 /*  The bound on x(j) is also used to determine when a step in the */
00209 /*  columnwise method can be performed without fear of overflow.  If */
00210 /*  the computed bound is greater than a large constant, x is scaled to */
00211 /*  prevent overflow, but if the bound overflows, x is set to 0, x(j) to */
00212 /*  1, and scale to 0, and a non-trivial solution to A*x = 0 is found. */
00213 
00214 /*  Similarly, a row-wise scheme is used to solve A**T *x = b  or */
00215 /*  A**H *x = b.  The basic algorithm for A upper triangular is */
00216 
00217 /*       for j = 1, ..., n */
00218 /*            x(j) := ( b(j) - A[1:j-1,j]' * x[1:j-1] ) / A(j,j) */
00219 /*       end */
00220 
00221 /*  We simultaneously compute two bounds */
00222 /*       G(j) = bound on ( b(i) - A[1:i-1,i]' * x[1:i-1] ), 1<=i<=j */
00223 /*       M(j) = bound on x(i), 1<=i<=j */
00224 
00225 /*  The initial values are G(0) = 0, M(0) = max{b(i), i=1,..,n}, and we */
00226 /*  add the constraint G(j) >= G(j-1) and M(j) >= M(j-1) for j >= 1. */
00227 /*  Then the bound on x(j) is */
00228 
00229 /*       M(j) <= M(j-1) * ( 1 + CNORM(j) ) / | A(j,j) | */
00230 
00231 /*            <= M(0) * product ( ( 1 + CNORM(i) ) / |A(i,i)| ) */
00232 /*                      1<=i<=j */
00233 
00234 /*  and we can safely call ZTBSV if 1/M(n) and 1/G(n) are both greater */
00235 /*  than max(underflow, 1/overflow). */
00236 
00237 /*  ===================================================================== */
00238 
00239 /*     .. Parameters .. */
00240 /*     .. */
00241 /*     .. Local Scalars .. */
00242 /*     .. */
00243 /*     .. External Functions .. */
00244 /*     .. */
00245 /*     .. External Subroutines .. */
00246 /*     .. */
00247 /*     .. Intrinsic Functions .. */
00248 /*     .. */
00249 /*     .. Statement Functions .. */
00250 /*     .. */
00251 /*     .. Statement Function definitions .. */
00252 /*     .. */
00253 /*     .. Executable Statements .. */
00254 
00255     /* Parameter adjustments */
00256     ab_dim1 = *ldab;
00257     ab_offset = 1 + ab_dim1;
00258     ab -= ab_offset;
00259     --x;
00260     --cnorm;
00261 
00262     /* Function Body */
00263     *info = 0;
00264     upper = lsame_(uplo, "U");
00265     notran = lsame_(trans, "N");
00266     nounit = lsame_(diag, "N");
00267 
00268 /*     Test the input parameters. */
00269 
00270     if (! upper && ! lsame_(uplo, "L")) {
00271         *info = -1;
00272     } else if (! notran && ! lsame_(trans, "T") && ! 
00273             lsame_(trans, "C")) {
00274         *info = -2;
00275     } else if (! nounit && ! lsame_(diag, "U")) {
00276         *info = -3;
00277     } else if (! lsame_(normin, "Y") && ! lsame_(normin, 
00278              "N")) {
00279         *info = -4;
00280     } else if (*n < 0) {
00281         *info = -5;
00282     } else if (*kd < 0) {
00283         *info = -6;
00284     } else if (*ldab < *kd + 1) {
00285         *info = -8;
00286     }
00287     if (*info != 0) {
00288         i__1 = -(*info);
00289         xerbla_("ZLATBS", &i__1);
00290         return 0;
00291     }
00292 
00293 /*     Quick return if possible */
00294 
00295     if (*n == 0) {
00296         return 0;
00297     }
00298 
00299 /*     Determine machine dependent parameters to control overflow. */
00300 
00301     smlnum = dlamch_("Safe minimum");
00302     bignum = 1. / smlnum;
00303     dlabad_(&smlnum, &bignum);
00304     smlnum /= dlamch_("Precision");
00305     bignum = 1. / smlnum;
00306     *scale = 1.;
00307 
00308     if (lsame_(normin, "N")) {
00309 
00310 /*        Compute the 1-norm of each column, not including the diagonal. */
00311 
00312         if (upper) {
00313 
00314 /*           A is upper triangular. */
00315 
00316             i__1 = *n;
00317             for (j = 1; j <= i__1; ++j) {
00318 /* Computing MIN */
00319                 i__2 = *kd, i__3 = j - 1;
00320                 jlen = min(i__2,i__3);
00321                 cnorm[j] = dzasum_(&jlen, &ab[*kd + 1 - jlen + j * ab_dim1], &
00322                         c__1);
00323 /* L10: */
00324             }
00325         } else {
00326 
00327 /*           A is lower triangular. */
00328 
00329             i__1 = *n;
00330             for (j = 1; j <= i__1; ++j) {
00331 /* Computing MIN */
00332                 i__2 = *kd, i__3 = *n - j;
00333                 jlen = min(i__2,i__3);
00334                 if (jlen > 0) {
00335                     cnorm[j] = dzasum_(&jlen, &ab[j * ab_dim1 + 2], &c__1);
00336                 } else {
00337                     cnorm[j] = 0.;
00338                 }
00339 /* L20: */
00340             }
00341         }
00342     }
00343 
00344 /*     Scale the column norms by TSCAL if the maximum element in CNORM is */
00345 /*     greater than BIGNUM/2. */
00346 
00347     imax = idamax_(n, &cnorm[1], &c__1);
00348     tmax = cnorm[imax];
00349     if (tmax <= bignum * .5) {
00350         tscal = 1.;
00351     } else {
00352         tscal = .5 / (smlnum * tmax);
00353         dscal_(n, &tscal, &cnorm[1], &c__1);
00354     }
00355 
00356 /*     Compute a bound on the computed solution vector to see if the */
00357 /*     Level 2 BLAS routine ZTBSV can be used. */
00358 
00359     xmax = 0.;
00360     i__1 = *n;
00361     for (j = 1; j <= i__1; ++j) {
00362 /* Computing MAX */
00363         i__2 = j;
00364         d__3 = xmax, d__4 = (d__1 = x[i__2].r / 2., abs(d__1)) + (d__2 = 
00365                 d_imag(&x[j]) / 2., abs(d__2));
00366         xmax = max(d__3,d__4);
00367 /* L30: */
00368     }
00369     xbnd = xmax;
00370     if (notran) {
00371 
00372 /*        Compute the growth in A * x = b. */
00373 
00374         if (upper) {
00375             jfirst = *n;
00376             jlast = 1;
00377             jinc = -1;
00378             maind = *kd + 1;
00379         } else {
00380             jfirst = 1;
00381             jlast = *n;
00382             jinc = 1;
00383             maind = 1;
00384         }
00385 
00386         if (tscal != 1.) {
00387             grow = 0.;
00388             goto L60;
00389         }
00390 
00391         if (nounit) {
00392 
00393 /*           A is non-unit triangular. */
00394 
00395 /*           Compute GROW = 1/G(j) and XBND = 1/M(j). */
00396 /*           Initially, G(0) = max{x(i), i=1,...,n}. */
00397 
00398             grow = .5 / max(xbnd,smlnum);
00399             xbnd = grow;
00400             i__1 = jlast;
00401             i__2 = jinc;
00402             for (j = jfirst; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) {
00403 
00404 /*              Exit the loop if the growth factor is too small. */
00405 
00406                 if (grow <= smlnum) {
00407                     goto L60;
00408                 }
00409 
00410                 i__3 = maind + j * ab_dim1;
00411                 tjjs.r = ab[i__3].r, tjjs.i = ab[i__3].i;
00412                 tjj = (d__1 = tjjs.r, abs(d__1)) + (d__2 = d_imag(&tjjs), abs(
00413                         d__2));
00414 
00415                 if (tjj >= smlnum) {
00416 
00417 /*                 M(j) = G(j-1) / abs(A(j,j)) */
00418 
00419 /* Computing MIN */
00420                     d__1 = xbnd, d__2 = min(1.,tjj) * grow;
00421                     xbnd = min(d__1,d__2);
00422                 } else {
00423 
00424 /*                 M(j) could overflow, set XBND to 0. */
00425 
00426                     xbnd = 0.;
00427                 }
00428 
00429                 if (tjj + cnorm[j] >= smlnum) {
00430 
00431 /*                 G(j) = G(j-1)*( 1 + CNORM(j) / abs(A(j,j)) ) */
00432 
00433                     grow *= tjj / (tjj + cnorm[j]);
00434                 } else {
00435 
00436 /*                 G(j) could overflow, set GROW to 0. */
00437 
00438                     grow = 0.;
00439                 }
00440 /* L40: */
00441             }
00442             grow = xbnd;
00443         } else {
00444 
00445 /*           A is unit triangular. */
00446 
00447 /*           Compute GROW = 1/G(j), where G(0) = max{x(i), i=1,...,n}. */
00448 
00449 /* Computing MIN */
00450             d__1 = 1., d__2 = .5 / max(xbnd,smlnum);
00451             grow = min(d__1,d__2);
00452             i__2 = jlast;
00453             i__1 = jinc;
00454             for (j = jfirst; i__1 < 0 ? j >= i__2 : j <= i__2; j += i__1) {
00455 
00456 /*              Exit the loop if the growth factor is too small. */
00457 
00458                 if (grow <= smlnum) {
00459                     goto L60;
00460                 }
00461 
00462 /*              G(j) = G(j-1)*( 1 + CNORM(j) ) */
00463 
00464                 grow *= 1. / (cnorm[j] + 1.);
00465 /* L50: */
00466             }
00467         }
00468 L60:
00469 
00470         ;
00471     } else {
00472 
00473 /*        Compute the growth in A**T * x = b  or  A**H * x = b. */
00474 
00475         if (upper) {
00476             jfirst = 1;
00477             jlast = *n;
00478             jinc = 1;
00479             maind = *kd + 1;
00480         } else {
00481             jfirst = *n;
00482             jlast = 1;
00483             jinc = -1;
00484             maind = 1;
00485         }
00486 
00487         if (tscal != 1.) {
00488             grow = 0.;
00489             goto L90;
00490         }
00491 
00492         if (nounit) {
00493 
00494 /*           A is non-unit triangular. */
00495 
00496 /*           Compute GROW = 1/G(j) and XBND = 1/M(j). */
00497 /*           Initially, M(0) = max{x(i), i=1,...,n}. */
00498 
00499             grow = .5 / max(xbnd,smlnum);
00500             xbnd = grow;
00501             i__1 = jlast;
00502             i__2 = jinc;
00503             for (j = jfirst; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) {
00504 
00505 /*              Exit the loop if the growth factor is too small. */
00506 
00507                 if (grow <= smlnum) {
00508                     goto L90;
00509                 }
00510 
00511 /*              G(j) = max( G(j-1), M(j-1)*( 1 + CNORM(j) ) ) */
00512 
00513                 xj = cnorm[j] + 1.;
00514 /* Computing MIN */
00515                 d__1 = grow, d__2 = xbnd / xj;
00516                 grow = min(d__1,d__2);
00517 
00518                 i__3 = maind + j * ab_dim1;
00519                 tjjs.r = ab[i__3].r, tjjs.i = ab[i__3].i;
00520                 tjj = (d__1 = tjjs.r, abs(d__1)) + (d__2 = d_imag(&tjjs), abs(
00521                         d__2));
00522 
00523                 if (tjj >= smlnum) {
00524 
00525 /*                 M(j) = M(j-1)*( 1 + CNORM(j) ) / abs(A(j,j)) */
00526 
00527                     if (xj > tjj) {
00528                         xbnd *= tjj / xj;
00529                     }
00530                 } else {
00531 
00532 /*                 M(j) could overflow, set XBND to 0. */
00533 
00534                     xbnd = 0.;
00535                 }
00536 /* L70: */
00537             }
00538             grow = min(grow,xbnd);
00539         } else {
00540 
00541 /*           A is unit triangular. */
00542 
00543 /*           Compute GROW = 1/G(j), where G(0) = max{x(i), i=1,...,n}. */
00544 
00545 /* Computing MIN */
00546             d__1 = 1., d__2 = .5 / max(xbnd,smlnum);
00547             grow = min(d__1,d__2);
00548             i__2 = jlast;
00549             i__1 = jinc;
00550             for (j = jfirst; i__1 < 0 ? j >= i__2 : j <= i__2; j += i__1) {
00551 
00552 /*              Exit the loop if the growth factor is too small. */
00553 
00554                 if (grow <= smlnum) {
00555                     goto L90;
00556                 }
00557 
00558 /*              G(j) = ( 1 + CNORM(j) )*G(j-1) */
00559 
00560                 xj = cnorm[j] + 1.;
00561                 grow /= xj;
00562 /* L80: */
00563             }
00564         }
00565 L90:
00566         ;
00567     }
00568 
00569     if (grow * tscal > smlnum) {
00570 
00571 /*        Use the Level 2 BLAS solve if the reciprocal of the bound on */
00572 /*        elements of X is not too small. */
00573 
00574         ztbsv_(uplo, trans, diag, n, kd, &ab[ab_offset], ldab, &x[1], &c__1);
00575     } else {
00576 
00577 /*        Use a Level 1 BLAS solve, scaling intermediate results. */
00578 
00579         if (xmax > bignum * .5) {
00580 
00581 /*           Scale X so that its components are less than or equal to */
00582 /*           BIGNUM in absolute value. */
00583 
00584             *scale = bignum * .5 / xmax;
00585             zdscal_(n, scale, &x[1], &c__1);
00586             xmax = bignum;
00587         } else {
00588             xmax *= 2.;
00589         }
00590 
00591         if (notran) {
00592 
00593 /*           Solve A * x = b */
00594 
00595             i__1 = jlast;
00596             i__2 = jinc;
00597             for (j = jfirst; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) {
00598 
00599 /*              Compute x(j) = b(j) / A(j,j), scaling x if necessary. */
00600 
00601                 i__3 = j;
00602                 xj = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&x[j]), 
00603                         abs(d__2));
00604                 if (nounit) {
00605                     i__3 = maind + j * ab_dim1;
00606                     z__1.r = tscal * ab[i__3].r, z__1.i = tscal * ab[i__3].i;
00607                     tjjs.r = z__1.r, tjjs.i = z__1.i;
00608                 } else {
00609                     tjjs.r = tscal, tjjs.i = 0.;
00610                     if (tscal == 1.) {
00611                         goto L110;
00612                     }
00613                 }
00614                 tjj = (d__1 = tjjs.r, abs(d__1)) + (d__2 = d_imag(&tjjs), abs(
00615                         d__2));
00616                 if (tjj > smlnum) {
00617 
00618 /*                    abs(A(j,j)) > SMLNUM: */
00619 
00620                     if (tjj < 1.) {
00621                         if (xj > tjj * bignum) {
00622 
00623 /*                          Scale x by 1/b(j). */
00624 
00625                             rec = 1. / xj;
00626                             zdscal_(n, &rec, &x[1], &c__1);
00627                             *scale *= rec;
00628                             xmax *= rec;
00629                         }
00630                     }
00631                     i__3 = j;
00632                     zladiv_(&z__1, &x[j], &tjjs);
00633                     x[i__3].r = z__1.r, x[i__3].i = z__1.i;
00634                     i__3 = j;
00635                     xj = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&x[j])
00636                             , abs(d__2));
00637                 } else if (tjj > 0.) {
00638 
00639 /*                    0 < abs(A(j,j)) <= SMLNUM: */
00640 
00641                     if (xj > tjj * bignum) {
00642 
00643 /*                       Scale x by (1/abs(x(j)))*abs(A(j,j))*BIGNUM */
00644 /*                       to avoid overflow when dividing by A(j,j). */
00645 
00646                         rec = tjj * bignum / xj;
00647                         if (cnorm[j] > 1.) {
00648 
00649 /*                          Scale by 1/CNORM(j) to avoid overflow when */
00650 /*                          multiplying x(j) times column j. */
00651 
00652                             rec /= cnorm[j];
00653                         }
00654                         zdscal_(n, &rec, &x[1], &c__1);
00655                         *scale *= rec;
00656                         xmax *= rec;
00657                     }
00658                     i__3 = j;
00659                     zladiv_(&z__1, &x[j], &tjjs);
00660                     x[i__3].r = z__1.r, x[i__3].i = z__1.i;
00661                     i__3 = j;
00662                     xj = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&x[j])
00663                             , abs(d__2));
00664                 } else {
00665 
00666 /*                    A(j,j) = 0:  Set x(1:n) = 0, x(j) = 1, and */
00667 /*                    scale = 0, and compute a solution to A*x = 0. */
00668 
00669                     i__3 = *n;
00670                     for (i__ = 1; i__ <= i__3; ++i__) {
00671                         i__4 = i__;
00672                         x[i__4].r = 0., x[i__4].i = 0.;
00673 /* L100: */
00674                     }
00675                     i__3 = j;
00676                     x[i__3].r = 1., x[i__3].i = 0.;
00677                     xj = 1.;
00678                     *scale = 0.;
00679                     xmax = 0.;
00680                 }
00681 L110:
00682 
00683 /*              Scale x if necessary to avoid overflow when adding a */
00684 /*              multiple of column j of A. */
00685 
00686                 if (xj > 1.) {
00687                     rec = 1. / xj;
00688                     if (cnorm[j] > (bignum - xmax) * rec) {
00689 
00690 /*                    Scale x by 1/(2*abs(x(j))). */
00691 
00692                         rec *= .5;
00693                         zdscal_(n, &rec, &x[1], &c__1);
00694                         *scale *= rec;
00695                     }
00696                 } else if (xj * cnorm[j] > bignum - xmax) {
00697 
00698 /*                 Scale x by 1/2. */
00699 
00700                     zdscal_(n, &c_b36, &x[1], &c__1);
00701                     *scale *= .5;
00702                 }
00703 
00704                 if (upper) {
00705                     if (j > 1) {
00706 
00707 /*                    Compute the update */
00708 /*                       x(max(1,j-kd):j-1) := x(max(1,j-kd):j-1) - */
00709 /*                                             x(j)* A(max(1,j-kd):j-1,j) */
00710 
00711 /* Computing MIN */
00712                         i__3 = *kd, i__4 = j - 1;
00713                         jlen = min(i__3,i__4);
00714                         i__3 = j;
00715                         z__2.r = -x[i__3].r, z__2.i = -x[i__3].i;
00716                         z__1.r = tscal * z__2.r, z__1.i = tscal * z__2.i;
00717                         zaxpy_(&jlen, &z__1, &ab[*kd + 1 - jlen + j * ab_dim1]
00718 , &c__1, &x[j - jlen], &c__1);
00719                         i__3 = j - 1;
00720                         i__ = izamax_(&i__3, &x[1], &c__1);
00721                         i__3 = i__;
00722                         xmax = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(
00723                                 &x[i__]), abs(d__2));
00724                     }
00725                 } else if (j < *n) {
00726 
00727 /*                 Compute the update */
00728 /*                    x(j+1:min(j+kd,n)) := x(j+1:min(j+kd,n)) - */
00729 /*                                          x(j) * A(j+1:min(j+kd,n),j) */
00730 
00731 /* Computing MIN */
00732                     i__3 = *kd, i__4 = *n - j;
00733                     jlen = min(i__3,i__4);
00734                     if (jlen > 0) {
00735                         i__3 = j;
00736                         z__2.r = -x[i__3].r, z__2.i = -x[i__3].i;
00737                         z__1.r = tscal * z__2.r, z__1.i = tscal * z__2.i;
00738                         zaxpy_(&jlen, &z__1, &ab[j * ab_dim1 + 2], &c__1, &x[
00739                                 j + 1], &c__1);
00740                     }
00741                     i__3 = *n - j;
00742                     i__ = j + izamax_(&i__3, &x[j + 1], &c__1);
00743                     i__3 = i__;
00744                     xmax = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&x[
00745                             i__]), abs(d__2));
00746                 }
00747 /* L120: */
00748             }
00749 
00750         } else if (lsame_(trans, "T")) {
00751 
00752 /*           Solve A**T * x = b */
00753 
00754             i__2 = jlast;
00755             i__1 = jinc;
00756             for (j = jfirst; i__1 < 0 ? j >= i__2 : j <= i__2; j += i__1) {
00757 
00758 /*              Compute x(j) = b(j) - sum A(k,j)*x(k). */
00759 /*                                    k<>j */
00760 
00761                 i__3 = j;
00762                 xj = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&x[j]), 
00763                         abs(d__2));
00764                 uscal.r = tscal, uscal.i = 0.;
00765                 rec = 1. / max(xmax,1.);
00766                 if (cnorm[j] > (bignum - xj) * rec) {
00767 
00768 /*                 If x(j) could overflow, scale x by 1/(2*XMAX). */
00769 
00770                     rec *= .5;
00771                     if (nounit) {
00772                         i__3 = maind + j * ab_dim1;
00773                         z__1.r = tscal * ab[i__3].r, z__1.i = tscal * ab[i__3]
00774                                 .i;
00775                         tjjs.r = z__1.r, tjjs.i = z__1.i;
00776                     } else {
00777                         tjjs.r = tscal, tjjs.i = 0.;
00778                     }
00779                     tjj = (d__1 = tjjs.r, abs(d__1)) + (d__2 = d_imag(&tjjs), 
00780                             abs(d__2));
00781                     if (tjj > 1.) {
00782 
00783 /*                       Divide by A(j,j) when scaling x if A(j,j) > 1. */
00784 
00785 /* Computing MIN */
00786                         d__1 = 1., d__2 = rec * tjj;
00787                         rec = min(d__1,d__2);
00788                         zladiv_(&z__1, &uscal, &tjjs);
00789                         uscal.r = z__1.r, uscal.i = z__1.i;
00790                     }
00791                     if (rec < 1.) {
00792                         zdscal_(n, &rec, &x[1], &c__1);
00793                         *scale *= rec;
00794                         xmax *= rec;
00795                     }
00796                 }
00797 
00798                 csumj.r = 0., csumj.i = 0.;
00799                 if (uscal.r == 1. && uscal.i == 0.) {
00800 
00801 /*                 If the scaling needed for A in the dot product is 1, */
00802 /*                 call ZDOTU to perform the dot product. */
00803 
00804                     if (upper) {
00805 /* Computing MIN */
00806                         i__3 = *kd, i__4 = j - 1;
00807                         jlen = min(i__3,i__4);
00808                         zdotu_(&z__1, &jlen, &ab[*kd + 1 - jlen + j * ab_dim1]
00809 , &c__1, &x[j - jlen], &c__1);
00810                         csumj.r = z__1.r, csumj.i = z__1.i;
00811                     } else {
00812 /* Computing MIN */
00813                         i__3 = *kd, i__4 = *n - j;
00814                         jlen = min(i__3,i__4);
00815                         if (jlen > 1) {
00816                             zdotu_(&z__1, &jlen, &ab[j * ab_dim1 + 2], &c__1, 
00817                                     &x[j + 1], &c__1);
00818                             csumj.r = z__1.r, csumj.i = z__1.i;
00819                         }
00820                     }
00821                 } else {
00822 
00823 /*                 Otherwise, use in-line code for the dot product. */
00824 
00825                     if (upper) {
00826 /* Computing MIN */
00827                         i__3 = *kd, i__4 = j - 1;
00828                         jlen = min(i__3,i__4);
00829                         i__3 = jlen;
00830                         for (i__ = 1; i__ <= i__3; ++i__) {
00831                             i__4 = *kd + i__ - jlen + j * ab_dim1;
00832                             z__3.r = ab[i__4].r * uscal.r - ab[i__4].i * 
00833                                     uscal.i, z__3.i = ab[i__4].r * uscal.i + 
00834                                     ab[i__4].i * uscal.r;
00835                             i__5 = j - jlen - 1 + i__;
00836                             z__2.r = z__3.r * x[i__5].r - z__3.i * x[i__5].i, 
00837                                     z__2.i = z__3.r * x[i__5].i + z__3.i * x[
00838                                     i__5].r;
00839                             z__1.r = csumj.r + z__2.r, z__1.i = csumj.i + 
00840                                     z__2.i;
00841                             csumj.r = z__1.r, csumj.i = z__1.i;
00842 /* L130: */
00843                         }
00844                     } else {
00845 /* Computing MIN */
00846                         i__3 = *kd, i__4 = *n - j;
00847                         jlen = min(i__3,i__4);
00848                         i__3 = jlen;
00849                         for (i__ = 1; i__ <= i__3; ++i__) {
00850                             i__4 = i__ + 1 + j * ab_dim1;
00851                             z__3.r = ab[i__4].r * uscal.r - ab[i__4].i * 
00852                                     uscal.i, z__3.i = ab[i__4].r * uscal.i + 
00853                                     ab[i__4].i * uscal.r;
00854                             i__5 = j + i__;
00855                             z__2.r = z__3.r * x[i__5].r - z__3.i * x[i__5].i, 
00856                                     z__2.i = z__3.r * x[i__5].i + z__3.i * x[
00857                                     i__5].r;
00858                             z__1.r = csumj.r + z__2.r, z__1.i = csumj.i + 
00859                                     z__2.i;
00860                             csumj.r = z__1.r, csumj.i = z__1.i;
00861 /* L140: */
00862                         }
00863                     }
00864                 }
00865 
00866                 z__1.r = tscal, z__1.i = 0.;
00867                 if (uscal.r == z__1.r && uscal.i == z__1.i) {
00868 
00869 /*                 Compute x(j) := ( x(j) - CSUMJ ) / A(j,j) if 1/A(j,j) */
00870 /*                 was not used to scale the dotproduct. */
00871 
00872                     i__3 = j;
00873                     i__4 = j;
00874                     z__1.r = x[i__4].r - csumj.r, z__1.i = x[i__4].i - 
00875                             csumj.i;
00876                     x[i__3].r = z__1.r, x[i__3].i = z__1.i;
00877                     i__3 = j;
00878                     xj = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&x[j])
00879                             , abs(d__2));
00880                     if (nounit) {
00881 
00882 /*                    Compute x(j) = x(j) / A(j,j), scaling if necessary. */
00883 
00884                         i__3 = maind + j * ab_dim1;
00885                         z__1.r = tscal * ab[i__3].r, z__1.i = tscal * ab[i__3]
00886                                 .i;
00887                         tjjs.r = z__1.r, tjjs.i = z__1.i;
00888                     } else {
00889                         tjjs.r = tscal, tjjs.i = 0.;
00890                         if (tscal == 1.) {
00891                             goto L160;
00892                         }
00893                     }
00894                     tjj = (d__1 = tjjs.r, abs(d__1)) + (d__2 = d_imag(&tjjs), 
00895                             abs(d__2));
00896                     if (tjj > smlnum) {
00897 
00898 /*                       abs(A(j,j)) > SMLNUM: */
00899 
00900                         if (tjj < 1.) {
00901                             if (xj > tjj * bignum) {
00902 
00903 /*                             Scale X by 1/abs(x(j)). */
00904 
00905                                 rec = 1. / xj;
00906                                 zdscal_(n, &rec, &x[1], &c__1);
00907                                 *scale *= rec;
00908                                 xmax *= rec;
00909                             }
00910                         }
00911                         i__3 = j;
00912                         zladiv_(&z__1, &x[j], &tjjs);
00913                         x[i__3].r = z__1.r, x[i__3].i = z__1.i;
00914                     } else if (tjj > 0.) {
00915 
00916 /*                       0 < abs(A(j,j)) <= SMLNUM: */
00917 
00918                         if (xj > tjj * bignum) {
00919 
00920 /*                          Scale x by (1/abs(x(j)))*abs(A(j,j))*BIGNUM. */
00921 
00922                             rec = tjj * bignum / xj;
00923                             zdscal_(n, &rec, &x[1], &c__1);
00924                             *scale *= rec;
00925                             xmax *= rec;
00926                         }
00927                         i__3 = j;
00928                         zladiv_(&z__1, &x[j], &tjjs);
00929                         x[i__3].r = z__1.r, x[i__3].i = z__1.i;
00930                     } else {
00931 
00932 /*                       A(j,j) = 0:  Set x(1:n) = 0, x(j) = 1, and */
00933 /*                       scale = 0 and compute a solution to A**T *x = 0. */
00934 
00935                         i__3 = *n;
00936                         for (i__ = 1; i__ <= i__3; ++i__) {
00937                             i__4 = i__;
00938                             x[i__4].r = 0., x[i__4].i = 0.;
00939 /* L150: */
00940                         }
00941                         i__3 = j;
00942                         x[i__3].r = 1., x[i__3].i = 0.;
00943                         *scale = 0.;
00944                         xmax = 0.;
00945                     }
00946 L160:
00947                     ;
00948                 } else {
00949 
00950 /*                 Compute x(j) := x(j) / A(j,j) - CSUMJ if the dot */
00951 /*                 product has already been divided by 1/A(j,j). */
00952 
00953                     i__3 = j;
00954                     zladiv_(&z__2, &x[j], &tjjs);
00955                     z__1.r = z__2.r - csumj.r, z__1.i = z__2.i - csumj.i;
00956                     x[i__3].r = z__1.r, x[i__3].i = z__1.i;
00957                 }
00958 /* Computing MAX */
00959                 i__3 = j;
00960                 d__3 = xmax, d__4 = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = 
00961                         d_imag(&x[j]), abs(d__2));
00962                 xmax = max(d__3,d__4);
00963 /* L170: */
00964             }
00965 
00966         } else {
00967 
00968 /*           Solve A**H * x = b */
00969 
00970             i__1 = jlast;
00971             i__2 = jinc;
00972             for (j = jfirst; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) {
00973 
00974 /*              Compute x(j) = b(j) - sum A(k,j)*x(k). */
00975 /*                                    k<>j */
00976 
00977                 i__3 = j;
00978                 xj = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&x[j]), 
00979                         abs(d__2));
00980                 uscal.r = tscal, uscal.i = 0.;
00981                 rec = 1. / max(xmax,1.);
00982                 if (cnorm[j] > (bignum - xj) * rec) {
00983 
00984 /*                 If x(j) could overflow, scale x by 1/(2*XMAX). */
00985 
00986                     rec *= .5;
00987                     if (nounit) {
00988                         d_cnjg(&z__2, &ab[maind + j * ab_dim1]);
00989                         z__1.r = tscal * z__2.r, z__1.i = tscal * z__2.i;
00990                         tjjs.r = z__1.r, tjjs.i = z__1.i;
00991                     } else {
00992                         tjjs.r = tscal, tjjs.i = 0.;
00993                     }
00994                     tjj = (d__1 = tjjs.r, abs(d__1)) + (d__2 = d_imag(&tjjs), 
00995                             abs(d__2));
00996                     if (tjj > 1.) {
00997 
00998 /*                       Divide by A(j,j) when scaling x if A(j,j) > 1. */
00999 
01000 /* Computing MIN */
01001                         d__1 = 1., d__2 = rec * tjj;
01002                         rec = min(d__1,d__2);
01003                         zladiv_(&z__1, &uscal, &tjjs);
01004                         uscal.r = z__1.r, uscal.i = z__1.i;
01005                     }
01006                     if (rec < 1.) {
01007                         zdscal_(n, &rec, &x[1], &c__1);
01008                         *scale *= rec;
01009                         xmax *= rec;
01010                     }
01011                 }
01012 
01013                 csumj.r = 0., csumj.i = 0.;
01014                 if (uscal.r == 1. && uscal.i == 0.) {
01015 
01016 /*                 If the scaling needed for A in the dot product is 1, */
01017 /*                 call ZDOTC to perform the dot product. */
01018 
01019                     if (upper) {
01020 /* Computing MIN */
01021                         i__3 = *kd, i__4 = j - 1;
01022                         jlen = min(i__3,i__4);
01023                         zdotc_(&z__1, &jlen, &ab[*kd + 1 - jlen + j * ab_dim1]
01024 , &c__1, &x[j - jlen], &c__1);
01025                         csumj.r = z__1.r, csumj.i = z__1.i;
01026                     } else {
01027 /* Computing MIN */
01028                         i__3 = *kd, i__4 = *n - j;
01029                         jlen = min(i__3,i__4);
01030                         if (jlen > 1) {
01031                             zdotc_(&z__1, &jlen, &ab[j * ab_dim1 + 2], &c__1, 
01032                                     &x[j + 1], &c__1);
01033                             csumj.r = z__1.r, csumj.i = z__1.i;
01034                         }
01035                     }
01036                 } else {
01037 
01038 /*                 Otherwise, use in-line code for the dot product. */
01039 
01040                     if (upper) {
01041 /* Computing MIN */
01042                         i__3 = *kd, i__4 = j - 1;
01043                         jlen = min(i__3,i__4);
01044                         i__3 = jlen;
01045                         for (i__ = 1; i__ <= i__3; ++i__) {
01046                             d_cnjg(&z__4, &ab[*kd + i__ - jlen + j * ab_dim1])
01047                                     ;
01048                             z__3.r = z__4.r * uscal.r - z__4.i * uscal.i, 
01049                                     z__3.i = z__4.r * uscal.i + z__4.i * 
01050                                     uscal.r;
01051                             i__4 = j - jlen - 1 + i__;
01052                             z__2.r = z__3.r * x[i__4].r - z__3.i * x[i__4].i, 
01053                                     z__2.i = z__3.r * x[i__4].i + z__3.i * x[
01054                                     i__4].r;
01055                             z__1.r = csumj.r + z__2.r, z__1.i = csumj.i + 
01056                                     z__2.i;
01057                             csumj.r = z__1.r, csumj.i = z__1.i;
01058 /* L180: */
01059                         }
01060                     } else {
01061 /* Computing MIN */
01062                         i__3 = *kd, i__4 = *n - j;
01063                         jlen = min(i__3,i__4);
01064                         i__3 = jlen;
01065                         for (i__ = 1; i__ <= i__3; ++i__) {
01066                             d_cnjg(&z__4, &ab[i__ + 1 + j * ab_dim1]);
01067                             z__3.r = z__4.r * uscal.r - z__4.i * uscal.i, 
01068                                     z__3.i = z__4.r * uscal.i + z__4.i * 
01069                                     uscal.r;
01070                             i__4 = j + i__;
01071                             z__2.r = z__3.r * x[i__4].r - z__3.i * x[i__4].i, 
01072                                     z__2.i = z__3.r * x[i__4].i + z__3.i * x[
01073                                     i__4].r;
01074                             z__1.r = csumj.r + z__2.r, z__1.i = csumj.i + 
01075                                     z__2.i;
01076                             csumj.r = z__1.r, csumj.i = z__1.i;
01077 /* L190: */
01078                         }
01079                     }
01080                 }
01081 
01082                 z__1.r = tscal, z__1.i = 0.;
01083                 if (uscal.r == z__1.r && uscal.i == z__1.i) {
01084 
01085 /*                 Compute x(j) := ( x(j) - CSUMJ ) / A(j,j) if 1/A(j,j) */
01086 /*                 was not used to scale the dotproduct. */
01087 
01088                     i__3 = j;
01089                     i__4 = j;
01090                     z__1.r = x[i__4].r - csumj.r, z__1.i = x[i__4].i - 
01091                             csumj.i;
01092                     x[i__3].r = z__1.r, x[i__3].i = z__1.i;
01093                     i__3 = j;
01094                     xj = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = d_imag(&x[j])
01095                             , abs(d__2));
01096                     if (nounit) {
01097 
01098 /*                    Compute x(j) = x(j) / A(j,j), scaling if necessary. */
01099 
01100                         d_cnjg(&z__2, &ab[maind + j * ab_dim1]);
01101                         z__1.r = tscal * z__2.r, z__1.i = tscal * z__2.i;
01102                         tjjs.r = z__1.r, tjjs.i = z__1.i;
01103                     } else {
01104                         tjjs.r = tscal, tjjs.i = 0.;
01105                         if (tscal == 1.) {
01106                             goto L210;
01107                         }
01108                     }
01109                     tjj = (d__1 = tjjs.r, abs(d__1)) + (d__2 = d_imag(&tjjs), 
01110                             abs(d__2));
01111                     if (tjj > smlnum) {
01112 
01113 /*                       abs(A(j,j)) > SMLNUM: */
01114 
01115                         if (tjj < 1.) {
01116                             if (xj > tjj * bignum) {
01117 
01118 /*                             Scale X by 1/abs(x(j)). */
01119 
01120                                 rec = 1. / xj;
01121                                 zdscal_(n, &rec, &x[1], &c__1);
01122                                 *scale *= rec;
01123                                 xmax *= rec;
01124                             }
01125                         }
01126                         i__3 = j;
01127                         zladiv_(&z__1, &x[j], &tjjs);
01128                         x[i__3].r = z__1.r, x[i__3].i = z__1.i;
01129                     } else if (tjj > 0.) {
01130 
01131 /*                       0 < abs(A(j,j)) <= SMLNUM: */
01132 
01133                         if (xj > tjj * bignum) {
01134 
01135 /*                          Scale x by (1/abs(x(j)))*abs(A(j,j))*BIGNUM. */
01136 
01137                             rec = tjj * bignum / xj;
01138                             zdscal_(n, &rec, &x[1], &c__1);
01139                             *scale *= rec;
01140                             xmax *= rec;
01141                         }
01142                         i__3 = j;
01143                         zladiv_(&z__1, &x[j], &tjjs);
01144                         x[i__3].r = z__1.r, x[i__3].i = z__1.i;
01145                     } else {
01146 
01147 /*                       A(j,j) = 0:  Set x(1:n) = 0, x(j) = 1, and */
01148 /*                       scale = 0 and compute a solution to A**H *x = 0. */
01149 
01150                         i__3 = *n;
01151                         for (i__ = 1; i__ <= i__3; ++i__) {
01152                             i__4 = i__;
01153                             x[i__4].r = 0., x[i__4].i = 0.;
01154 /* L200: */
01155                         }
01156                         i__3 = j;
01157                         x[i__3].r = 1., x[i__3].i = 0.;
01158                         *scale = 0.;
01159                         xmax = 0.;
01160                     }
01161 L210:
01162                     ;
01163                 } else {
01164 
01165 /*                 Compute x(j) := x(j) / A(j,j) - CSUMJ if the dot */
01166 /*                 product has already been divided by 1/A(j,j). */
01167 
01168                     i__3 = j;
01169                     zladiv_(&z__2, &x[j], &tjjs);
01170                     z__1.r = z__2.r - csumj.r, z__1.i = z__2.i - csumj.i;
01171                     x[i__3].r = z__1.r, x[i__3].i = z__1.i;
01172                 }
01173 /* Computing MAX */
01174                 i__3 = j;
01175                 d__3 = xmax, d__4 = (d__1 = x[i__3].r, abs(d__1)) + (d__2 = 
01176                         d_imag(&x[j]), abs(d__2));
01177                 xmax = max(d__3,d__4);
01178 /* L220: */
01179             }
01180         }
01181         *scale /= tscal;
01182     }
01183 
01184 /*     Scale the column norms by 1/TSCAL for return. */
01185 
01186     if (tscal != 1.) {
01187         d__1 = 1. / tscal;
01188         dscal_(n, &d__1, &cnorm[1], &c__1);
01189     }
01190 
01191     return 0;
01192 
01193 /*     End of ZLATBS */
01194 
01195 } /* zlatbs_ */


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