java.lang.Object
imagingbook.common.math.eigen.EigenDecompositionApache
- All Implemented Interfaces:
RealEigenDecomposition
An implementation of
RealEigenDecomposition, which merely wraps an instance of EigenDecomposition as
provided by the Apache Commons Math library. Note this works only for square matrices and symmetry and zero
tolerances cannot be specified, default values are always used. The Jama version (EigenDecompositionJama)
generally appears to be more flexible and robust.- Version:
- 2022/11/24
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor, calculates the eigen decomposition of the specified matrix, which must be square but does not need to be symmetric. -
Method Summary
Modifier and TypeMethodDescriptiongetEigenvector(int k) Returns the k-th eigenvector, i.e., the k-th column vector of the matrix returned byRealEigenDecomposition.getV().Returns the underlying Apache eigendecomposition instance, mainly for debugging.doublegetRealEigenvalue(int k) Returns the real part of the k-th eigenvaluedouble[]Returns a vector holding the real parts of the eigenvaluesgetV()Return the matrix of eigenvectors, which are its column vectors.booleanReturns whether the calculated eigenvalues are complex or real.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface imagingbook.common.math.eigen.RealEigenDecomposition
getD
-
Constructor Details
-
EigenDecompositionApache
Constructor, calculates the eigen decomposition of the specified matrix, which must be square but does not need to be symmetric.- Parameters:
M- the matrix to decompose
-
-
Method Details
-
hasComplexEigenvalues
Description copied from interface:RealEigenDecompositionReturns whether the calculated eigenvalues are complex or real.- Specified by:
hasComplexEigenvaluesin interfaceRealEigenDecomposition- Returns:
trueif any of the eigenvalues is complex,falseotherwise
-
getRealEigenvalue
Description copied from interface:RealEigenDecompositionReturns the real part of the k-th eigenvalue- Specified by:
getRealEigenvaluein interfaceRealEigenDecomposition- Parameters:
k- index of the eigenvalue @param k index of the eigenvector (0-based)- Returns:
- real part of the k-th eigenvalue
-
getRealEigenvalues
Description copied from interface:RealEigenDecompositionReturns a vector holding the real parts of the eigenvalues- Specified by:
getRealEigenvaluesin interfaceRealEigenDecomposition- Returns:
- real(diag(D))
-
getEigenvector
Description copied from interface:RealEigenDecompositionReturns the k-th eigenvector, i.e., the k-th column vector of the matrix returned byRealEigenDecomposition.getV().- Specified by:
getEigenvectorin interfaceRealEigenDecomposition- Parameters:
k- index of the eigenvector (0-based)- Returns:
- the k-th eigenvector (instance of
RealVector)
-
getV
Description copied from interface:RealEigenDecompositionReturn the matrix of eigenvectors, which are its column vectors.- Specified by:
getVin interfaceRealEigenDecomposition- Returns:
- the matrix of eigenvectors
-
getInternalDecomposition
Returns the underlying Apache eigendecomposition instance, mainly for debugging.- Returns:
- the Apache eigendecomposition instance
-