Class MatrixTurboEvaluator.EigenProvider
java.lang.Object
com.github.gbenroscience.parser.turbo.tools.MatrixTurboEvaluator.EigenProvider
- Enclosing class:
MatrixTurboEvaluator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MatrixgetEigenvalues(int n, double[] matrixData) Returns the eigenvalues of a matrix.static MatrixgetEigenvectors(int n, double[] matrixData) Returns the eigenvectors of a matrix as a square Matrix.
-
Constructor Details
-
EigenProvider
public EigenProvider()
-
-
Method Details
-
getEigenvalues
Returns the eigenvalues of a matrix. * Since eigenvalues can be complex, this returns an n x 2 Matrix where Column 0 is the Real part and Column 1 is the Imaginary part.- Parameters:
n- The dimension of the square matrix (n x n).matrixData- The flat 1D array of the matrix data.- Returns:
- A Matrix object of size n x 2.
-
getEigenvectors
Returns the eigenvectors of a matrix as a square Matrix. * This method is "Turbo" optimized because it computes eigenvalues once and passes them directly to the vector solver, avoiding the expensive QR algorithm repetition. * @param n The dimension of the square matrix (n x n).- Parameters:
matrixData- The flat 1D array of the matrix data.- Returns:
- A Matrix object of size n x n where columns are eigenvectors.
-