|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.matrix.doubles.factorization.eigen.QRAlgorithm
public class QRAlgorithm
The QR algorithm is an eigenvalue algorithm that computes the real Schur canonical form of a matrix. That is,
Q'MQ = T
where Q is orthogonal, and T is quasi-triangular.
The eigenvalues of A are the same as those of the diagonal blocks in T.
The basic idea is to perform the QR decomposition, writing the matrix as a product of an orthogonal matrix and an upper triangular matrix, multiply the factors in the other order, and iterate.
This implementation is the implicit double-shift version.
It makes the use of multiple shifts easier to introduce.
The matrix is first brought to upper Hessenberg form A0 = QAQ' as in the explicit version;
then, at each step, the first getColumn of Ak is transformed via a small-size Householder similarity transformation to the first getColumn of p(Ak)e1,
where p(Ak), of degree r, is the polynomial that defines the shifting strategy.
Then successive Householder transformation of size r + 1 are performed in order to return the working matrix Ak to upper Hessenberg form.
This operation is known as bulge chasing,
due to the peculiar shape of the non-zero entries of the matrix along the steps of the algorithm.
As in the first version,
deflation is performed as soon as one of the sub-diagonal entries of Ak is sufficiently small.
In our implementation, no QR decompositions are explicitly performed. We instead use Francis algorithm (Francis QR step), as described in Golub and Van Loan.
| Field Summary | |
|---|---|
double |
epsilon
a precision parameter: when a number |x| ≤ ε, it is considered 0 |
| Constructor Summary | |
|---|---|
QRAlgorithm(Matrix A)
Construct an instance of the QR algorithm. |
|
QRAlgorithm(Matrix A,
int maxIterations,
double epsilon)
Construct an instance of the QR algorithm. |
|
| Method Summary | |
|---|---|
NumberList |
eigenvalues()
Get all the eigenvalues. |
Matrix |
Q()
Get a copy of the Q matrix as in the real Schur canonical form
Q'MQ = T
We store all the Qi's produced in the process of the QR algorithm. |
Matrix |
T()
Get a copy of the T matrix as in the real Schur canonical form
Q'MQ = T
T is quasi upper triangular. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final double epsilon
| Constructor Detail |
|---|
public QRAlgorithm(Matrix A,
int maxIterations,
double epsilon)
The algorithm is a convergence algorithm. That is, it stops when either
A - a matrixmaxIterations - the maximum number of iterationsepsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
java.lang.IllegalArgumentException - if A is not squarepublic QRAlgorithm(Matrix A)
The algorithm loops until H becomes quasi-triangular.
A - a matrix
java.lang.IllegalArgumentException - if A is not square| Method Detail |
|---|
public NumberList eigenvalues()
Algorithm 7.5.2 in Matrix Computations, 3rd edition, by Golub G. H., van Loan C. F.
Given a Hessenberg matrix,
| H11 H12 H13 |
H = | 0 H22 H23 |
| 0 0 H33 |
we compute the real Schur canonical form
Q'HQ = T
where Q is orthogonal, and T is quasi-triangular.
public Matrix Q()
Q matrix as in the real Schur canonical form
Q'MQ = T
We store all the Qi's produced in the process of the QR algorithm. Q is a product of them. That is,
Q = Q1 %*% ... %*% Qn
Q matrixpublic Matrix T()
T matrix as in the real Schur canonical form
Q'MQ = T
T is quasi upper triangular.
T matrix
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||