org.hipparchus.linear

## Class ComplexEigenDecomposition

• Direct Known Subclasses:
OrderedComplexEigenDecomposition

public class ComplexEigenDecomposition
extends Object
Given a matrix A, it computes a complex eigen decomposition AV = VD.

Complex Eigen Decomposition differs from the EigenDecomposition since it computes the eigen vectors as complex eigen vectors (if applicable).

Beware that in the complex case, you do not always have $$V \times V^{T} = I$$ or even a diagonal matrix, even if the eigenvectors that form the columns of the V matrix are independent. On example is the square matrix $A = \left(\begin{matrix} 3 & -2\\ 4 & -1 \end{matrix}\right)$ which has two conjugate eigenvalues $$\lambda_1=1+2i$$ and $$\lambda_2=1-2i$$ with associated eigenvectors $$v_1^T = (1, 1-i)$$ and $$v_2^T = (1, 1+i)$$. $V\timesV^T = \left(\begin{matrix} 2 & 2\\ 2 & 0 \end{matrix}\right)$ which is not the identity matrix. Therefore, despite $$A \times V = V \times D$$, $$A \ne V \times D \time V^T$$, which would hold for real eigendecomposition.

Compute complex eigen values from the Schur transform. Compute complex eigen vectors based on eigen values and the inverse iteration method. see: https://en.wikipedia.org/wiki/Inverse_iteration https://en.wikiversity.org/wiki/Shifted_inverse_iteration http://www.robots.ox.ac.uk/~sjrob/Teaching/EngComp/ecl4.pdf http://www.math.ohiou.edu/courses/math3600/lecture16.pdf
• ### Field Summary

Fields
Modifier and Type Field and Description
static double DEFAULT_EIGENVECTORS_EQUALITY
Default threshold below which eigenvectors are considered equal.
static double DEFAULT_EPSILON
Default value to use for internal epsilon.
static double DEFAULT_EPSILON_AV_VD_CHECK
Internally used epsilon criteria for final AV=VD check.
• ### Constructor Summary

Constructors
Constructor and Description
ComplexEigenDecomposition(RealMatrix matrix)
Constructor for decomposition.
ComplexEigenDecomposition(RealMatrix matrix, double eigenVectorsEquality, double epsilon, double epsilonAVVDCheck)
Constructor for decomposition.
• ### Method Summary

All Methods
Modifier and Type Method and Description
protected void checkDefinition(RealMatrix matrix)
Check definition of the decomposition in runtime.
protected void findEigenValues(RealMatrix matrix)
Compute eigen values using the Schur transform.
protected void findEigenVectors(FieldMatrix<Complex> matrix)
Compute the eigen vectors using the inverse power method.
FieldMatrix<Complex> getD()
Getter D.
double getDeterminant()
Computes the determinant.
Complex[] getEigenvalues()
Getter of the eigen values.
FieldVector<Complex> getEigenvector(int i)
Getter of the eigen vectors.
FieldMatrix<Complex> getV()
Getter V.
FieldMatrix<Complex> getVT()
Getter VT.
boolean hasComplexEigenvalues()
Confirm if there are complex eigen values.
protected void matricesToEigenArrays()
Reset eigenvalues and eigen vectors from matrices.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Field Detail

• #### DEFAULT_EIGENVECTORS_EQUALITY

public static final double DEFAULT_EIGENVECTORS_EQUALITY
Default threshold below which eigenvectors are considered equal.
Constant Field Values
• #### DEFAULT_EPSILON

public static final double DEFAULT_EPSILON
Default value to use for internal epsilon.
Constant Field Values
• #### DEFAULT_EPSILON_AV_VD_CHECK

public static final double DEFAULT_EPSILON_AV_VD_CHECK
Internally used epsilon criteria for final AV=VD check.
Constant Field Values
• ### Constructor Detail

• #### ComplexEigenDecomposition

public ComplexEigenDecomposition(RealMatrix matrix,
double eigenVectorsEquality,
double epsilon,
double epsilonAVVDCheck)
Constructor for decomposition.

The eigenVectorsEquality threshold is used to ensure the L∞-normalized eigenvectors found using inverse iteration are different from each other. if $$min(|e_i-e_j|,|e_i+e_j|)$$ is smaller than this threshold, the algorithm considers it has found again an already known vector, so it drops it and attempts a new inverse iteration with a different start vector. This value should be much larger than epsilon which is used for convergence

Parameters:
matrix - real matrix.
eigenVectorsEquality - threshold below which eigenvectors are considered equal
epsilon - Epsilon used for internal tests (e.g. is singular, eigenvalue ratio, etc.)
epsilonAVVDCheck - Epsilon criteria for final AV=VD check
Since:
1.8
• ### Method Detail

• #### getEigenvalues

public Complex[] getEigenvalues()
Getter of the eigen values.
Returns:
eigen values.
• #### getEigenvector

public FieldVector<Complex> getEigenvector(int i)
Getter of the eigen vectors.
Parameters:
i - which eigen vector.
Returns:
eigen vector.
• #### matricesToEigenArrays

protected void matricesToEigenArrays()
Reset eigenvalues and eigen vectors from matrices.

This method is intended to be called by sub-classes (mainly OrderedComplexEigenDecomposition) that reorder the matrices elements. It rebuild the eigenvalues and eigen vectors arrays from the D and V matrices.

Since:
2.1
• #### hasComplexEigenvalues

public boolean hasComplexEigenvalues()
Confirm if there are complex eigen values.
Returns:
true if there are complex eigen values.
• #### getDeterminant

public double getDeterminant()
Computes the determinant.
Returns:
the determinant.
• #### getV

public FieldMatrix<Complex> getV()
Getter V.
Returns:
V.
• #### getD

public FieldMatrix<Complex> getD()
Getter D.
Returns:
D.
• #### getVT

public FieldMatrix<Complex> getVT()
Getter VT.
Returns:
VT.
• #### findEigenValues

protected void findEigenValues(RealMatrix matrix)
Compute eigen values using the Schur transform.
Parameters:
matrix - real matrix to compute eigen values.
• #### findEigenVectors

protected void findEigenVectors(FieldMatrix<Complex> matrix)
Compute the eigen vectors using the inverse power method.
Parameters:
matrix - real matrix to compute eigen vectors.
• #### checkDefinition

protected void checkDefinition(RealMatrix matrix)
Check definition of the decomposition in runtime.
Parameters:
matrix - matrix to be decomposed.