public class EigenDecomposition extends Object
The eigen decomposition of matrix A is a set of two matrices: V and D such that A = V × D × VT. A, V and D are all m × m matrices.
This class is similar in spirit to the EigenvalueDecomposition
class from the JAMA
library, with the following changes:
getVt
method has been added,getRealEigenvalue
and getImagEigenvalue
methods to pick up a single eigenvalue have been added,getEigenvector
method to pick up a single
eigenvector has been added,getDeterminant
method has been added.getSolver
method has been added.
As of 2.0, this class supports only symmetric matrices, and
hence computes only real realEigenvalues. This implies the D matrix returned
by getD()
is always diagonal and the imaginary values returned
getImagEigenvalue(int)
and getImagEigenvalues()
are always
null.
When called with a RealMatrix
argument, this implementation only uses
the upper part of the matrix, the part below the diagonal is not accessed at
all.
This implementation is based on the paper by A. Drubrulle, R.S. Martin and J.H. Wilkinson "The Implicit QL Algorithm" in Wilksinson and Reinsch (1971) Handbook for automatic computation, vol. 2, Linear algebra, Springer-Verlag, New-York
Constructor and Description |
---|
EigenDecomposition(double[] main,
double[] secondary,
double splitTolerance)
Calculates the eigen decomposition of the symmetric tridiagonal
matrix.
|
EigenDecomposition(RealMatrix matrix,
double splitTolerance)
Calculates the eigen decomposition of the given symmetric matrix.
|
Modifier and Type | Method and Description |
---|---|
RealMatrix |
getD()
Gets the block diagonal matrix D of the decomposition.
|
double |
getDeterminant()
Computes the determinant of the matrix.
|
RealVector |
getEigenvector(int i)
Gets a copy of the ith eigenvector of the original matrix.
|
double |
getImagEigenvalue(int i)
Gets the imaginary part of the ith eigenvalue of the original
matrix.
|
double[] |
getImagEigenvalues()
Gets a copy of the imaginary parts of the eigenvalues of the original
matrix.
|
double |
getRealEigenvalue(int i)
Returns the real part of the ith eigenvalue of the original
matrix.
|
double[] |
getRealEigenvalues()
Gets a copy of the real parts of the eigenvalues of the original matrix.
|
DecompositionSolver |
getSolver()
Gets a solver for finding the A × X = B solution in exact
linear sense.
|
RealMatrix |
getV()
Gets the matrix V of the decomposition.
|
RealMatrix |
getVT()
Gets the transpose of the matrix V of the decomposition.
|
public EigenDecomposition(RealMatrix matrix, double splitTolerance)
matrix
- Matrix to decompose. It must be symmetric.splitTolerance
- Dummy parameter (present for backward
compatibility only).NonSymmetricMatrixException
- if the matrix is not symmetric.MaxCountExceededException
- if the algorithm fails to converge.public EigenDecomposition(double[] main, double[] secondary, double splitTolerance)
main
- Main diagonal of the symmetric tridiagonal form.secondary
- Secondary of the tridiagonal form.splitTolerance
- Dummy parameter (present for backward
compatibility only).MaxCountExceededException
- if the algorithm fails to converge.public RealMatrix getV()
public RealMatrix getD()
getRealEigenvalues()
,
getImagEigenvalues()
public RealMatrix getVT()
public double[] getRealEigenvalues()
getD()
,
getRealEigenvalue(int)
,
getImagEigenvalues()
public double getRealEigenvalue(int i)
i
- index of the eigenvalue (counting from 0)getD()
,
getRealEigenvalues()
,
getImagEigenvalue(int)
public double[] getImagEigenvalues()
getD()
,
getImagEigenvalue(int)
,
getRealEigenvalues()
public double getImagEigenvalue(int i)
i
- Index of the eigenvalue (counting from 0).getD()
,
getImagEigenvalues()
,
getRealEigenvalue(int)
public RealVector getEigenvector(int i)
i
- Index of the eigenvector (counting from 0).getD()
public double getDeterminant()
public DecompositionSolver getSolver()
Copyright © 2003-2012 Apache Software Foundation. All Rights Reserved.