|
|
◆ Dsbev()
| Sub Dsbev |
( |
Jobz As |
String, |
|
|
Uplo As |
String, |
|
|
N As |
Long, |
|
|
Kd As |
Long, |
|
|
Ab() As |
Double, |
|
|
W() As |
Double, |
|
|
Z() As |
Double, |
|
|
Info As |
Long |
|
) |
| |
(Simple driver) Eigenvalues and eigenvectors of a symmetric band matrix
- Purpose
- This routine computes all the eigenvalues and, optionally, eigenvectors of a real symmetric band matrix A.
- Parameters
-
| [in] | Jobz | = "N": Compute eigenvalues only.
= "V": Compute eigenvalues and eigenvectors. |
| [in] | Uplo | = "U": Upper triangle of A is stored.
= "L": Lower triangle of A is stored. |
| [in] | N | Order of the matrix A. (N >= 0) (If N = 0, returns without computation) |
| [in] | Kd | Number of super-diagonals of the matrix A if Uplo = "U" or number of sub-diagonals if Uplo = "L". (Kd >= 0) |
| [in,out] | Ab() | Array Ab(LAb1 - 1, LAb2 - 1) (LAb1 >= Kd + 1, LAb2 >= N)
[in] N x N symmetric band matrix A in Kd+1 x N symmetric band matrix form. Upper or lower part is to be stored in accordance with Uplo.
[out] Ab() is overwritten by values generated during the reduction to tridiagonal form.
Uplo = "U": The first super-diagonal and the diagonal of the tridiagonal matrix T are returned in rows Kd and Kd+1 of Ab().
Uplo = "L": The diagonal and first sub-diagonal of T are returned in the first two rows of Ab(). |
| [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 orthonormal eigenvectors of the matrix A, with the i-th column of Z() holding the eigenvector associated with W(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 Kd had an illegal value. (Kd < 0)
= -5: The argument Ab() is invalid.
= -6: The argument W() is invalid.
= -7: The argument Z() is invalid.
= i > 0: The algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero. |
- Reference
- LAPACK
- Example Program
- Compute all eigenvalues and eigenvectors of the symmetric band matrix A, where
( 0.61 0.79 0 )
A = ( 0.79 2.23 0.25 )
( 0 0.25 2.87 )
Sub Ex_Dsbev()
Const N = 3, Kd = 1
Dim Ab(Kd, N - 1) As Double, W(N - 1) As Double, Z(N - 1, N - 1) As Double
Dim Info As Long
Ab(0, 0) = 0.61: Ab(0, 1) = 2.23: Ab(0, 2) = 2.87
Ab(1, 0) = 0.79: Ab(1, 1) = 0.25
Call Dsbev("V", "L", N, Kd, Ab(), 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
Sub Dsbev(Jobz As String, Uplo As String, N As Long, Kd As Long, Ab() As Double, W() As Double, Z() As Double, Info As Long) (Simple driver) Eigenvalues and eigenvectors of a symmetric band matrix
- Example Results
Eigenvalues = 0.285074336232239 2.43057331973532 2.99435234403244
Eigenvectors =
0.924204695519984 -0.35289670385953 0.145978070900713
-0.380123828036851 -0.813258637555945 0.440586272822087
3.67635163909111E-02 0.462681645244035 0.885761897474061
Info = 0
|