ctbsv.c
Go to the documentation of this file.
00001 /* ctbsv.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 /* Subroutine */ int ctbsv_(char *uplo, char *trans, char *diag, integer *n, 
00017         integer *k, complex *a, integer *lda, complex *x, integer *incx)
00018 {
00019     /* System generated locals */
00020     integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
00021     complex q__1, q__2, q__3;
00022 
00023     /* Builtin functions */
00024     void c_div(complex *, complex *, complex *), r_cnjg(complex *, complex *);
00025 
00026     /* Local variables */
00027     integer i__, j, l, ix, jx, kx, info;
00028     complex temp;
00029     extern logical lsame_(char *, char *);
00030     integer kplus1;
00031     extern /* Subroutine */ int xerbla_(char *, integer *);
00032     logical noconj, nounit;
00033 
00034 /*     .. Scalar Arguments .. */
00035 /*     .. */
00036 /*     .. Array Arguments .. */
00037 /*     .. */
00038 
00039 /*  Purpose */
00040 /*  ======= */
00041 
00042 /*  CTBSV  solves one of the systems of equations */
00043 
00044 /*     A*x = b,   or   A'*x = b,   or   conjg( A' )*x = b, */
00045 
00046 /*  where b and x are n element vectors and A is an n by n unit, or */
00047 /*  non-unit, upper or lower triangular band matrix, with ( k + 1 ) */
00048 /*  diagonals. */
00049 
00050 /*  No test for singularity or near-singularity is included in this */
00051 /*  routine. Such tests must be performed before calling this routine. */
00052 
00053 /*  Arguments */
00054 /*  ========== */
00055 
00056 /*  UPLO   - CHARACTER*1. */
00057 /*           On entry, UPLO specifies whether the matrix is an upper or */
00058 /*           lower triangular matrix as follows: */
00059 
00060 /*              UPLO = 'U' or 'u'   A is an upper triangular matrix. */
00061 
00062 /*              UPLO = 'L' or 'l'   A is a lower triangular matrix. */
00063 
00064 /*           Unchanged on exit. */
00065 
00066 /*  TRANS  - CHARACTER*1. */
00067 /*           On entry, TRANS specifies the equations to be solved as */
00068 /*           follows: */
00069 
00070 /*              TRANS = 'N' or 'n'   A*x = b. */
00071 
00072 /*              TRANS = 'T' or 't'   A'*x = b. */
00073 
00074 /*              TRANS = 'C' or 'c'   conjg( A' )*x = b. */
00075 
00076 /*           Unchanged on exit. */
00077 
00078 /*  DIAG   - CHARACTER*1. */
00079 /*           On entry, DIAG specifies whether or not A is unit */
00080 /*           triangular as follows: */
00081 
00082 /*              DIAG = 'U' or 'u'   A is assumed to be unit triangular. */
00083 
00084 /*              DIAG = 'N' or 'n'   A is not assumed to be unit */
00085 /*                                  triangular. */
00086 
00087 /*           Unchanged on exit. */
00088 
00089 /*  N      - INTEGER. */
00090 /*           On entry, N specifies the order of the matrix A. */
00091 /*           N must be at least zero. */
00092 /*           Unchanged on exit. */
00093 
00094 /*  K      - INTEGER. */
00095 /*           On entry with UPLO = 'U' or 'u', K specifies the number of */
00096 /*           super-diagonals of the matrix A. */
00097 /*           On entry with UPLO = 'L' or 'l', K specifies the number of */
00098 /*           sub-diagonals of the matrix A. */
00099 /*           K must satisfy  0 .le. K. */
00100 /*           Unchanged on exit. */
00101 
00102 /*  A      - COMPLEX          array of DIMENSION ( LDA, n ). */
00103 /*           Before entry with UPLO = 'U' or 'u', the leading ( k + 1 ) */
00104 /*           by n part of the array A must contain the upper triangular */
00105 /*           band part of the matrix of coefficients, supplied column by */
00106 /*           column, with the leading diagonal of the matrix in row */
00107 /*           ( k + 1 ) of the array, the first super-diagonal starting at */
00108 /*           position 2 in row k, and so on. The top left k by k triangle */
00109 /*           of the array A is not referenced. */
00110 /*           The following program segment will transfer an upper */
00111 /*           triangular band matrix from conventional full matrix storage */
00112 /*           to band storage: */
00113 
00114 /*                 DO 20, J = 1, N */
00115 /*                    M = K + 1 - J */
00116 /*                    DO 10, I = MAX( 1, J - K ), J */
00117 /*                       A( M + I, J ) = matrix( I, J ) */
00118 /*              10    CONTINUE */
00119 /*              20 CONTINUE */
00120 
00121 /*           Before entry with UPLO = 'L' or 'l', the leading ( k + 1 ) */
00122 /*           by n part of the array A must contain the lower triangular */
00123 /*           band part of the matrix of coefficients, supplied column by */
00124 /*           column, with the leading diagonal of the matrix in row 1 of */
00125 /*           the array, the first sub-diagonal starting at position 1 in */
00126 /*           row 2, and so on. The bottom right k by k triangle of the */
00127 /*           array A is not referenced. */
00128 /*           The following program segment will transfer a lower */
00129 /*           triangular band matrix from conventional full matrix storage */
00130 /*           to band storage: */
00131 
00132 /*                 DO 20, J = 1, N */
00133 /*                    M = 1 - J */
00134 /*                    DO 10, I = J, MIN( N, J + K ) */
00135 /*                       A( M + I, J ) = matrix( I, J ) */
00136 /*              10    CONTINUE */
00137 /*              20 CONTINUE */
00138 
00139 /*           Note that when DIAG = 'U' or 'u' the elements of the array A */
00140 /*           corresponding to the diagonal elements of the matrix are not */
00141 /*           referenced, but are assumed to be unity. */
00142 /*           Unchanged on exit. */
00143 
00144 /*  LDA    - INTEGER. */
00145 /*           On entry, LDA specifies the first dimension of A as declared */
00146 /*           in the calling (sub) program. LDA must be at least */
00147 /*           ( k + 1 ). */
00148 /*           Unchanged on exit. */
00149 
00150 /*  X      - COMPLEX          array of dimension at least */
00151 /*           ( 1 + ( n - 1 )*abs( INCX ) ). */
00152 /*           Before entry, the incremented array X must contain the n */
00153 /*           element right-hand side vector b. On exit, X is overwritten */
00154 /*           with the solution vector x. */
00155 
00156 /*  INCX   - INTEGER. */
00157 /*           On entry, INCX specifies the increment for the elements of */
00158 /*           X. INCX must not be zero. */
00159 /*           Unchanged on exit. */
00160 
00161 
00162 /*  Level 2 Blas routine. */
00163 
00164 /*  -- Written on 22-October-1986. */
00165 /*     Jack Dongarra, Argonne National Lab. */
00166 /*     Jeremy Du Croz, Nag Central Office. */
00167 /*     Sven Hammarling, Nag Central Office. */
00168 /*     Richard Hanson, Sandia National Labs. */
00169 
00170 
00171 /*     .. Parameters .. */
00172 /*     .. */
00173 /*     .. Local Scalars .. */
00174 /*     .. */
00175 /*     .. External Functions .. */
00176 /*     .. */
00177 /*     .. External Subroutines .. */
00178 /*     .. */
00179 /*     .. Intrinsic Functions .. */
00180 /*     .. */
00181 
00182 /*     Test the input parameters. */
00183 
00184     /* Parameter adjustments */
00185     a_dim1 = *lda;
00186     a_offset = 1 + a_dim1;
00187     a -= a_offset;
00188     --x;
00189 
00190     /* Function Body */
00191     info = 0;
00192     if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) {
00193         info = 1;
00194     } else if (! lsame_(trans, "N") && ! lsame_(trans, 
00195             "T") && ! lsame_(trans, "C")) {
00196         info = 2;
00197     } else if (! lsame_(diag, "U") && ! lsame_(diag, 
00198             "N")) {
00199         info = 3;
00200     } else if (*n < 0) {
00201         info = 4;
00202     } else if (*k < 0) {
00203         info = 5;
00204     } else if (*lda < *k + 1) {
00205         info = 7;
00206     } else if (*incx == 0) {
00207         info = 9;
00208     }
00209     if (info != 0) {
00210         xerbla_("CTBSV ", &info);
00211         return 0;
00212     }
00213 
00214 /*     Quick return if possible. */
00215 
00216     if (*n == 0) {
00217         return 0;
00218     }
00219 
00220     noconj = lsame_(trans, "T");
00221     nounit = lsame_(diag, "N");
00222 
00223 /*     Set up the start point in X if the increment is not unity. This */
00224 /*     will be  ( N - 1 )*INCX  too small for descending loops. */
00225 
00226     if (*incx <= 0) {
00227         kx = 1 - (*n - 1) * *incx;
00228     } else if (*incx != 1) {
00229         kx = 1;
00230     }
00231 
00232 /*     Start the operations. In this version the elements of A are */
00233 /*     accessed by sequentially with one pass through A. */
00234 
00235     if (lsame_(trans, "N")) {
00236 
00237 /*        Form  x := inv( A )*x. */
00238 
00239         if (lsame_(uplo, "U")) {
00240             kplus1 = *k + 1;
00241             if (*incx == 1) {
00242                 for (j = *n; j >= 1; --j) {
00243                     i__1 = j;
00244                     if (x[i__1].r != 0.f || x[i__1].i != 0.f) {
00245                         l = kplus1 - j;
00246                         if (nounit) {
00247                             i__1 = j;
00248                             c_div(&q__1, &x[j], &a[kplus1 + j * a_dim1]);
00249                             x[i__1].r = q__1.r, x[i__1].i = q__1.i;
00250                         }
00251                         i__1 = j;
00252                         temp.r = x[i__1].r, temp.i = x[i__1].i;
00253 /* Computing MAX */
00254                         i__2 = 1, i__3 = j - *k;
00255                         i__1 = max(i__2,i__3);
00256                         for (i__ = j - 1; i__ >= i__1; --i__) {
00257                             i__2 = i__;
00258                             i__3 = i__;
00259                             i__4 = l + i__ + j * a_dim1;
00260                             q__2.r = temp.r * a[i__4].r - temp.i * a[i__4].i, 
00261                                     q__2.i = temp.r * a[i__4].i + temp.i * a[
00262                                     i__4].r;
00263                             q__1.r = x[i__3].r - q__2.r, q__1.i = x[i__3].i - 
00264                                     q__2.i;
00265                             x[i__2].r = q__1.r, x[i__2].i = q__1.i;
00266 /* L10: */
00267                         }
00268                     }
00269 /* L20: */
00270                 }
00271             } else {
00272                 kx += (*n - 1) * *incx;
00273                 jx = kx;
00274                 for (j = *n; j >= 1; --j) {
00275                     kx -= *incx;
00276                     i__1 = jx;
00277                     if (x[i__1].r != 0.f || x[i__1].i != 0.f) {
00278                         ix = kx;
00279                         l = kplus1 - j;
00280                         if (nounit) {
00281                             i__1 = jx;
00282                             c_div(&q__1, &x[jx], &a[kplus1 + j * a_dim1]);
00283                             x[i__1].r = q__1.r, x[i__1].i = q__1.i;
00284                         }
00285                         i__1 = jx;
00286                         temp.r = x[i__1].r, temp.i = x[i__1].i;
00287 /* Computing MAX */
00288                         i__2 = 1, i__3 = j - *k;
00289                         i__1 = max(i__2,i__3);
00290                         for (i__ = j - 1; i__ >= i__1; --i__) {
00291                             i__2 = ix;
00292                             i__3 = ix;
00293                             i__4 = l + i__ + j * a_dim1;
00294                             q__2.r = temp.r * a[i__4].r - temp.i * a[i__4].i, 
00295                                     q__2.i = temp.r * a[i__4].i + temp.i * a[
00296                                     i__4].r;
00297                             q__1.r = x[i__3].r - q__2.r, q__1.i = x[i__3].i - 
00298                                     q__2.i;
00299                             x[i__2].r = q__1.r, x[i__2].i = q__1.i;
00300                             ix -= *incx;
00301 /* L30: */
00302                         }
00303                     }
00304                     jx -= *incx;
00305 /* L40: */
00306                 }
00307             }
00308         } else {
00309             if (*incx == 1) {
00310                 i__1 = *n;
00311                 for (j = 1; j <= i__1; ++j) {
00312                     i__2 = j;
00313                     if (x[i__2].r != 0.f || x[i__2].i != 0.f) {
00314                         l = 1 - j;
00315                         if (nounit) {
00316                             i__2 = j;
00317                             c_div(&q__1, &x[j], &a[j * a_dim1 + 1]);
00318                             x[i__2].r = q__1.r, x[i__2].i = q__1.i;
00319                         }
00320                         i__2 = j;
00321                         temp.r = x[i__2].r, temp.i = x[i__2].i;
00322 /* Computing MIN */
00323                         i__3 = *n, i__4 = j + *k;
00324                         i__2 = min(i__3,i__4);
00325                         for (i__ = j + 1; i__ <= i__2; ++i__) {
00326                             i__3 = i__;
00327                             i__4 = i__;
00328                             i__5 = l + i__ + j * a_dim1;
00329                             q__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i, 
00330                                     q__2.i = temp.r * a[i__5].i + temp.i * a[
00331                                     i__5].r;
00332                             q__1.r = x[i__4].r - q__2.r, q__1.i = x[i__4].i - 
00333                                     q__2.i;
00334                             x[i__3].r = q__1.r, x[i__3].i = q__1.i;
00335 /* L50: */
00336                         }
00337                     }
00338 /* L60: */
00339                 }
00340             } else {
00341                 jx = kx;
00342                 i__1 = *n;
00343                 for (j = 1; j <= i__1; ++j) {
00344                     kx += *incx;
00345                     i__2 = jx;
00346                     if (x[i__2].r != 0.f || x[i__2].i != 0.f) {
00347                         ix = kx;
00348                         l = 1 - j;
00349                         if (nounit) {
00350                             i__2 = jx;
00351                             c_div(&q__1, &x[jx], &a[j * a_dim1 + 1]);
00352                             x[i__2].r = q__1.r, x[i__2].i = q__1.i;
00353                         }
00354                         i__2 = jx;
00355                         temp.r = x[i__2].r, temp.i = x[i__2].i;
00356 /* Computing MIN */
00357                         i__3 = *n, i__4 = j + *k;
00358                         i__2 = min(i__3,i__4);
00359                         for (i__ = j + 1; i__ <= i__2; ++i__) {
00360                             i__3 = ix;
00361                             i__4 = ix;
00362                             i__5 = l + i__ + j * a_dim1;
00363                             q__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i, 
00364                                     q__2.i = temp.r * a[i__5].i + temp.i * a[
00365                                     i__5].r;
00366                             q__1.r = x[i__4].r - q__2.r, q__1.i = x[i__4].i - 
00367                                     q__2.i;
00368                             x[i__3].r = q__1.r, x[i__3].i = q__1.i;
00369                             ix += *incx;
00370 /* L70: */
00371                         }
00372                     }
00373                     jx += *incx;
00374 /* L80: */
00375                 }
00376             }
00377         }
00378     } else {
00379 
00380 /*        Form  x := inv( A' )*x  or  x := inv( conjg( A') )*x. */
00381 
00382         if (lsame_(uplo, "U")) {
00383             kplus1 = *k + 1;
00384             if (*incx == 1) {
00385                 i__1 = *n;
00386                 for (j = 1; j <= i__1; ++j) {
00387                     i__2 = j;
00388                     temp.r = x[i__2].r, temp.i = x[i__2].i;
00389                     l = kplus1 - j;
00390                     if (noconj) {
00391 /* Computing MAX */
00392                         i__2 = 1, i__3 = j - *k;
00393                         i__4 = j - 1;
00394                         for (i__ = max(i__2,i__3); i__ <= i__4; ++i__) {
00395                             i__2 = l + i__ + j * a_dim1;
00396                             i__3 = i__;
00397                             q__2.r = a[i__2].r * x[i__3].r - a[i__2].i * x[
00398                                     i__3].i, q__2.i = a[i__2].r * x[i__3].i + 
00399                                     a[i__2].i * x[i__3].r;
00400                             q__1.r = temp.r - q__2.r, q__1.i = temp.i - 
00401                                     q__2.i;
00402                             temp.r = q__1.r, temp.i = q__1.i;
00403 /* L90: */
00404                         }
00405                         if (nounit) {
00406                             c_div(&q__1, &temp, &a[kplus1 + j * a_dim1]);
00407                             temp.r = q__1.r, temp.i = q__1.i;
00408                         }
00409                     } else {
00410 /* Computing MAX */
00411                         i__4 = 1, i__2 = j - *k;
00412                         i__3 = j - 1;
00413                         for (i__ = max(i__4,i__2); i__ <= i__3; ++i__) {
00414                             r_cnjg(&q__3, &a[l + i__ + j * a_dim1]);
00415                             i__4 = i__;
00416                             q__2.r = q__3.r * x[i__4].r - q__3.i * x[i__4].i, 
00417                                     q__2.i = q__3.r * x[i__4].i + q__3.i * x[
00418                                     i__4].r;
00419                             q__1.r = temp.r - q__2.r, q__1.i = temp.i - 
00420                                     q__2.i;
00421                             temp.r = q__1.r, temp.i = q__1.i;
00422 /* L100: */
00423                         }
00424                         if (nounit) {
00425                             r_cnjg(&q__2, &a[kplus1 + j * a_dim1]);
00426                             c_div(&q__1, &temp, &q__2);
00427                             temp.r = q__1.r, temp.i = q__1.i;
00428                         }
00429                     }
00430                     i__3 = j;
00431                     x[i__3].r = temp.r, x[i__3].i = temp.i;
00432 /* L110: */
00433                 }
00434             } else {
00435                 jx = kx;
00436                 i__1 = *n;
00437                 for (j = 1; j <= i__1; ++j) {
00438                     i__3 = jx;
00439                     temp.r = x[i__3].r, temp.i = x[i__3].i;
00440                     ix = kx;
00441                     l = kplus1 - j;
00442                     if (noconj) {
00443 /* Computing MAX */
00444                         i__3 = 1, i__4 = j - *k;
00445                         i__2 = j - 1;
00446                         for (i__ = max(i__3,i__4); i__ <= i__2; ++i__) {
00447                             i__3 = l + i__ + j * a_dim1;
00448                             i__4 = ix;
00449                             q__2.r = a[i__3].r * x[i__4].r - a[i__3].i * x[
00450                                     i__4].i, q__2.i = a[i__3].r * x[i__4].i + 
00451                                     a[i__3].i * x[i__4].r;
00452                             q__1.r = temp.r - q__2.r, q__1.i = temp.i - 
00453                                     q__2.i;
00454                             temp.r = q__1.r, temp.i = q__1.i;
00455                             ix += *incx;
00456 /* L120: */
00457                         }
00458                         if (nounit) {
00459                             c_div(&q__1, &temp, &a[kplus1 + j * a_dim1]);
00460                             temp.r = q__1.r, temp.i = q__1.i;
00461                         }
00462                     } else {
00463 /* Computing MAX */
00464                         i__2 = 1, i__3 = j - *k;
00465                         i__4 = j - 1;
00466                         for (i__ = max(i__2,i__3); i__ <= i__4; ++i__) {
00467                             r_cnjg(&q__3, &a[l + i__ + j * a_dim1]);
00468                             i__2 = ix;
00469                             q__2.r = q__3.r * x[i__2].r - q__3.i * x[i__2].i, 
00470                                     q__2.i = q__3.r * x[i__2].i + q__3.i * x[
00471                                     i__2].r;
00472                             q__1.r = temp.r - q__2.r, q__1.i = temp.i - 
00473                                     q__2.i;
00474                             temp.r = q__1.r, temp.i = q__1.i;
00475                             ix += *incx;
00476 /* L130: */
00477                         }
00478                         if (nounit) {
00479                             r_cnjg(&q__2, &a[kplus1 + j * a_dim1]);
00480                             c_div(&q__1, &temp, &q__2);
00481                             temp.r = q__1.r, temp.i = q__1.i;
00482                         }
00483                     }
00484                     i__4 = jx;
00485                     x[i__4].r = temp.r, x[i__4].i = temp.i;
00486                     jx += *incx;
00487                     if (j > *k) {
00488                         kx += *incx;
00489                     }
00490 /* L140: */
00491                 }
00492             }
00493         } else {
00494             if (*incx == 1) {
00495                 for (j = *n; j >= 1; --j) {
00496                     i__1 = j;
00497                     temp.r = x[i__1].r, temp.i = x[i__1].i;
00498                     l = 1 - j;
00499                     if (noconj) {
00500 /* Computing MIN */
00501                         i__1 = *n, i__4 = j + *k;
00502                         i__2 = j + 1;
00503                         for (i__ = min(i__1,i__4); i__ >= i__2; --i__) {
00504                             i__1 = l + i__ + j * a_dim1;
00505                             i__4 = i__;
00506                             q__2.r = a[i__1].r * x[i__4].r - a[i__1].i * x[
00507                                     i__4].i, q__2.i = a[i__1].r * x[i__4].i + 
00508                                     a[i__1].i * x[i__4].r;
00509                             q__1.r = temp.r - q__2.r, q__1.i = temp.i - 
00510                                     q__2.i;
00511                             temp.r = q__1.r, temp.i = q__1.i;
00512 /* L150: */
00513                         }
00514                         if (nounit) {
00515                             c_div(&q__1, &temp, &a[j * a_dim1 + 1]);
00516                             temp.r = q__1.r, temp.i = q__1.i;
00517                         }
00518                     } else {
00519 /* Computing MIN */
00520                         i__2 = *n, i__1 = j + *k;
00521                         i__4 = j + 1;
00522                         for (i__ = min(i__2,i__1); i__ >= i__4; --i__) {
00523                             r_cnjg(&q__3, &a[l + i__ + j * a_dim1]);
00524                             i__2 = i__;
00525                             q__2.r = q__3.r * x[i__2].r - q__3.i * x[i__2].i, 
00526                                     q__2.i = q__3.r * x[i__2].i + q__3.i * x[
00527                                     i__2].r;
00528                             q__1.r = temp.r - q__2.r, q__1.i = temp.i - 
00529                                     q__2.i;
00530                             temp.r = q__1.r, temp.i = q__1.i;
00531 /* L160: */
00532                         }
00533                         if (nounit) {
00534                             r_cnjg(&q__2, &a[j * a_dim1 + 1]);
00535                             c_div(&q__1, &temp, &q__2);
00536                             temp.r = q__1.r, temp.i = q__1.i;
00537                         }
00538                     }
00539                     i__4 = j;
00540                     x[i__4].r = temp.r, x[i__4].i = temp.i;
00541 /* L170: */
00542                 }
00543             } else {
00544                 kx += (*n - 1) * *incx;
00545                 jx = kx;
00546                 for (j = *n; j >= 1; --j) {
00547                     i__4 = jx;
00548                     temp.r = x[i__4].r, temp.i = x[i__4].i;
00549                     ix = kx;
00550                     l = 1 - j;
00551                     if (noconj) {
00552 /* Computing MIN */
00553                         i__4 = *n, i__2 = j + *k;
00554                         i__1 = j + 1;
00555                         for (i__ = min(i__4,i__2); i__ >= i__1; --i__) {
00556                             i__4 = l + i__ + j * a_dim1;
00557                             i__2 = ix;
00558                             q__2.r = a[i__4].r * x[i__2].r - a[i__4].i * x[
00559                                     i__2].i, q__2.i = a[i__4].r * x[i__2].i + 
00560                                     a[i__4].i * x[i__2].r;
00561                             q__1.r = temp.r - q__2.r, q__1.i = temp.i - 
00562                                     q__2.i;
00563                             temp.r = q__1.r, temp.i = q__1.i;
00564                             ix -= *incx;
00565 /* L180: */
00566                         }
00567                         if (nounit) {
00568                             c_div(&q__1, &temp, &a[j * a_dim1 + 1]);
00569                             temp.r = q__1.r, temp.i = q__1.i;
00570                         }
00571                     } else {
00572 /* Computing MIN */
00573                         i__1 = *n, i__4 = j + *k;
00574                         i__2 = j + 1;
00575                         for (i__ = min(i__1,i__4); i__ >= i__2; --i__) {
00576                             r_cnjg(&q__3, &a[l + i__ + j * a_dim1]);
00577                             i__1 = ix;
00578                             q__2.r = q__3.r * x[i__1].r - q__3.i * x[i__1].i, 
00579                                     q__2.i = q__3.r * x[i__1].i + q__3.i * x[
00580                                     i__1].r;
00581                             q__1.r = temp.r - q__2.r, q__1.i = temp.i - 
00582                                     q__2.i;
00583                             temp.r = q__1.r, temp.i = q__1.i;
00584                             ix -= *incx;
00585 /* L190: */
00586                         }
00587                         if (nounit) {
00588                             r_cnjg(&q__2, &a[j * a_dim1 + 1]);
00589                             c_div(&q__1, &temp, &q__2);
00590                             temp.r = q__1.r, temp.i = q__1.i;
00591                         }
00592                     }
00593                     i__2 = jx;
00594                     x[i__2].r = temp.r, x[i__2].i = temp.i;
00595                     jx -= *incx;
00596                     if (*n - j >= *k) {
00597                         kx -= *incx;
00598                     }
00599 /* L200: */
00600                 }
00601             }
00602         }
00603     }
00604 
00605     return 0;
00606 
00607 /*     End of CTBSV . */
00608 
00609 } /* ctbsv_ */


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