Class R3x3JacobiDecomposition

java.lang.Object
xal.tools.math.r3.R3x3JacobiDecomposition

public class R3x3JacobiDecomposition extends Object

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.

The JAMA matrix package is not explicitly used in this class.

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 Details

    • ONE_DEGREE

      public static final double ONE_DEGREE
      the value of one degree in radians
      See Also:
    • ROTATION_TOLERANCE

      public static final double ROTATION_TOLERANCE
      Stopping error criterion
      See Also:
    • ERROR_TOLERANCE

      public static final double ERROR_TOLERANCE
      small numerical tolerance
      See Also:
  • Constructor Details

    • R3x3JacobiDecomposition

      public R3x3JacobiDecomposition(R3x3 matTarget) throws IllegalArgumentException
      Constructor for R3x3JacobiDecomposition 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

      public R3x3 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

      public R3x3 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