Class R2x2

All Implemented Interfaces:
Serializable, IArchive

public class R2x2 extends SquareMatrix<R2x2> implements Serializable

Represents an element of R2x2, the set of real 3x3 matrices. The class a set of the usual matrix operations and linear transforms on R3 represented by the matrix.

Author:
Christopher Allen
See Also:
  • Field Details

  • Constructor Details

    • R2x2

      public R2x2()
      Creates a new instance of R2x2 initialized to zero.
    • R2x2

      public R2x2(R2x2 matParent)
      Copy Constructor - create a deep copy of the given matrix.
      Parameters:
      matParent - initial value
    • R2x2

      public R2x2(String strTokens) throws IllegalArgumentException, NumberFormatException
      Parsing Constructor - create a R2x2 instance and initialize it according to a token string of element values. The token string argument is assumed to be one-dimensional and packed by column (ala FORTRAN).
      Parameters:
      strTokens - token vector of 2x2=4 numeric values
      Throws:
      IllegalArgumentException - wrong number of token strings
      NumberFormatException - bad number format, unparseable
  • Method Details

    • newZero

      public static R2x2 newZero()
      Create and return a new instance of a zero matrix.
      Returns:
      a matrix with all zero elements
    • newIdentity

      public static R2x2 newIdentity()
      Create and return a new identity matrix
      Returns:
      identity matrix object
    • newSymplectic

      public static R2x2 newSymplectic()
    • newRotation

      public static R2x2 newRotation(double dblAng)
      Create and return the generator element of SO(2) which is a counter-clockwise rotation.
      Parameters:
      dblAng - angle in radians
      Returns:
      x-plane counter-clockwise rotation matrix
    • clone

      public static R2x2 clone(R2x2 matTarget)
      Create a deep copy of the given R2x2 matrix object. The returned object shares no references with the argument.
      Parameters:
      matTarget - matrix to be copied
      Returns:
      a deep copy of the argument object
    • parse

      public static R2x2 parse(String strTokens) throws IllegalArgumentException, NumberFormatException
      Create a R2x2 instance and initialize it according to a token string of element values. The token string argument is assumed to be one-dimensional and packed by column (ala FORTRAN).
      Parameters:
      strTokens - token vector of 2x2=4 numeric values
      Throws:
      IllegalArgumentException - wrong number of token strings
      NumberFormatException - bad number format, unparseable
    • clone

      public R2x2 clone()
      Creates and returns a deep copy of this matrix.
      Specified by:
      clone in class BaseMatrix<R2x2>
      Since:
      Jul 3, 2014
      See Also:
    • times

      public R2 times(R2 vec)
      Non-destructive Matrix-Vector multiplication. Specifically, the vector y given by

          y = Ax

      where A is this matrix and x is the given vector.
      Parameters:
      vec - the vector factor x
      Returns:
      the matrix-vector product of this matrix with the given vector
    • newInstance

      protected R2x2 newInstance(int row, int cnt)
      Handles object creation required by the base class.
      Specified by:
      newInstance in class BaseMatrix<R2x2>
      Parameters:
      row - Number of rows.
      cnt - Number of columns.
      Returns:
      uninitialized matrix object of type M
      Since:
      Jun 17, 2014
      See Also:
      • xal.tools.math.BaseMatrix#newInstance()