Class EigenDecomposition.Solver
java.lang.Object
org.apache.commons.math3.linear.EigenDecomposition.Solver
- All Implemented Interfaces:
DecompositionSolver
- Enclosing class:
EigenDecomposition
Specialized solver.
- Since:
- 2.0 (changed to concrete class in 3.0)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArrayRealVector[]Eigenvectors.private double[]Imaginary part of the realEigenvalues.private double[]Real part of the realEigenvalues. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSolver(double[] realEigenvalues, double[] imagEigenvalues, ArrayRealVector[] eigenvectors) Builds a solver from decomposed matrix. -
Method Summary
Modifier and TypeMethodDescriptionprivate doubleeigenvalueNorm(int i) Get the inverse of the decomposed matrix.booleanChecks whether the decomposed matrix is non-singular.solve(RealMatrix b) Solve the linear equation A × X = B for matrices A.solve(RealVector b) Solves the linear equation A × X = B for symmetric matrices A.
-
Field Details
-
realEigenvalues
private double[] realEigenvaluesReal part of the realEigenvalues. -
imagEigenvalues
private double[] imagEigenvaluesImaginary part of the realEigenvalues. -
eigenvectors
Eigenvectors.
-
-
Constructor Details
-
Solver
Builds a solver from decomposed matrix.- Parameters:
realEigenvalues- Real parts of the eigenvalues.imagEigenvalues- Imaginary parts of the eigenvalues.eigenvectors- Eigenvectors.
-
-
Method Details
-
solve
Solves the linear equation A × X = B for symmetric matrices A.This method only finds exact linear solutions, i.e. solutions for which ||A × X - B|| is exactly 0.
- Specified by:
solvein interfaceDecompositionSolver- Parameters:
b- Right-hand side of the equation A × X = B.- Returns:
- a Vector X that minimizes the two norm of A × X - B.
- Throws:
DimensionMismatchException- if the matrices dimensions do not match.SingularMatrixException- if the decomposed matrix is singular.
-
solve
Solve the linear equation A × X = B for matrices A.The A matrix is implicit, it is provided by the underlying decomposition algorithm.
- Specified by:
solvein interfaceDecompositionSolver- Parameters:
b- right-hand side of the equation A × X = B- Returns:
- a matrix X that minimizes the two norm of A × X - B
-
isNonSingular
public boolean isNonSingular()Checks whether the decomposed matrix is non-singular.- Specified by:
isNonSingularin interfaceDecompositionSolver- Returns:
- true if the decomposed matrix is non-singular.
-
eigenvalueNorm
private double eigenvalueNorm(int i) - Parameters:
i- which eigenvalue to find the norm of- Returns:
- the norm of ith (complex) eigenvalue.
-
getInverse
Get the inverse of the decomposed matrix.- Specified by:
getInversein interfaceDecompositionSolver- Returns:
- the inverse matrix.
- Throws:
SingularMatrixException- if the decomposed matrix is singular.
-