cgbbrd.c
Go to the documentation of this file.
00001 /* cgbbrd.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 complex c_b1 = {0.f,0.f};
00019 static complex c_b2 = {1.f,0.f};
00020 static integer c__1 = 1;
00021 
00022 /* Subroutine */ int cgbbrd_(char *vect, integer *m, integer *n, integer *ncc, 
00023          integer *kl, integer *ku, complex *ab, integer *ldab, real *d__, 
00024         real *e, complex *q, integer *ldq, complex *pt, integer *ldpt, 
00025         complex *c__, integer *ldc, complex *work, real *rwork, integer *info)
00026 {
00027     /* System generated locals */
00028     integer ab_dim1, ab_offset, c_dim1, c_offset, pt_dim1, pt_offset, q_dim1, 
00029             q_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7;
00030     complex q__1, q__2, q__3;
00031 
00032     /* Builtin functions */
00033     void r_cnjg(complex *, complex *);
00034     double c_abs(complex *);
00035 
00036     /* Local variables */
00037     integer i__, j, l;
00038     complex t;
00039     integer j1, j2, kb;
00040     complex ra, rb;
00041     real rc;
00042     integer kk, ml, nr, mu;
00043     complex rs;
00044     integer kb1, ml0, mu0, klm, kun, nrt, klu1, inca;
00045     real abst;
00046     extern /* Subroutine */ int crot_(integer *, complex *, integer *, 
00047             complex *, integer *, real *, complex *), cscal_(integer *, 
00048             complex *, complex *, integer *);
00049     extern logical lsame_(char *, char *);
00050     logical wantb, wantc;
00051     integer minmn;
00052     logical wantq;
00053     extern /* Subroutine */ int claset_(char *, integer *, integer *, complex 
00054             *, complex *, complex *, integer *), clartg_(complex *, 
00055             complex *, real *, complex *, complex *), xerbla_(char *, integer 
00056             *), clargv_(integer *, complex *, integer *, complex *, 
00057             integer *, real *, integer *), clartv_(integer *, complex *, 
00058             integer *, complex *, integer *, real *, complex *, integer *);
00059     logical wantpt;
00060 
00061 
00062 /*  -- LAPACK routine (version 3.2) -- */
00063 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00064 /*     November 2006 */
00065 
00066 /*     .. Scalar Arguments .. */
00067 /*     .. */
00068 /*     .. Array Arguments .. */
00069 /*     .. */
00070 
00071 /*  Purpose */
00072 /*  ======= */
00073 
00074 /*  CGBBRD reduces a complex general m-by-n band matrix A to real upper */
00075 /*  bidiagonal form B by a unitary transformation: Q' * A * P = B. */
00076 
00077 /*  The routine computes B, and optionally forms Q or P', or computes */
00078 /*  Q'*C for a given matrix C. */
00079 
00080 /*  Arguments */
00081 /*  ========= */
00082 
00083 /*  VECT    (input) CHARACTER*1 */
00084 /*          Specifies whether or not the matrices Q and P' are to be */
00085 /*          formed. */
00086 /*          = 'N': do not form Q or P'; */
00087 /*          = 'Q': form Q only; */
00088 /*          = 'P': form P' only; */
00089 /*          = 'B': form both. */
00090 
00091 /*  M       (input) INTEGER */
00092 /*          The number of rows of the matrix A.  M >= 0. */
00093 
00094 /*  N       (input) INTEGER */
00095 /*          The number of columns of the matrix A.  N >= 0. */
00096 
00097 /*  NCC     (input) INTEGER */
00098 /*          The number of columns of the matrix C.  NCC >= 0. */
00099 
00100 /*  KL      (input) INTEGER */
00101 /*          The number of subdiagonals of the matrix A. KL >= 0. */
00102 
00103 /*  KU      (input) INTEGER */
00104 /*          The number of superdiagonals of the matrix A. KU >= 0. */
00105 
00106 /*  AB      (input/output) COMPLEX array, dimension (LDAB,N) */
00107 /*          On entry, the m-by-n band matrix A, stored in rows 1 to */
00108 /*          KL+KU+1. The j-th column of A is stored in the j-th column of */
00109 /*          the array AB as follows: */
00110 /*          AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl). */
00111 /*          On exit, A is overwritten by values generated during the */
00112 /*          reduction. */
00113 
00114 /*  LDAB    (input) INTEGER */
00115 /*          The leading dimension of the array A. LDAB >= KL+KU+1. */
00116 
00117 /*  D       (output) REAL array, dimension (min(M,N)) */
00118 /*          The diagonal elements of the bidiagonal matrix B. */
00119 
00120 /*  E       (output) REAL array, dimension (min(M,N)-1) */
00121 /*          The superdiagonal elements of the bidiagonal matrix B. */
00122 
00123 /*  Q       (output) COMPLEX array, dimension (LDQ,M) */
00124 /*          If VECT = 'Q' or 'B', the m-by-m unitary matrix Q. */
00125 /*          If VECT = 'N' or 'P', the array Q is not referenced. */
00126 
00127 /*  LDQ     (input) INTEGER */
00128 /*          The leading dimension of the array Q. */
00129 /*          LDQ >= max(1,M) if VECT = 'Q' or 'B'; LDQ >= 1 otherwise. */
00130 
00131 /*  PT      (output) COMPLEX array, dimension (LDPT,N) */
00132 /*          If VECT = 'P' or 'B', the n-by-n unitary matrix P'. */
00133 /*          If VECT = 'N' or 'Q', the array PT is not referenced. */
00134 
00135 /*  LDPT    (input) INTEGER */
00136 /*          The leading dimension of the array PT. */
00137 /*          LDPT >= max(1,N) if VECT = 'P' or 'B'; LDPT >= 1 otherwise. */
00138 
00139 /*  C       (input/output) COMPLEX array, dimension (LDC,NCC) */
00140 /*          On entry, an m-by-ncc matrix C. */
00141 /*          On exit, C is overwritten by Q'*C. */
00142 /*          C is not referenced if NCC = 0. */
00143 
00144 /*  LDC     (input) INTEGER */
00145 /*          The leading dimension of the array C. */
00146 /*          LDC >= max(1,M) if NCC > 0; LDC >= 1 if NCC = 0. */
00147 
00148 /*  WORK    (workspace) COMPLEX array, dimension (max(M,N)) */
00149 
00150 /*  RWORK   (workspace) REAL array, dimension (max(M,N)) */
00151 
00152 /*  INFO    (output) INTEGER */
00153 /*          = 0:  successful exit. */
00154 /*          < 0:  if INFO = -i, the i-th argument had an illegal value. */
00155 
00156 /*  ===================================================================== */
00157 
00158 /*     .. Parameters .. */
00159 /*     .. */
00160 /*     .. Local Scalars .. */
00161 /*     .. */
00162 /*     .. External Subroutines .. */
00163 /*     .. */
00164 /*     .. Intrinsic Functions .. */
00165 /*     .. */
00166 /*     .. External Functions .. */
00167 /*     .. */
00168 /*     .. Executable Statements .. */
00169 
00170 /*     Test the input parameters */
00171 
00172     /* Parameter adjustments */
00173     ab_dim1 = *ldab;
00174     ab_offset = 1 + ab_dim1;
00175     ab -= ab_offset;
00176     --d__;
00177     --e;
00178     q_dim1 = *ldq;
00179     q_offset = 1 + q_dim1;
00180     q -= q_offset;
00181     pt_dim1 = *ldpt;
00182     pt_offset = 1 + pt_dim1;
00183     pt -= pt_offset;
00184     c_dim1 = *ldc;
00185     c_offset = 1 + c_dim1;
00186     c__ -= c_offset;
00187     --work;
00188     --rwork;
00189 
00190     /* Function Body */
00191     wantb = lsame_(vect, "B");
00192     wantq = lsame_(vect, "Q") || wantb;
00193     wantpt = lsame_(vect, "P") || wantb;
00194     wantc = *ncc > 0;
00195     klu1 = *kl + *ku + 1;
00196     *info = 0;
00197     if (! wantq && ! wantpt && ! lsame_(vect, "N")) {
00198         *info = -1;
00199     } else if (*m < 0) {
00200         *info = -2;
00201     } else if (*n < 0) {
00202         *info = -3;
00203     } else if (*ncc < 0) {
00204         *info = -4;
00205     } else if (*kl < 0) {
00206         *info = -5;
00207     } else if (*ku < 0) {
00208         *info = -6;
00209     } else if (*ldab < klu1) {
00210         *info = -8;
00211     } else if (*ldq < 1 || wantq && *ldq < max(1,*m)) {
00212         *info = -12;
00213     } else if (*ldpt < 1 || wantpt && *ldpt < max(1,*n)) {
00214         *info = -14;
00215     } else if (*ldc < 1 || wantc && *ldc < max(1,*m)) {
00216         *info = -16;
00217     }
00218     if (*info != 0) {
00219         i__1 = -(*info);
00220         xerbla_("CGBBRD", &i__1);
00221         return 0;
00222     }
00223 
00224 /*     Initialize Q and P' to the unit matrix, if needed */
00225 
00226     if (wantq) {
00227         claset_("Full", m, m, &c_b1, &c_b2, &q[q_offset], ldq);
00228     }
00229     if (wantpt) {
00230         claset_("Full", n, n, &c_b1, &c_b2, &pt[pt_offset], ldpt);
00231     }
00232 
00233 /*     Quick return if possible. */
00234 
00235     if (*m == 0 || *n == 0) {
00236         return 0;
00237     }
00238 
00239     minmn = min(*m,*n);
00240 
00241     if (*kl + *ku > 1) {
00242 
00243 /*        Reduce to upper bidiagonal form if KU > 0; if KU = 0, reduce */
00244 /*        first to lower bidiagonal form and then transform to upper */
00245 /*        bidiagonal */
00246 
00247         if (*ku > 0) {
00248             ml0 = 1;
00249             mu0 = 2;
00250         } else {
00251             ml0 = 2;
00252             mu0 = 1;
00253         }
00254 
00255 /*        Wherever possible, plane rotations are generated and applied in */
00256 /*        vector operations of length NR over the index set J1:J2:KLU1. */
00257 
00258 /*        The complex sines of the plane rotations are stored in WORK, */
00259 /*        and the real cosines in RWORK. */
00260 
00261 /* Computing MIN */
00262         i__1 = *m - 1;
00263         klm = min(i__1,*kl);
00264 /* Computing MIN */
00265         i__1 = *n - 1;
00266         kun = min(i__1,*ku);
00267         kb = klm + kun;
00268         kb1 = kb + 1;
00269         inca = kb1 * *ldab;
00270         nr = 0;
00271         j1 = klm + 2;
00272         j2 = 1 - kun;
00273 
00274         i__1 = minmn;
00275         for (i__ = 1; i__ <= i__1; ++i__) {
00276 
00277 /*           Reduce i-th column and i-th row of matrix to bidiagonal form */
00278 
00279             ml = klm + 1;
00280             mu = kun + 1;
00281             i__2 = kb;
00282             for (kk = 1; kk <= i__2; ++kk) {
00283                 j1 += kb;
00284                 j2 += kb;
00285 
00286 /*              generate plane rotations to annihilate nonzero elements */
00287 /*              which have been created below the band */
00288 
00289                 if (nr > 0) {
00290                     clargv_(&nr, &ab[klu1 + (j1 - klm - 1) * ab_dim1], &inca, 
00291                             &work[j1], &kb1, &rwork[j1], &kb1);
00292                 }
00293 
00294 /*              apply plane rotations from the left */
00295 
00296                 i__3 = kb;
00297                 for (l = 1; l <= i__3; ++l) {
00298                     if (j2 - klm + l - 1 > *n) {
00299                         nrt = nr - 1;
00300                     } else {
00301                         nrt = nr;
00302                     }
00303                     if (nrt > 0) {
00304                         clartv_(&nrt, &ab[klu1 - l + (j1 - klm + l - 1) * 
00305                                 ab_dim1], &inca, &ab[klu1 - l + 1 + (j1 - klm 
00306                                 + l - 1) * ab_dim1], &inca, &rwork[j1], &work[
00307                                 j1], &kb1);
00308                     }
00309 /* L10: */
00310                 }
00311 
00312                 if (ml > ml0) {
00313                     if (ml <= *m - i__ + 1) {
00314 
00315 /*                    generate plane rotation to annihilate a(i+ml-1,i) */
00316 /*                    within the band, and apply rotation from the left */
00317 
00318                         clartg_(&ab[*ku + ml - 1 + i__ * ab_dim1], &ab[*ku + 
00319                                 ml + i__ * ab_dim1], &rwork[i__ + ml - 1], &
00320                                 work[i__ + ml - 1], &ra);
00321                         i__3 = *ku + ml - 1 + i__ * ab_dim1;
00322                         ab[i__3].r = ra.r, ab[i__3].i = ra.i;
00323                         if (i__ < *n) {
00324 /* Computing MIN */
00325                             i__4 = *ku + ml - 2, i__5 = *n - i__;
00326                             i__3 = min(i__4,i__5);
00327                             i__6 = *ldab - 1;
00328                             i__7 = *ldab - 1;
00329                             crot_(&i__3, &ab[*ku + ml - 2 + (i__ + 1) * 
00330                                     ab_dim1], &i__6, &ab[*ku + ml - 1 + (i__ 
00331                                     + 1) * ab_dim1], &i__7, &rwork[i__ + ml - 
00332                                     1], &work[i__ + ml - 1]);
00333                         }
00334                     }
00335                     ++nr;
00336                     j1 -= kb1;
00337                 }
00338 
00339                 if (wantq) {
00340 
00341 /*                 accumulate product of plane rotations in Q */
00342 
00343                     i__3 = j2;
00344                     i__4 = kb1;
00345                     for (j = j1; i__4 < 0 ? j >= i__3 : j <= i__3; j += i__4) 
00346                             {
00347                         r_cnjg(&q__1, &work[j]);
00348                         crot_(m, &q[(j - 1) * q_dim1 + 1], &c__1, &q[j * 
00349                                 q_dim1 + 1], &c__1, &rwork[j], &q__1);
00350 /* L20: */
00351                     }
00352                 }
00353 
00354                 if (wantc) {
00355 
00356 /*                 apply plane rotations to C */
00357 
00358                     i__4 = j2;
00359                     i__3 = kb1;
00360                     for (j = j1; i__3 < 0 ? j >= i__4 : j <= i__4; j += i__3) 
00361                             {
00362                         crot_(ncc, &c__[j - 1 + c_dim1], ldc, &c__[j + c_dim1]
00363 , ldc, &rwork[j], &work[j]);
00364 /* L30: */
00365                     }
00366                 }
00367 
00368                 if (j2 + kun > *n) {
00369 
00370 /*                 adjust J2 to keep within the bounds of the matrix */
00371 
00372                     --nr;
00373                     j2 -= kb1;
00374                 }
00375 
00376                 i__3 = j2;
00377                 i__4 = kb1;
00378                 for (j = j1; i__4 < 0 ? j >= i__3 : j <= i__3; j += i__4) {
00379 
00380 /*                 create nonzero element a(j-1,j+ku) above the band */
00381 /*                 and store it in WORK(n+1:2*n) */
00382 
00383                     i__5 = j + kun;
00384                     i__6 = j;
00385                     i__7 = (j + kun) * ab_dim1 + 1;
00386                     q__1.r = work[i__6].r * ab[i__7].r - work[i__6].i * ab[
00387                             i__7].i, q__1.i = work[i__6].r * ab[i__7].i + 
00388                             work[i__6].i * ab[i__7].r;
00389                     work[i__5].r = q__1.r, work[i__5].i = q__1.i;
00390                     i__5 = (j + kun) * ab_dim1 + 1;
00391                     i__6 = j;
00392                     i__7 = (j + kun) * ab_dim1 + 1;
00393                     q__1.r = rwork[i__6] * ab[i__7].r, q__1.i = rwork[i__6] * 
00394                             ab[i__7].i;
00395                     ab[i__5].r = q__1.r, ab[i__5].i = q__1.i;
00396 /* L40: */
00397                 }
00398 
00399 /*              generate plane rotations to annihilate nonzero elements */
00400 /*              which have been generated above the band */
00401 
00402                 if (nr > 0) {
00403                     clargv_(&nr, &ab[(j1 + kun - 1) * ab_dim1 + 1], &inca, &
00404                             work[j1 + kun], &kb1, &rwork[j1 + kun], &kb1);
00405                 }
00406 
00407 /*              apply plane rotations from the right */
00408 
00409                 i__4 = kb;
00410                 for (l = 1; l <= i__4; ++l) {
00411                     if (j2 + l - 1 > *m) {
00412                         nrt = nr - 1;
00413                     } else {
00414                         nrt = nr;
00415                     }
00416                     if (nrt > 0) {
00417                         clartv_(&nrt, &ab[l + 1 + (j1 + kun - 1) * ab_dim1], &
00418                                 inca, &ab[l + (j1 + kun) * ab_dim1], &inca, &
00419                                 rwork[j1 + kun], &work[j1 + kun], &kb1);
00420                     }
00421 /* L50: */
00422                 }
00423 
00424                 if (ml == ml0 && mu > mu0) {
00425                     if (mu <= *n - i__ + 1) {
00426 
00427 /*                    generate plane rotation to annihilate a(i,i+mu-1) */
00428 /*                    within the band, and apply rotation from the right */
00429 
00430                         clartg_(&ab[*ku - mu + 3 + (i__ + mu - 2) * ab_dim1], 
00431                                 &ab[*ku - mu + 2 + (i__ + mu - 1) * ab_dim1], 
00432                                 &rwork[i__ + mu - 1], &work[i__ + mu - 1], &
00433                                 ra);
00434                         i__4 = *ku - mu + 3 + (i__ + mu - 2) * ab_dim1;
00435                         ab[i__4].r = ra.r, ab[i__4].i = ra.i;
00436 /* Computing MIN */
00437                         i__3 = *kl + mu - 2, i__5 = *m - i__;
00438                         i__4 = min(i__3,i__5);
00439                         crot_(&i__4, &ab[*ku - mu + 4 + (i__ + mu - 2) * 
00440                                 ab_dim1], &c__1, &ab[*ku - mu + 3 + (i__ + mu 
00441                                 - 1) * ab_dim1], &c__1, &rwork[i__ + mu - 1], 
00442                                 &work[i__ + mu - 1]);
00443                     }
00444                     ++nr;
00445                     j1 -= kb1;
00446                 }
00447 
00448                 if (wantpt) {
00449 
00450 /*                 accumulate product of plane rotations in P' */
00451 
00452                     i__4 = j2;
00453                     i__3 = kb1;
00454                     for (j = j1; i__3 < 0 ? j >= i__4 : j <= i__4; j += i__3) 
00455                             {
00456                         r_cnjg(&q__1, &work[j + kun]);
00457                         crot_(n, &pt[j + kun - 1 + pt_dim1], ldpt, &pt[j + 
00458                                 kun + pt_dim1], ldpt, &rwork[j + kun], &q__1);
00459 /* L60: */
00460                     }
00461                 }
00462 
00463                 if (j2 + kb > *m) {
00464 
00465 /*                 adjust J2 to keep within the bounds of the matrix */
00466 
00467                     --nr;
00468                     j2 -= kb1;
00469                 }
00470 
00471                 i__3 = j2;
00472                 i__4 = kb1;
00473                 for (j = j1; i__4 < 0 ? j >= i__3 : j <= i__3; j += i__4) {
00474 
00475 /*                 create nonzero element a(j+kl+ku,j+ku-1) below the */
00476 /*                 band and store it in WORK(1:n) */
00477 
00478                     i__5 = j + kb;
00479                     i__6 = j + kun;
00480                     i__7 = klu1 + (j + kun) * ab_dim1;
00481                     q__1.r = work[i__6].r * ab[i__7].r - work[i__6].i * ab[
00482                             i__7].i, q__1.i = work[i__6].r * ab[i__7].i + 
00483                             work[i__6].i * ab[i__7].r;
00484                     work[i__5].r = q__1.r, work[i__5].i = q__1.i;
00485                     i__5 = klu1 + (j + kun) * ab_dim1;
00486                     i__6 = j + kun;
00487                     i__7 = klu1 + (j + kun) * ab_dim1;
00488                     q__1.r = rwork[i__6] * ab[i__7].r, q__1.i = rwork[i__6] * 
00489                             ab[i__7].i;
00490                     ab[i__5].r = q__1.r, ab[i__5].i = q__1.i;
00491 /* L70: */
00492                 }
00493 
00494                 if (ml > ml0) {
00495                     --ml;
00496                 } else {
00497                     --mu;
00498                 }
00499 /* L80: */
00500             }
00501 /* L90: */
00502         }
00503     }
00504 
00505     if (*ku == 0 && *kl > 0) {
00506 
00507 /*        A has been reduced to complex lower bidiagonal form */
00508 
00509 /*        Transform lower bidiagonal form to upper bidiagonal by applying */
00510 /*        plane rotations from the left, overwriting superdiagonal */
00511 /*        elements on subdiagonal elements */
00512 
00513 /* Computing MIN */
00514         i__2 = *m - 1;
00515         i__1 = min(i__2,*n);
00516         for (i__ = 1; i__ <= i__1; ++i__) {
00517             clartg_(&ab[i__ * ab_dim1 + 1], &ab[i__ * ab_dim1 + 2], &rc, &rs, 
00518                     &ra);
00519             i__2 = i__ * ab_dim1 + 1;
00520             ab[i__2].r = ra.r, ab[i__2].i = ra.i;
00521             if (i__ < *n) {
00522                 i__2 = i__ * ab_dim1 + 2;
00523                 i__4 = (i__ + 1) * ab_dim1 + 1;
00524                 q__1.r = rs.r * ab[i__4].r - rs.i * ab[i__4].i, q__1.i = rs.r 
00525                         * ab[i__4].i + rs.i * ab[i__4].r;
00526                 ab[i__2].r = q__1.r, ab[i__2].i = q__1.i;
00527                 i__2 = (i__ + 1) * ab_dim1 + 1;
00528                 i__4 = (i__ + 1) * ab_dim1 + 1;
00529                 q__1.r = rc * ab[i__4].r, q__1.i = rc * ab[i__4].i;
00530                 ab[i__2].r = q__1.r, ab[i__2].i = q__1.i;
00531             }
00532             if (wantq) {
00533                 r_cnjg(&q__1, &rs);
00534                 crot_(m, &q[i__ * q_dim1 + 1], &c__1, &q[(i__ + 1) * q_dim1 + 
00535                         1], &c__1, &rc, &q__1);
00536             }
00537             if (wantc) {
00538                 crot_(ncc, &c__[i__ + c_dim1], ldc, &c__[i__ + 1 + c_dim1], 
00539                         ldc, &rc, &rs);
00540             }
00541 /* L100: */
00542         }
00543     } else {
00544 
00545 /*        A has been reduced to complex upper bidiagonal form or is */
00546 /*        diagonal */
00547 
00548         if (*ku > 0 && *m < *n) {
00549 
00550 /*           Annihilate a(m,m+1) by applying plane rotations from the */
00551 /*           right */
00552 
00553             i__1 = *ku + (*m + 1) * ab_dim1;
00554             rb.r = ab[i__1].r, rb.i = ab[i__1].i;
00555             for (i__ = *m; i__ >= 1; --i__) {
00556                 clartg_(&ab[*ku + 1 + i__ * ab_dim1], &rb, &rc, &rs, &ra);
00557                 i__1 = *ku + 1 + i__ * ab_dim1;
00558                 ab[i__1].r = ra.r, ab[i__1].i = ra.i;
00559                 if (i__ > 1) {
00560                     r_cnjg(&q__3, &rs);
00561                     q__2.r = -q__3.r, q__2.i = -q__3.i;
00562                     i__1 = *ku + i__ * ab_dim1;
00563                     q__1.r = q__2.r * ab[i__1].r - q__2.i * ab[i__1].i, 
00564                             q__1.i = q__2.r * ab[i__1].i + q__2.i * ab[i__1]
00565                             .r;
00566                     rb.r = q__1.r, rb.i = q__1.i;
00567                     i__1 = *ku + i__ * ab_dim1;
00568                     i__2 = *ku + i__ * ab_dim1;
00569                     q__1.r = rc * ab[i__2].r, q__1.i = rc * ab[i__2].i;
00570                     ab[i__1].r = q__1.r, ab[i__1].i = q__1.i;
00571                 }
00572                 if (wantpt) {
00573                     r_cnjg(&q__1, &rs);
00574                     crot_(n, &pt[i__ + pt_dim1], ldpt, &pt[*m + 1 + pt_dim1], 
00575                             ldpt, &rc, &q__1);
00576                 }
00577 /* L110: */
00578             }
00579         }
00580     }
00581 
00582 /*     Make diagonal and superdiagonal elements real, storing them in D */
00583 /*     and E */
00584 
00585     i__1 = *ku + 1 + ab_dim1;
00586     t.r = ab[i__1].r, t.i = ab[i__1].i;
00587     i__1 = minmn;
00588     for (i__ = 1; i__ <= i__1; ++i__) {
00589         abst = c_abs(&t);
00590         d__[i__] = abst;
00591         if (abst != 0.f) {
00592             q__1.r = t.r / abst, q__1.i = t.i / abst;
00593             t.r = q__1.r, t.i = q__1.i;
00594         } else {
00595             t.r = 1.f, t.i = 0.f;
00596         }
00597         if (wantq) {
00598             cscal_(m, &t, &q[i__ * q_dim1 + 1], &c__1);
00599         }
00600         if (wantc) {
00601             r_cnjg(&q__1, &t);
00602             cscal_(ncc, &q__1, &c__[i__ + c_dim1], ldc);
00603         }
00604         if (i__ < minmn) {
00605             if (*ku == 0 && *kl == 0) {
00606                 e[i__] = 0.f;
00607                 i__2 = (i__ + 1) * ab_dim1 + 1;
00608                 t.r = ab[i__2].r, t.i = ab[i__2].i;
00609             } else {
00610                 if (*ku == 0) {
00611                     i__2 = i__ * ab_dim1 + 2;
00612                     r_cnjg(&q__2, &t);
00613                     q__1.r = ab[i__2].r * q__2.r - ab[i__2].i * q__2.i, 
00614                             q__1.i = ab[i__2].r * q__2.i + ab[i__2].i * 
00615                             q__2.r;
00616                     t.r = q__1.r, t.i = q__1.i;
00617                 } else {
00618                     i__2 = *ku + (i__ + 1) * ab_dim1;
00619                     r_cnjg(&q__2, &t);
00620                     q__1.r = ab[i__2].r * q__2.r - ab[i__2].i * q__2.i, 
00621                             q__1.i = ab[i__2].r * q__2.i + ab[i__2].i * 
00622                             q__2.r;
00623                     t.r = q__1.r, t.i = q__1.i;
00624                 }
00625                 abst = c_abs(&t);
00626                 e[i__] = abst;
00627                 if (abst != 0.f) {
00628                     q__1.r = t.r / abst, q__1.i = t.i / abst;
00629                     t.r = q__1.r, t.i = q__1.i;
00630                 } else {
00631                     t.r = 1.f, t.i = 0.f;
00632                 }
00633                 if (wantpt) {
00634                     cscal_(n, &t, &pt[i__ + 1 + pt_dim1], ldpt);
00635                 }
00636                 i__2 = *ku + 1 + (i__ + 1) * ab_dim1;
00637                 r_cnjg(&q__2, &t);
00638                 q__1.r = ab[i__2].r * q__2.r - ab[i__2].i * q__2.i, q__1.i = 
00639                         ab[i__2].r * q__2.i + ab[i__2].i * q__2.r;
00640                 t.r = q__1.r, t.i = q__1.i;
00641             }
00642         }
00643 /* L120: */
00644     }
00645     return 0;
00646 
00647 /*     End of CGBBRD */
00648 
00649 } /* cgbbrd_ */


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