Module imagingbook.common
Package imagingbook.common.math.eigen
Class GeneralizedSymmetricEigenDecomposition
java.lang.Object
imagingbook.common.math.eigen.GeneralizedSymmetricEigenDecomposition
- All Implemented Interfaces:
RealEigenDecomposition
public class GeneralizedSymmetricEigenDecomposition
extends Object
implements RealEigenDecomposition
Solves the generalized symmetric eigenproblem of the form A x = λ B x, where matrices A, B are symmetric and B
is positive definite (see Sec. 11.0.5. of [1]). See Appendix Sec. B.5.2 of [2] for more details. The methods defined
by this class are analogous to the conventional eigendecomposition (see EigenDecomposition
).
[1] Press, Teukolsky, Vetterling, Flannery: "Numerical Recipes". Cambridge University Press, 3rd ed. (2007).
[2]
W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer
(2022).
- Version:
- 2022/06/11
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor, using default parameters.GeneralizedSymmetricEigenDecomposition
(RealMatrix A, RealMatrix B, double rsth, double apth) Constructor, using specific parameters. -
Method Summary
Modifier and TypeMethodDescriptiongetD()
Gets the block diagonal matrix D of the decomposition.getEigenvector
(int k) Returns the k-th eigenvector, i.e., the k-th column vector of the matrix returned byRealEigenDecomposition.getV()
.double[]
double
getRealEigenvalue
(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.boolean
Returns whether the calculated eigenvalues are complex or real.
-
Constructor Details
-
GeneralizedSymmetricEigenDecomposition
Constructor, using specific parameters. Solves the generalized symmetric eigenproblem of the form A x = λ B x, where matrices A, B are symmetric and B is positive definite. An exception is thrown if A is not symmetric and the Cholesky decomposition throws an exception if B is either not symmetric, not positive definite or singular.- Parameters:
A
- real symmetric matrixB
- real symmetric and positive definite matrixrsth
- relative symmetry thresholdapth
- absolute positivity threshold
-
GeneralizedSymmetricEigenDecomposition
Constructor, using default parameters. Solves the generalized symmetric eigenproblem of the form A x = λ B x, where matrices A, B * are symmetric and B is positive definite- Parameters:
A
- real symmetric matrixB
- real symmetric and positive definite matrix
-
-
Method Details
-
getRealEigenvalues
Description copied from interface:RealEigenDecomposition
Returns a vector holding the real parts of the eigenvalues- Specified by:
getRealEigenvalues
in interfaceRealEigenDecomposition
- Returns:
- real(diag(D))
-
getRealEigenvalue
Description copied from interface:RealEigenDecomposition
Returns the real part of the k-th eigenvalue- Specified by:
getRealEigenvalue
in interfaceRealEigenDecomposition
- Parameters:
k
- index of the eigenvalue @param k index of the eigenvector (0-based)- Returns:
- real part of the k-th eigenvalue
-
getImagEigenvalues
-
hasComplexEigenvalues
Description copied from interface:RealEigenDecomposition
Returns whether the calculated eigenvalues are complex or real.- Specified by:
hasComplexEigenvalues
in interfaceRealEigenDecomposition
- Returns:
true
if any of the eigenvalues is complex,false
otherwise
-
getD
Description copied from interface:RealEigenDecomposition
Gets the block diagonal matrix D of the decomposition. Real eigenvalues are on the diagonal while complex values are on 2x2 blocks {{real_pos imaginary}, {neg_imaginary, real}}.- Specified by:
getD
in interfaceRealEigenDecomposition
- Returns:
- matrix D
-
getEigenvector
Description copied from interface:RealEigenDecomposition
Returns the k-th eigenvector, i.e., the k-th column vector of the matrix returned byRealEigenDecomposition.getV()
.- Specified by:
getEigenvector
in interfaceRealEigenDecomposition
- Parameters:
k
- index of the eigenvector (0-based)- Returns:
- the k-th eigenvector (instance of
RealVector
)
-
getV
Description copied from interface:RealEigenDecomposition
Return the matrix of eigenvectors, which are its column vectors.- Specified by:
getV
in interfaceRealEigenDecomposition
- Returns:
- the matrix of eigenvectors
-