Class R4x4
- All Implemented Interfaces:
IArchive
Represents an element of R4×4, the set of real, 4×4 matrices. The class also contains the usual set of matrix operations and linear transforms on R4 that are represented by these matrices.
- Since:
- Oct 15, 2013
- Author:
- Christopher K. Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration for the element position indices of a homogeneous phase space objects. -
Field Summary
FieldsFields inherited from class xal.tools.math.BaseMatrix
ATTR_DATA, DBL_EPS, ULPS_BRACKET
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a deep copy of this matrix.static R4x4
extractTransverse
(PhaseMatrix matPhi) Extracts a copy of the transverse portion of the givenPhaseMatrix
and returns it.static R4x4
Create a new identity matrixprotected R4x4
newInstance
(int row, int cnt) Handles object creation required by the base class.static R4x4
newZero()
Create a new instance of a zero matrix.static R4x4
Create a newR6x6
instance and initialize it according to a token string of element values.static R4x4
rotationProduct
(R2x2 matSO2) Compute the rotation matrix in phase space that is essentially the Cartesian product of the given rotation matrix in SO(3).Methods inherited from class xal.tools.math.SquareMatrix
conjugateInv, conjugateTrans, det, getSize, isSymmetric, solve, solveInPlace, timesEquals, trace
Methods inherited from class xal.tools.math.BaseMatrix
assignIdentity, assignMatrix, assignZero, conditionNumber, copy, equals, getArrayCopy, getColCnt, getElem, getElem, getMatrix, getRowCnt, hashCode, inverse, isApproxEqual, isApproxEqual, isEquivalentTo, isSquare, load, max, minus, minusEquals, newInstance, norm1, norm2, normF, normInf, plus, plusEquals, print, rank, save, setElem, setElem, setMatrix, setMatrix, setSubMatrix, times, times, times, timesEquals, toString, toStringMatrix, toStringMatrix, toStringMatrix, transpose
-
Field Details
-
INT_SIZE
public static final int INT_SIZEnumber of dimensions- See Also:
-
-
Constructor Details
-
R4x4
Zero argument constructor for R6x6. Returns a matrix of zeros.- Throws:
UnsupportedOperationException
- only thrown in the absence of this constructor- Since:
- Oct 15, 2013
-
R4x4
Initializing constructor forR6x6
. The matrix elements are set to those in the given Java native array, which must be 6×6 dimensional.- Parameters:
arrVals
- initial values for new matrix- Throws:
ArrayIndexOutOfBoundsException
- the given native array is not 6×6 dimensional- Since:
- Oct 15, 2013
-
R4x4
Parsing Constructor - creates an instance of the child class 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 getSize()^2 numeric values- Throws:
IllegalArgumentException
- wrong number of string tokensNumberFormatException
- bad number format, unparseable- Since:
- Oct 15, 2013
-
R4x4
Copy constructor forR6x6
. Creates a deep copy of the given object. The dimensions are set and the internal array is cloned.- Parameters:
matParent
- the matrix to be cloned- Throws:
UnsupportedOperationException
- base class has not defined a public, zero-argument constructor- Since:
- Oct 15, 2013
-
-
Method Details
-
newZero
Create a new instance of a zero matrix.- Returns:
- zero vector
-
newIdentity
Create a new identity matrix- Returns:
- 4×4 real identity matrix
-
rotationProduct
Compute the rotation matrix in phase space that is essentially the Cartesian product of the given rotation matrix in SO(3). That is, if the given argument is the rotation O, the returned matrix, denoted M, is the M = O×O×I embedding into homogeneous phase space R6×6×{1}. Thus, M ∈ SO(6) ⊂ R6×6×{1}.
Viewing phase-space as a 6D manifold built as the tangent bundle over R3 configuration space, then the fibers of 3D configuration space at a point (x,y,z) are represented by the Cartesian planes (x',y',z'). The returned phase matrix rotates these fibers in the same manner as their base point (x,y,z).
This is a convenience method to build the above rotation matrix in SO(7).
- Parameters:
matSO2
- a rotation matrix in two dimensions, i.e., a member of SO(2) ⊂ R2×2 ≅ S1- Returns:
- rotation matrix in S0(4) which is direct product of rotations in S0(2)
-
extractTransverse
Extracts a copy of the transverse portion of the givenPhaseMatrix
and returns it.- Parameters:
matPhi
- phase matrix to be copied- Returns:
- the part of the phase matrix corresponding to the transverse phase coordinates x, x', y, and y'.
- Since:
- Oct 15, 2013
-
parse
Create a new
R6x6
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 4x4=16 numeric values- Returns:
- real matrix with elements initialized by the given numeric tokens
- Throws:
IllegalArgumentException
- wrong number of string tokensNumberFormatException
- bad number format, unparseable
-
clone
Creates and returns a deep copy of this matrix.- Specified by:
clone
in classBaseMatrix<R4x4>
- Since:
- Jul 3, 2014
- See Also:
-
newInstance
Handles object creation required by the base class.- Specified by:
newInstance
in classBaseMatrix<R4x4>
- 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()
-