|
|
◆ Dstebz()
| Sub Dstebz |
( |
Range As |
String, |
|
|
Order As |
String, |
|
|
N As |
Long, |
|
|
Vl As |
Double, |
|
|
Vu As |
Double, |
|
|
Il As |
Long, |
|
|
Iu As |
Long, |
|
|
AbsTol As |
Double, |
|
|
D() As |
Double, |
|
|
E() As |
Double, |
|
|
M As |
Long, |
|
|
Nsplit As |
Long, |
|
|
W() As |
Double, |
|
|
Iblock() As |
Long, |
|
|
Isplit() As |
Long, |
|
|
Info As |
Long |
|
) |
| |
Eigenvalues of a symmetric tridiagonal matrix (Bisection method)
- Purpose
- This routine computes the eigenvalues of a symmetric tridiagonal matrix T. The user may ask for all eigenvalues, all eigenvalues in the half-open interval (Vl, Vu], or the Il-th through Iu-th eigenvalues.
To avoid overflow, the matrix must be scaled so that its largest element is no greater than overflow^(1/2) * underflow^(1/4) in absolute value, and for greatest accuracy, it should not be much smaller than that.
- Parameters
-
| [in] | Range | = "A": All eigenvalues will be found.
= "V": All eigenvalues in the half-open interval (Vl, Vu] will be found.
= "I": The Il-th through Iu-th eigenvalues will be found. |
| [in] | Order | = "B": The eigenvalues will be grouped by split-off block (see Iblock(), Isplit()) and ordered from smallest to largest within the block.
= "E": The eigenvalues for the entire matrix will be ordered from smallest to largest. |
| [in] | N | Order of the tridiagonal matrix. (N >= 0) (If N = 0, returns without computation) |
| [in] | Vl | Range = "V": The lower bound of the interval to be searched for eigenvalues. Eigenvalues less than or equal to Vl, or greater than Vu, will not be returned. (Vl < Vu)
Range = "A" or "I": Not referenced. |
| [in] | Vu | Range = "V": The upper bound of the interval to be searched for eigenvalues. Eigenvalues less than or equal to Vl, or greater than Vu, will not be returned. (Vl < Vu)
Range = "A" or "I": Not referenced. |
| [in] | Il | Range = "I": The index of the smallest eigenvalue to be returned. (1 <= Il <= Iu <= N, if N > 0. Il = 1 and Iu = 0 if N = 0)
Range = "A" or "V": Not referenced. |
| [in] | Iu | Range = "I": The index of the largest eigenvalues to be returned. (1 <= Il <= Iu <= N, if N > 0. Il = 1 and Iu = 0 if N = 0)
Range = "A" or "V": Not referenced. |
| [in] | Abstol | The absolute error tolerance for the eigenvalues. An eigenvalue (or cluster) is considered to be located if it has been determined to lie in an interval whose width is Abstol or less. If Abstol is less than or equal to zero, then ulp*|T| will be used, where |T| means the 1-norm of T.
Eigenvalues will be computed most accurately when Abstol is set to twice the underflow threshold 2*Dlamch("S"), not zero. |
| [in] | D() | Array D(LD - 1) (LD >= N)
The N diagonal elements of the tridiagonal matrix T. |
| [in] | E() | Array E(LE - 1) (LE >= N - 1)
The (N - 1) off-diagonal elements of the tridiagonal matrix T. |
| [out] | M | The actual number of eigenvalues found. (0 <= M <= N)
(See also the description of Info = 2, 3.) |
| [out] | Nsplit | The number of diagonal blocks in the matrix T. (1 <= Nsplit <= N) |
| [out] | W() | Array W(LW - 1) (LW >= N)
The first M elements of W() will contain the eigenvalues. (This routine may use the remaining N - M elements as workspace.) |
| [out] | Iblock() | Array Iblock(LIblock - 1) (LIblock >= N)
At each row/column j where E(j) is zero or small, the matrix T is considered to split into a block diagonal matrix. On exit, if Info = 0, Iblock(i) specifies to which block (from 1 to the number of blocks) the eigenvalue W(i) belongs. (This routine may use the remaining N - M elements as workspace.) |
| [out] | Isplit() | Array Isplit(LIsplit - 1) (LIsplit >= N)
The splitting points, at which T breaks up into submatrices. The first submatrix consists of rows/columns 1 to Isplit(0), the second of rows/columns Isplit(0) + 1 through Isplit(1), etc., and the Nsplit-th consists of rows/columns Isplit(Nsplit - 2) + 1 through Isplit(Nsplit - 1) = N. (Only the first Nsplit elements will actually be used, but since the user cannot know a priori what value Nsplit will have, N words must be reserved for Isplit().) |
| [out] | Info | = 0: Successful exit.
= -1: The argument Range had an illegal value. (Range <> "A", "V" nor "I")
= -2: The argument Order had an illegal value. (Order <> "B" nor "E")
= -3: The argument N had an illegal value. (N < 0)
= -5: The argument Vu had an illegal value. (Vu <= Vl)
= -6: The argument Il had an illegal value. (Il < 1 or Il > N)
= -7: The argument Iu had an illegal value. (Iu < min(N, Il) or Iu > N)
= -9: The argument D() is invalid.
= -10: The argument E() is invalid.
= -13: The argument W() is invalid.
= -14: The argument Iblock() is invalid.
= -15: The argument Isplit() is invalid.
= > 0: Some or all of the eigenvalues failed to converge or were not computed.
= 1 or 3: Bisection failed to converge for some eigenvalues. These eigenvalues are flagged by a negative block number.
= 2 or 3: Not all of the eigenvalues Il:Iu were found. Returns M < Iu + 1 - Il. (Range = "I")
= 4: The Gershgorin interval initially used was too small. No eigenvalues were computed. (Range = "I") |
- Reference
- LAPACK
- Example Program
- Compute all eigenvalues and eigenvectors of the symmetric matrix A, where
( 2.20 -0.11 -0.32 )
A = ( -0.11 2.93 0.81 )
( -0.32 0.81 2.37 )
Reduces to tridiagonal form by Dsytrd, then computes eigenvalues by Dstebz and those eigenvectors by Dstein and Dormtr. Sub Ex_Dsytrd_Dstebz_Dstein()
Const N = 3
Dim A(N - 1, N - 1) As Double, W(N - 1) As Double, Z(N - 1, N - 1) As Double
Dim D(N - 1) As Double, E(N - 2) As Double, Tau(N - 2) As Double
Dim Vl As Double, Vu As Double, Il As Long, Iu As Long, Abstol As Double
Dim Iblock(N - 1) As Long, Isplit(N - 1) As Long, Ifail(N - 1) As Long
Dim M As Long, Nsplit As Long, Info As Long
A(0, 0) = 2.2
A(1, 0) = -0.11: A(1, 1) = 2.93
A(2, 0) = -0.32: A(2, 1) = 0.81: A(2, 2) = 2.37
Call Dsytrd("L", N, A(), D(), E(), Tau(), Info)
If Info <> 0 Then
Debug.Print "Error in Dsytrd: Info =", Info
Exit Sub
End If
Abstol = 0
Call Dstebz("A", "E", N, Vl, Vu, Il, Iu, Abstol, D(), E(), M, Nsplit, W(), Iblock(), Isplit(), Info)
If Info <> 0 Then
Debug.Print "Error in Dstebz: Info =", Info
Exit Sub
End If
Call Dstein(N, D(), E(), M, W(), Iblock(), Isplit(), Z(), Ifail(), Info)
If Info <> 0 Then
Debug.Print "Error in Dstein: Info =", Info
Exit Sub
End If
Call Dormtr("L", "L", "N", N, N, A(), Tau(), Z(), Info)
If Info <> 0 Then
Debug.Print "Error in Dormtr: Info =", Info
Exit Sub
End If
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 "M =", M, "Nsplit =", Nsplit
End Sub
Sub Dstebz(Range As String, Order As String, N As Long, Vl As Double, Vu As Double, Il As Long, Iu As Long, AbsTol As Double, D() As Double, E() As Double, M As Long, Nsplit As Long, W() As Double, Iblock() As Long, Isplit() As Long, Info As Long) Eigenvalues of a symmetric tridiagonal matrix (Bisection method)
Sub Dormtr(Side As String, Uplo As String, Trans As String, M As Long, N As Long, A() As Double, Tau() As Double, C() As Double, Info As Long) Multiplies by a transform matrix from a real symmetric matrix to tridiagonal form
Sub Dsytrd(Uplo As String, N As Long, A() As Double, D() As Double, E() As Double, Tau() As Double, Info As Long) Reduces a real symmetric matrix to tridiagonal form
Sub Dstein(N As Long, D() As Double, E() As Double, M As Long, W() As Double, Iblock() As Long, Isplit() As Long, Z() As Double, Ifail() As Long, Info As Long) Eigenvectors of a symmetric tridiagonal matrix (Inverse iteration method)
- Example Results
Eigenvalues = 1.70705954911046 2.22943643244226 3.56350401844728
Eigenvectors =
0.399322077213382 0.894521385341403 0.200931256445799
-0.481026444340548 0.390994588677271 -0.78468897753835
0.780484105216166 -0.216690384632057 -0.586421212707156
M = 3 Nsplit = 1
|