LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
chbgv.f
Go to the documentation of this file.
00001 *> \brief \b CHBGST
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download CHBGV + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/chbgv.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/chbgv.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chbgv.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE CHBGV( JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, W, Z,
00022 *                         LDZ, WORK, RWORK, INFO )
00023 * 
00024 *       .. Scalar Arguments ..
00025 *       CHARACTER          JOBZ, UPLO
00026 *       INTEGER            INFO, KA, KB, LDAB, LDBB, LDZ, N
00027 *       ..
00028 *       .. Array Arguments ..
00029 *       REAL               RWORK( * ), W( * )
00030 *       COMPLEX            AB( LDAB, * ), BB( LDBB, * ), WORK( * ),
00031 *      $                   Z( LDZ, * )
00032 *       ..
00033 *  
00034 *
00035 *> \par Purpose:
00036 *  =============
00037 *>
00038 *> \verbatim
00039 *>
00040 *> CHBGV computes all the eigenvalues, and optionally, the eigenvectors
00041 *> of a complex generalized Hermitian-definite banded eigenproblem, of
00042 *> the form A*x=(lambda)*B*x. Here A and B are assumed to be Hermitian
00043 *> and banded, and B is also positive definite.
00044 *> \endverbatim
00045 *
00046 *  Arguments:
00047 *  ==========
00048 *
00049 *> \param[in] JOBZ
00050 *> \verbatim
00051 *>          JOBZ is CHARACTER*1
00052 *>          = 'N':  Compute eigenvalues only;
00053 *>          = 'V':  Compute eigenvalues and eigenvectors.
00054 *> \endverbatim
00055 *>
00056 *> \param[in] UPLO
00057 *> \verbatim
00058 *>          UPLO is CHARACTER*1
00059 *>          = 'U':  Upper triangles of A and B are stored;
00060 *>          = 'L':  Lower triangles of A and B are stored.
00061 *> \endverbatim
00062 *>
00063 *> \param[in] N
00064 *> \verbatim
00065 *>          N is INTEGER
00066 *>          The order of the matrices A and B.  N >= 0.
00067 *> \endverbatim
00068 *>
00069 *> \param[in] KA
00070 *> \verbatim
00071 *>          KA is INTEGER
00072 *>          The number of superdiagonals of the matrix A if UPLO = 'U',
00073 *>          or the number of subdiagonals if UPLO = 'L'. KA >= 0.
00074 *> \endverbatim
00075 *>
00076 *> \param[in] KB
00077 *> \verbatim
00078 *>          KB is INTEGER
00079 *>          The number of superdiagonals of the matrix B if UPLO = 'U',
00080 *>          or the number of subdiagonals if UPLO = 'L'. KB >= 0.
00081 *> \endverbatim
00082 *>
00083 *> \param[in,out] AB
00084 *> \verbatim
00085 *>          AB is COMPLEX array, dimension (LDAB, N)
00086 *>          On entry, the upper or lower triangle of the Hermitian band
00087 *>          matrix A, stored in the first ka+1 rows of the array.  The
00088 *>          j-th column of A is stored in the j-th column of the array AB
00089 *>          as follows:
00090 *>          if UPLO = 'U', AB(ka+1+i-j,j) = A(i,j) for max(1,j-ka)<=i<=j;
00091 *>          if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j<=i<=min(n,j+ka).
00092 *>
00093 *>          On exit, the contents of AB are destroyed.
00094 *> \endverbatim
00095 *>
00096 *> \param[in] LDAB
00097 *> \verbatim
00098 *>          LDAB is INTEGER
00099 *>          The leading dimension of the array AB.  LDAB >= KA+1.
00100 *> \endverbatim
00101 *>
00102 *> \param[in,out] BB
00103 *> \verbatim
00104 *>          BB is COMPLEX array, dimension (LDBB, N)
00105 *>          On entry, the upper or lower triangle of the Hermitian band
00106 *>          matrix B, stored in the first kb+1 rows of the array.  The
00107 *>          j-th column of B is stored in the j-th column of the array BB
00108 *>          as follows:
00109 *>          if UPLO = 'U', BB(kb+1+i-j,j) = B(i,j) for max(1,j-kb)<=i<=j;
00110 *>          if UPLO = 'L', BB(1+i-j,j)    = B(i,j) for j<=i<=min(n,j+kb).
00111 *>
00112 *>          On exit, the factor S from the split Cholesky factorization
00113 *>          B = S**H*S, as returned by CPBSTF.
00114 *> \endverbatim
00115 *>
00116 *> \param[in] LDBB
00117 *> \verbatim
00118 *>          LDBB is INTEGER
00119 *>          The leading dimension of the array BB.  LDBB >= KB+1.
00120 *> \endverbatim
00121 *>
00122 *> \param[out] W
00123 *> \verbatim
00124 *>          W is REAL array, dimension (N)
00125 *>          If INFO = 0, the eigenvalues in ascending order.
00126 *> \endverbatim
00127 *>
00128 *> \param[out] Z
00129 *> \verbatim
00130 *>          Z is COMPLEX array, dimension (LDZ, N)
00131 *>          If JOBZ = 'V', then if INFO = 0, Z contains the matrix Z of
00132 *>          eigenvectors, with the i-th column of Z holding the
00133 *>          eigenvector associated with W(i). The eigenvectors are
00134 *>          normalized so that Z**H*B*Z = I.
00135 *>          If JOBZ = 'N', then Z is not referenced.
00136 *> \endverbatim
00137 *>
00138 *> \param[in] LDZ
00139 *> \verbatim
00140 *>          LDZ is INTEGER
00141 *>          The leading dimension of the array Z.  LDZ >= 1, and if
00142 *>          JOBZ = 'V', LDZ >= N.
00143 *> \endverbatim
00144 *>
00145 *> \param[out] WORK
00146 *> \verbatim
00147 *>          WORK is COMPLEX array, dimension (N)
00148 *> \endverbatim
00149 *>
00150 *> \param[out] RWORK
00151 *> \verbatim
00152 *>          RWORK is REAL array, dimension (3*N)
00153 *> \endverbatim
00154 *>
00155 *> \param[out] INFO
00156 *> \verbatim
00157 *>          INFO is INTEGER
00158 *>          = 0:  successful exit
00159 *>          < 0:  if INFO = -i, the i-th argument had an illegal value
00160 *>          > 0:  if INFO = i, and i is:
00161 *>             <= N:  the algorithm failed to converge:
00162 *>                    i off-diagonal elements of an intermediate
00163 *>                    tridiagonal form did not converge to zero;
00164 *>             > N:   if INFO = N + i, for 1 <= i <= N, then CPBSTF
00165 *>                    returned INFO = i: B is not positive definite.
00166 *>                    The factorization of B could not be completed and
00167 *>                    no eigenvalues or eigenvectors were computed.
00168 *> \endverbatim
00169 *
00170 *  Authors:
00171 *  ========
00172 *
00173 *> \author Univ. of Tennessee 
00174 *> \author Univ. of California Berkeley 
00175 *> \author Univ. of Colorado Denver 
00176 *> \author NAG Ltd. 
00177 *
00178 *> \date November 2011
00179 *
00180 *> \ingroup complexOTHEReigen
00181 *
00182 *  =====================================================================
00183       SUBROUTINE CHBGV( JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, W, Z,
00184      $                  LDZ, WORK, RWORK, INFO )
00185 *
00186 *  -- LAPACK driver routine (version 3.4.0) --
00187 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00188 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00189 *     November 2011
00190 *
00191 *     .. Scalar Arguments ..
00192       CHARACTER          JOBZ, UPLO
00193       INTEGER            INFO, KA, KB, LDAB, LDBB, LDZ, N
00194 *     ..
00195 *     .. Array Arguments ..
00196       REAL               RWORK( * ), W( * )
00197       COMPLEX            AB( LDAB, * ), BB( LDBB, * ), WORK( * ),
00198      $                   Z( LDZ, * )
00199 *     ..
00200 *
00201 *  =====================================================================
00202 *
00203 *     .. Local Scalars ..
00204       LOGICAL            UPPER, WANTZ
00205       CHARACTER          VECT
00206       INTEGER            IINFO, INDE, INDWRK
00207 *     ..
00208 *     .. External Functions ..
00209       LOGICAL            LSAME
00210       EXTERNAL           LSAME
00211 *     ..
00212 *     .. External Subroutines ..
00213       EXTERNAL           CHBGST, CHBTRD, CPBSTF, CSTEQR, SSTERF, XERBLA
00214 *     ..
00215 *     .. Executable Statements ..
00216 *
00217 *     Test the input parameters.
00218 *
00219       WANTZ = LSAME( JOBZ, 'V' )
00220       UPPER = LSAME( UPLO, 'U' )
00221 *
00222       INFO = 0
00223       IF( .NOT.( WANTZ .OR. LSAME( JOBZ, 'N' ) ) ) THEN
00224          INFO = -1
00225       ELSE IF( .NOT.( UPPER .OR. LSAME( UPLO, 'L' ) ) ) THEN
00226          INFO = -2
00227       ELSE IF( N.LT.0 ) THEN
00228          INFO = -3
00229       ELSE IF( KA.LT.0 ) THEN
00230          INFO = -4
00231       ELSE IF( KB.LT.0 .OR. KB.GT.KA ) THEN
00232          INFO = -5
00233       ELSE IF( LDAB.LT.KA+1 ) THEN
00234          INFO = -7
00235       ELSE IF( LDBB.LT.KB+1 ) THEN
00236          INFO = -9
00237       ELSE IF( LDZ.LT.1 .OR. ( WANTZ .AND. LDZ.LT.N ) ) THEN
00238          INFO = -12
00239       END IF
00240       IF( INFO.NE.0 ) THEN
00241          CALL XERBLA( 'CHBGV ', -INFO )
00242          RETURN
00243       END IF
00244 *
00245 *     Quick return if possible
00246 *
00247       IF( N.EQ.0 )
00248      $   RETURN
00249 *
00250 *     Form a split Cholesky factorization of B.
00251 *
00252       CALL CPBSTF( UPLO, N, KB, BB, LDBB, INFO )
00253       IF( INFO.NE.0 ) THEN
00254          INFO = N + INFO
00255          RETURN
00256       END IF
00257 *
00258 *     Transform problem to standard eigenvalue problem.
00259 *
00260       INDE = 1
00261       INDWRK = INDE + N
00262       CALL CHBGST( JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, Z, LDZ,
00263      $             WORK, RWORK( INDWRK ), IINFO )
00264 *
00265 *     Reduce to tridiagonal form.
00266 *
00267       IF( WANTZ ) THEN
00268          VECT = 'U'
00269       ELSE
00270          VECT = 'N'
00271       END IF
00272       CALL CHBTRD( VECT, UPLO, N, KA, AB, LDAB, W, RWORK( INDE ), Z,
00273      $             LDZ, WORK, IINFO )
00274 *
00275 *     For eigenvalues only, call SSTERF.  For eigenvectors, call CSTEQR.
00276 *
00277       IF( .NOT.WANTZ ) THEN
00278          CALL SSTERF( N, W, RWORK( INDE ), INFO )
00279       ELSE
00280          CALL CSTEQR( JOBZ, N, W, RWORK( INDE ), Z, LDZ,
00281      $                RWORK( INDWRK ), INFO )
00282       END IF
00283       RETURN
00284 *
00285 *     End of CHBGV
00286 *
00287       END
 All Files Functions