org.ejml.alg.dense.decomposition.eig
Class SwitchingEigenDecomposition
- java.lang.Object
-
- org.ejml.alg.dense.decomposition.eig.SwitchingEigenDecomposition
-
- All Implemented Interfaces:
- DecompositionInterface<DenseMatrix64F>, EigenDecomposition<DenseMatrix64F>
public class SwitchingEigenDecomposition extends java.lang.Object implements EigenDecomposition<DenseMatrix64F>
Checks to see what type of matrix is being decomposed and calls different eigenvalue decomposition algorithms depending on the results. This primarily checks to see if the matrix is symmetric or not.
-
-
Constructor Summary
Constructors Constructor and Description SwitchingEigenDecomposition(int matrixSize)SwitchingEigenDecomposition(int matrixSize, boolean computeVectors, double tol)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleandecompose(DenseMatrix64F orig)Computes the decomposition of the input matrix.Complex64FgetEigenvalue(int index)Returns an eigenvalue as a complex number.DenseMatrix64FgetEigenVector(int index)Used to retrieve real valued eigenvectors.intgetNumberOfEigenvalues()Returns the number of eigenvalues/eigenvectors.booleaninputModified()Is the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.
-
-
-
Constructor Detail
-
SwitchingEigenDecomposition
public SwitchingEigenDecomposition(int matrixSize, boolean computeVectors, double tol)- Parameters:
computeVectors-tol- Tolerance for a matrix being symmetric
-
SwitchingEigenDecomposition
public SwitchingEigenDecomposition(int matrixSize)
-
-
Method Detail
-
getNumberOfEigenvalues
public int getNumberOfEigenvalues()
Description copied from interface:EigenDecompositionReturns the number of eigenvalues/eigenvectors. This is the matrix's dimension.- Specified by:
getNumberOfEigenvaluesin interfaceEigenDecomposition<DenseMatrix64F>- Returns:
- number of eigenvalues/eigenvectors.
-
getEigenvalue
public Complex64F getEigenvalue(int index)
Description copied from interface:EigenDecompositionReturns an eigenvalue as a complex number. For symmetric matrices the returned eigenvalue will always be a real number, which means the imaginary component will be equal to zero.
NOTE: The order of the eigenvalues is dependent upon the decomposition algorithm used. This means that they may or may not be ordered by magnitude. For example the QR algorithm will returns results that are partially ordered by magnitude, but this behavior should not be relied upon.
- Specified by:
getEigenvaluein interfaceEigenDecomposition<DenseMatrix64F>- Parameters:
index- Index of the eigenvalue eigenvector pair.- Returns:
- An eigenvalue.
-
getEigenVector
public DenseMatrix64F getEigenVector(int index)
Description copied from interface:EigenDecompositionUsed to retrieve real valued eigenvectors. If an eigenvector is associated with a complex eigenvalue then null is returned instead.
- Specified by:
getEigenVectorin interfaceEigenDecomposition<DenseMatrix64F>- Parameters:
index- Index of the eigenvalue eigenvector pair.- Returns:
- If the associated eigenvalue is real then an eigenvector is returned, null otherwise.
-
decompose
public boolean decompose(DenseMatrix64F orig)
Description copied from interface:DecompositionInterfaceComputes the decomposition of the input matrix. Depending on the implementation the input matrix might be stored internally or modified. If it is modified then the functionDecompositionInterface.inputModified()will return true and the matrix should not be modified until the decomposition is no longer needed.- Specified by:
decomposein interfaceDecompositionInterface<DenseMatrix64F>- Parameters:
orig- The matrix which is being decomposed. Modification is implementation dependent.- Returns:
- Returns if it was able to decompose the matrix.
-
inputModified
public boolean inputModified()
Description copied from interface:DecompositionInterfaceIs the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.- Specified by:
inputModifiedin interfaceDecompositionInterface<DenseMatrix64F>- Returns:
- true if the input matrix to decompose() is modified.
-
-
DMelt 3.0 © DataMelt by jWork.ORG