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


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