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