|
bpp-core
2.2.0
|
Computes eigenvalues and eigenvectors of a real (non-complex) matrix. More...
#include <Bpp/Numeric/Matrix/EigenValue.h>
Collaboration diagram for bpp::EigenValue< Real >:Public Member Functions | |
| bool | isSymmetric () const |
| EigenValue (const Matrix< Real > &A) | |
| Check for symmetry, then construct the eigenvalue decomposition. More... | |
| const RowMatrix< Real > & | getV () const |
| Return the eigenvector matrix. More... | |
| const std::vector< Real > & | getRealEigenValues () const |
| Return the real parts of the eigenvalues. More... | |
| const std::vector< Real > & | getImagEigenValues () const |
| Return the imaginary parts of the eigenvalues in parameter e. More... | |
| const RowMatrix< Real > & | getD () const |
| Computes the block diagonal eigenvalue matrix. More... | |
Private Member Functions | |
| void | tred2 () |
| Symmetric Householder reduction to tridiagonal form. More... | |
| void | tql2 () |
| Symmetric tridiagonal QL algorithm. More... | |
| void | orthes () |
| Nonsymmetric reduction to Hessenberg form. More... | |
| void | cdiv (Real xr, Real xi, Real yr, Real yi) |
| void | hqr2 () |
Private Attributes | |
| size_t | n_ |
| Row and column dimension (square matrix). More... | |
| bool | issymmetric_ |
| Tell if the matrix is symmetric. More... | |
| RowMatrix< Real > | V_ |
| Array for internal storage of eigenvectors. More... | |
| RowMatrix< Real > | H_ |
| Matrix for internal storage of nonsymmetric Hessenberg form. More... | |
| RowMatrix< Real > | D_ |
| Matrix for internal storage of eigen values in a matrix form. More... | |
| std::vector< Real > | ort_ |
| Working storage for nonsymmetric algorithm. More... | |
| Real | cdivr |
| Real | cdivi |
Arrays for internal storage of eigenvalues. | |
| std::vector< Real > | d_ |
| std::vector< Real > | e_ |
Computes eigenvalues and eigenvectors of a real (non-complex) matrix.
[This class and its documentation is adpated from the C++ port of the JAMA library.]
If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is diagonal and the eigenvector matrix V is orthogonal. That is, the diagonal values of D are the eigenvalues, and V*V' = I, where I is the identity matrix. The columns of V represent the eigenvectors in the sense that A*V = V*D.
If A is not symmetric, then the eigenvalue matrix D is block diagonal with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues, a + i*b, in 2-by-2 blocks, [a, b; -b, a]. That is, if the complex eigenvalues look like
u + iv . . . . .
. u - iv . . . .
. . a + ib . . .
. . . a - ib . .
. . . . x .
. . . . . y
then D looks like
u v . . . .
-v u . . . .
. . a b . .
. . -b a . .
. . . . x .
. . . . . y
This keeps V a real matrix in both symmetric and non-symmetric cases, and A*V = V*D.
The matrix V may be badly conditioned, or even singular, so the validity of the equation A = V*D*inverse(V) depends upon the condition number of V.
(Adapted from JAMA, a Java Matrix Library, developed by jointly by the Mathworks and NIST; see http://math.nist.gov/javanumerics/jama).
Definition at line 105 of file EigenValue.h.
|
inline |
Check for symmetry, then construct the eigenvalue decomposition.
| A | Square real (non-complex) matrix |
Definition at line 1110 of file EigenValue.h.
References bpp::EigenValue< Real >::H_, bpp::EigenValue< Real >::hqr2(), bpp::EigenValue< Real >::issymmetric_, bpp::EigenValue< Real >::n_, bpp::EigenValue< Real >::ort_, bpp::EigenValue< Real >::orthes(), bpp::RowMatrix< Scalar >::resize(), bpp::TextTools::toString(), bpp::EigenValue< Real >::tql2(), bpp::EigenValue< Real >::tred2(), and bpp::EigenValue< Real >::V_.
|
inlineprivate |
Definition at line 550 of file EigenValue.h.
References bpp::EigenValue< Real >::cdivi, and bpp::EigenValue< Real >::cdivr.
Referenced by bpp::EigenValue< Real >::hqr2().
|
inline |
Computes the block diagonal eigenvalue matrix.
If the original matrix A is not symmetric, then the eigenvalue matrix D is block diagonal with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues, a + i*b, in 2-by-2 blocks, [a, b; -b, a]. That is, if the complex eigenvalues look like
u + iv . . . . .
. u - iv . . . .
. . a + ib . . .
. . . a - ib . .
. . . . x .
. . . . . y
then D looks like
u v . . . .
-v u . . . .
. . a b . .
. . -b a . .
. . . . x .
. . . . . y
This keeps V a real matrix in both symmetric and non-symmetric cases, and A*V = V*D.
Definition at line 1223 of file EigenValue.h.
References bpp::EigenValue< Real >::d_, bpp::EigenValue< Real >::D_, bpp::EigenValue< Real >::e_, and bpp::EigenValue< Real >::n_.
|
inline |
Return the imaginary parts of the eigenvalues in parameter e.
Definition at line 1188 of file EigenValue.h.
References bpp::EigenValue< Real >::e_.
|
inline |
Return the real parts of the eigenvalues.
Definition at line 1181 of file EigenValue.h.
References bpp::EigenValue< Real >::d_.
Referenced by bpp::DualityDiagram::compute_(), bpp::MatrixTools::exp(), and bpp::MatrixTools::pow().
|
inline |
Return the eigenvector matrix.
Definition at line 1174 of file EigenValue.h.
References bpp::EigenValue< Real >::V_.
Referenced by bpp::DualityDiagram::compute_(), bpp::MatrixTools::exp(), and bpp::MatrixTools::pow().
|
inlineprivate |
Definition at line 572 of file EigenValue.h.
References bpp::EigenValue< Real >::cdiv(), bpp::EigenValue< Real >::cdivi, bpp::EigenValue< Real >::cdivr, bpp::EigenValue< Real >::d_, bpp::EigenValue< Real >::e_, bpp::EigenValue< Real >::H_, bpp::EigenValue< Real >::n_, TOST, and bpp::EigenValue< Real >::V_.
Referenced by bpp::EigenValue< Real >::EigenValue().
|
inline |
Definition at line 1102 of file EigenValue.h.
References bpp::EigenValue< Real >::issymmetric_.
Referenced by bpp::DualityDiagram::compute_().
|
inlineprivate |
Nonsymmetric reduction to Hessenberg form.
This is derived from the Algol procedures orthes and ortran, by Martin and Wilkinson, Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding Fortran subroutines in EISPACK.
Definition at line 442 of file EigenValue.h.
References bpp::EigenValue< Real >::H_, bpp::EigenValue< Real >::n_, bpp::EigenValue< Real >::ort_, and bpp::EigenValue< Real >::V_.
Referenced by bpp::EigenValue< Real >::EigenValue().
|
inlineprivate |
Symmetric tridiagonal QL algorithm.
This is derived from the Algol procedures tql2, by Bowdler, Martin, Reinsch, and Wilkinson, Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding Fortran subroutine in EISPACK.
Definition at line 303 of file EigenValue.h.
References bpp::EigenValue< Real >::d_, bpp::EigenValue< Real >::e_, bpp::EigenValue< Real >::n_, and bpp::EigenValue< Real >::V_.
Referenced by bpp::EigenValue< Real >::EigenValue().
|
inlineprivate |
Symmetric Householder reduction to tridiagonal form.
This is derived from the Algol procedures tred2 by Bowdler, Martin, Reinsch, and Wilkinson, Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding Fortran subroutine in EISPACK.
Definition at line 163 of file EigenValue.h.
References bpp::EigenValue< Real >::d_, bpp::EigenValue< Real >::e_, bpp::EigenValue< Real >::n_, and bpp::EigenValue< Real >::V_.
Referenced by bpp::EigenValue< Real >::EigenValue().
|
private |
Definition at line 549 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::cdiv(), and bpp::EigenValue< Real >::hqr2().
|
private |
Definition at line 549 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::cdiv(), and bpp::EigenValue< Real >::hqr2().
|
private |
Definition at line 124 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::getD(), bpp::EigenValue< Real >::getRealEigenValues(), bpp::EigenValue< Real >::hqr2(), bpp::EigenValue< Real >::tql2(), and bpp::EigenValue< Real >::tred2().
|
mutableprivate |
Matrix for internal storage of eigen values in a matrix form.
Internal storage of eigen values in a matrix form.
Definition at line 146 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::getD().
|
private |
Definition at line 125 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::getD(), bpp::EigenValue< Real >::getImagEigenValues(), bpp::EigenValue< Real >::hqr2(), bpp::EigenValue< Real >::tql2(), and bpp::EigenValue< Real >::tred2().
|
private |
Matrix for internal storage of nonsymmetric Hessenberg form.
Internal storage of nonsymmetric Hessenberg form.
Definition at line 138 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::EigenValue(), bpp::EigenValue< Real >::hqr2(), and bpp::EigenValue< Real >::orthes().
|
private |
Tell if the matrix is symmetric.
Definition at line 117 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::EigenValue(), and bpp::EigenValue< Real >::isSymmetric().
|
private |
Row and column dimension (square matrix).
Definition at line 112 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::EigenValue(), bpp::EigenValue< Real >::getD(), bpp::EigenValue< Real >::hqr2(), bpp::EigenValue< Real >::orthes(), bpp::EigenValue< Real >::tql2(), and bpp::EigenValue< Real >::tred2().
|
private |
Working storage for nonsymmetric algorithm.
Working storage for nonsymmetric algorithm.
Definition at line 153 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::EigenValue(), and bpp::EigenValue< Real >::orthes().
|
private |
Array for internal storage of eigenvectors.
Definition at line 131 of file EigenValue.h.
Referenced by bpp::EigenValue< Real >::EigenValue(), bpp::EigenValue< Real >::getV(), bpp::EigenValue< Real >::hqr2(), bpp::EigenValue< Real >::orthes(), bpp::EigenValue< Real >::tql2(), and bpp::EigenValue< Real >::tred2().