|
|
◆ Dsbgvd()
| Sub Dsbgvd |
( |
Jobz As |
String, |
|
|
Uplo As |
String, |
|
|
N As |
Long, |
|
|
Ka As |
Long, |
|
|
Kb As |
Long, |
|
|
Ab() As |
Double, |
|
|
Bb() As |
Double, |
|
|
W() As |
Double, |
|
|
Z() As |
Double, |
|
|
Info As |
Long |
|
) |
| |
(Divide and conquer driver) Generalized eigenvalue problem of symmetric band matrices
- Purpose
- This routine computes all the eigenvalues, and optionally, the eigenvectors of a real generalized symmetric-definite banded eigenproblem, of the form Here A and B are assumed to be symmetric and banded, and B is also positive definite.
If eigenvectors are desired, it uses a divide and conquer algorithm.
- Parameters
-
| [in] | Jobz | = "N": Compute eigenvalues only.
= "V": Compute eigenvalues and eigenvectors. |
| [in] | Uplo | = "U": Upper triangles of A and B are stored.
= "L": Lower triangles of A and B are stored. |
| [in] | N | Order of the matrices A and B. (N >= 0) (If N = 0, returns without computation) |
| [in] | Ka | Number of super-diagonals of the matrix A if Uplo = "U" or the number of sub-diagonals if Uplo = "L". (Ka >= 0) |
| [in] | Kb | Number of super-diagonals of the matrix B if Uplo = "U" or the number of sub-diagonals if Uplo = "L". (Kb >= 0) |
| [in,out] | Ab() | Array Ab(LAb1 - 1, LAb2 - 1) (LAb1 >= Ka + 1, LAb2 >= N)
[in] The upper or lower triangle of the symmetric band matrix A, stored in the first Ka+1 columns of the array. The j-th column of A is stored in the j-th row of the array ab as follows.
Uplo = "U": Ab(Ka + i - j, j) = Aij for max(0, j - Ka - 1) <= i <= j <= N - 1.
Uplo = "L": Ab(i - j, j) = Aij for 0 <= j <= i <= min(N - 1, j + Ka - 1).
[out] The contents of Ab() are destroyed. |
| [in,out] | Bb() | Array Bb(LBb1 - 1, LBb2 - 1) (LBb1 >= Kb + 1, LBb2 >= N)
[in] The upper or lower triangle of the symmetric positive definite band matrix B, stored in the first Kb+1 columns of the array. The j-th column of B is stored in the j-th row of the array bb as follows.
Uplo = "U": Bb(Kb + i - j, j) = Bij for max(0, j - Kb - 1) <= i <= j <= N - 1.
Uplo = "L": Bb(i - j, j) = Bij for 0 <= j <= i <= min(N - 1, j + Kb - 1).
[out] The factor S from the split Cholesky factorization B = S^T*S, as returned by Dpbstf. |
| [out] | W() | Array W(LW - 1) (LW >= N)
If Info = 0, the eigenvalues in ascending order. |
| [out] | Z() | Array Z(LZ1 - 1, LZ2 - 1) (LZ1 >= N, LZ2 >= N)
Jobz = "V": If Info = 0, Z() contains the matrix Z of eigenvectors, with the i-th column of Z holding the eigenvector associated with w[i]. The eigenvectors are normalized so that Z^T*B*Z = I.
Jobz = "N": Z() is not referenced. |
| [out] | Info | = 0: Successful exit
= -1: The argument Jobz had an illegal value (Jobz <> "V" nor "N")
= -2: The argument Uplo had an illegal value (Uplo <> "U" nor "L")
= -3: The argument N had an illegal value (N < 0)
= -4: The argument Ka had an illegal value (Ka < 0)
= -5: The argument Kb had an illegal value (Kb < 0 or Kb > Ka)
= -6: The argument Ab() is invalid.
= -7: The argument Bb() is invalid.
= -8: The argument W() is invalid.
= -9: The argument Z() is invalid.
= i (0 < i <= N): The algorithm failed to converge. i off-diagonal elements of an intermediate tridiagonal form did not converge to zero
= i (i > N): Dpbstf returned Info = i-N. B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed. |
- Reference
- LAPACK
- Example Program
- Compute the eigenvalues and the eigenvectors of a generalized symmetric-definite eigenproblem of the form Ax = λBx, where A is a symmetric matrix and B is a symmetric positive definite matrix.
( 0.31 0.69 0 ) ( 2.58 -0.99 0 )
A = ( 0.69 2.71 0.57 ) B = ( -0.99 0.69 -0.03 )
( 0 0.57 -0.13 ) ( 0 -0.03 0.18 )
Sub Ex_Dsbgvd()
Const N = 3, Ka = 1, Kb = 1
Dim Ab(Ka, N - 1) As Double, Bb(Kb, N - 1) As Double
Dim W(N - 1) As Double, Z(N - 1, N - 1) As Double, Info As Long
Ab(0, 0) = 0.31: Ab(0, 1) = 2.71: Ab(0, 2) = -0.13
Ab(1, 0) = 0.69: Ab(1, 1) = 0.57
Bb(0, 0) = 2.58: Bb(0, 1) = 0.69: Bb(0, 2) = 0.18
Bb(1, 0) = -0.99: Bb(1, 1) = -0.03
Call Dsbgvd("V", "L", N, Ka, Kb, Ab(), Bb(), W(), Z(), Info)
Debug.Print "Eigenvalues =", W(0), W(1), W(2)
Debug.Print "Eigenvectors ="
Debug.Print Z(0, 0), Z(0, 1), Z(0, 2)
Debug.Print Z(1, 0), Z(1, 1), Z(1, 2)
Debug.Print Z(2, 0), Z(2, 1), Z(2, 2)
Debug.Print "Info =", Info
End Sub
- Example Results
Eigenvalues = -1.18147421492712 7.44172967142041E-02 11.8828445198389
Eigenvectors =
-4.93563525964657E-02 0.580733103214333 0.728344545882694
-0.345554886717425 -8.97353379594566E-02 1.77481785369013
2.23453164309908 -0.358097826727939 0.724727404571494
Info = 0
|