Enum Class R3x3.POS

java.lang.Object
java.lang.Enum<R3x3.POS>
xal.tools.math.r3.R3x3.POS
All Implemented Interfaces:
Serializable, Comparable<R3x3.POS>, Constable
Enclosing class:
R3x3

public static enum R3x3.POS extends Enum<R3x3.POS>
Enumeration for the element positions of an R3x3 matrix element. Also provides some convenience functions for accessing these R3x3 elements.
Author:
Christopher K. Allen
  • Enum Constant Details

  • Method Details

    • values

      public static R3x3.POS[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static R3x3.POS valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • row

      public int row()
      return the row index of the matrix position
    • col

      public int col()
      return the column index of the matrix position
    • transpose

      public R3x3.POS transpose()
      Return the Position object representing the transpose element of this position. NOTE: The current implementation is slow.
      Returns:
      the transpose position of the current position
    • getUpperTriangle

      public static Set<R3x3.POS> getUpperTriangle()
      Returns the set of all element positions above the matrix diagonal.
      Returns:
      set of upper triangle matrix positions
    • getDiagonal

      public static Set<R3x3.POS> getDiagonal()
      Return the set of all matrix element positions along the diagonal.
      Returns:
      set of diagonal element positions
    • getLowerTriangle

      public static Set<R3x3.POS> getLowerTriangle()
      Return the set of all element positions below the matrix diagonal.
      Returns:
      set of lower triangle matrix positions
    • getOffDiagonal

      public static Set<R3x3.POS> getOffDiagonal()
      Return the set of all off-diagonal matrix positions.
      Returns:
      set of off diagonal positions, both upper and lower.
    • getValue

      public double getValue(R3x3 matTarget)
      Return the matrix element value for this position
      Parameters:
      matTarget - target matrix
      Returns:
      element value for this position
    • getRowDiag

      public double getRowDiag(R3x3 matTarget)
      Get the diagonal element in the same row as this element position.
      Parameters:
      matTarget - target matrix
      Returns:
      row diagonal element value
    • getColDiag

      public double getColDiag(R3x3 matTarget)
      Get the diagonal element in the same column as this element position.
      Parameters:
      matTarget - target matrix
      Returns:
      column diagonal element value
    • setValue

      public void setValue(R3x3 matTarget, double s)
      Set matrix element value for this position
      Parameters:
      matTarget - target matrix
      s - new value for matrix element
    • setRowDiag

      public void setRowDiag(R3x3 matTarget, double s)
      Set the diagonal element in the same row as this element position.
      Parameters:
      matTarget - target matrix
      s - new value for matrix element
    • setColDiag

      public void setColDiag(R3x3 matTarget, double s)
      Set the diagonal element in the same column as this element position.
      Parameters:
      matTarget - target matrix
      s - new value for matrix element