Package xal.tools.math.r3
Class R3x3JacobiDecomposition
java.lang.Object
xal.tools.math.r3.R3x3JacobiDecomposition
Encapsulates the results of an eigenvalue decomposition operation on a symmetric R3×3 matrix A object using Jacobi iterations.
If the matrix is symmetric it can be factored as
A = RDRT
where A is the target matrix, R is an
orthogonal matrix in
SO(3), and D is the diagonal matrix of real
eigenvalues of
A.
Most of the work of the Jacobi iterations is done in the helper class
.
JacobiIterate
- Author:
- Christopher K. Allen #see xal.tools.math.r3.R3x3 #see xal.tools.math.r3.JacobiIterate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
small numerical tolerancestatic final double
the value of one degree in radiansstatic final double
Stopping error criterion -
Constructor Summary
ConstructorsConstructorDescriptionR3x3JacobiDecomposition
(R3x3 matTarget) Constructor forR3x3JacobiDecomposition
objects. -
Method Summary
Modifier and TypeMethodDescriptionReturn the matrix D of eigenvalues in the decomposition.double[]
Get the array of all eigenvalues.int
Get the number of iterations necessary to diagonalize the matrix to give precision.Get the matrix R of eigenvectors for the decomposition.static void
setDebug
(boolean bolDebug) Turn debugging flag on or off.
-
Field Details
-
ONE_DEGREE
public static final double ONE_DEGREEthe value of one degree in radians- See Also:
-
ROTATION_TOLERANCE
public static final double ROTATION_TOLERANCEStopping error criterion- See Also:
-
ERROR_TOLERANCE
public static final double ERROR_TOLERANCEsmall numerical tolerance- See Also:
-
-
Constructor Details
-
R3x3JacobiDecomposition
Constructor forR3x3JacobiDecomposition
objects. The decomposition is done in the construction of this object.- Parameters:
matTarget
- target matrix to factorize- Throws:
IllegalArgumentException
- matrix is not symmetric
-
-
Method Details
-
setDebug
public static void setDebug(boolean bolDebug) Turn debugging flag on or off. Turning on debugging flag sends debugging information to the console.- Parameters:
bolDebug
- value of debugging flag.
-
getIterationCount
public int getIterationCount()Get the number of iterations necessary to diagonalize the matrix to give precision.- Returns:
- number of Jacobi iterations performed.
- See Also:
-
getEigenvalues
public double[] getEigenvalues()Get the array of all eigenvalues.- Returns:
- size 3 array of all the eigenvalues
-
getRotationMatrix
Get the matrix R of eigenvectors for the decomposition. Note that this matrix is the diagonalizing matrix for the target matrix A. Since the target matrix A is symmetric then the returned matrix R will be in the special orthogonal group SO(3). Note that, in general, this matrix could be badly conditioned.- Returns:
- diagonalizing matrix of A
-
getDiagonalMatrix
Return the matrix D of eigenvalues in the decomposition. Note that since target matrix A is symmetric then this matrix will be diagonal with real elements.- Returns:
- diagonal matrix D of eigenvalues of A
-