Package xal.tools.math.r3
Class R3x3
- All Implemented Interfaces:
Serializable
,IArchive
Represents an element of R3×3, the set of real, 3×3 matrices. The class also contains the usual set of matrix operations and linear transforms on R3 induced by the matrix.
- Author:
- Christopher Allen
- See Also:
-
xal.tools.r3.R3
- Serialized Form
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class xal.tools.math.BaseMatrix
ATTR_DATA, DBL_EPS, ULPS_BRACKET
-
Constructor Summary
ConstructorsConstructorDescriptionR3x3()
Creates a new instance of R3x3 initialized to zero.R3x3
(double[][] arrValues) Initializing constructor for classR3x3
.Parsing Constructor - create a R3x3 instance and initialize it according to a token string of element values.Copy Constructor - create a deep copy of the target matrix. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a deep copy of this matrix.static R3x3
Create a deep copy of the givenR3x3
matrix object.double
Return matrix element value.static R3x3
Create a new instance of the identity matrixprotected R3x3
newInstance
(int row, int cnt) Handles object creation required by the base class.static R3x3
newRotationX
(double dblAng) Create and return the generator element of SO(3) which is a counter-clockwise rotation about the x axis.static R3x3
newRotationY
(double dblAng) Create and return the generator element of SO(3) which is a counter-clockwise rotation about the y axis.static R3x3
newRotationZ
(double dblAng) Create and return the generator element of SO(3) which is a counter-clockwise rotation about the z axis.static R3x3
newZero()
Create a new instance of a zero matrix.static R3x3
Create a R3x3 instance and initialize it according to a token string of element values.void
Set the element specified by the position in the argument to the new value in the second argument.Nondestructive Matrix-Vector multiplication.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 (DIM=3)- See Also:
-
-
Constructor Details
-
R3x3
public R3x3()Creates a new instance of R3x3 initialized to zero. -
R3x3
Copy Constructor - create a deep copy of the target matrix.- Parameters:
matInit
- initial value
-
R3x3
Initializing constructor for classR3x3
. The values of the new matrix are set to the given Java primitive type array (the array itself is unchanged). The dimensions of the argument must be 3×3.- Parameters:
arrValues
- initial values for the new matrix object- Throws:
ArrayIndexOutOfBoundsException
- the argument must have the dimensions 3×3- Since:
- Oct 4, 2013
-
R3x3
Parsing Constructor - create a R3x3 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 3x3=9 numeric values- Throws:
IllegalArgumentException
- wrong number of token stringsNumberFormatException
- bad number format, unparseable
-
-
Method Details
-
newZero
Create a new instance of a zero matrix.- Returns:
- matrix whose elements are all zero
-
newIdentity
Create a new instance of the identity matrix- Returns:
- identity matrix object
-
newRotationX
Create and return the generator element of SO(3) which is a counter-clockwise rotation about the x axis.- Parameters:
dblAng
- angle in radians- Returns:
- x-plane counter-clockwise rotation matrix
-
newRotationY
Create and return the generator element of SO(3) which is a counter-clockwise rotation about the y axis.- Parameters:
dblAng
- angle in radians- Returns:
- y-plane counter-clockwise rotation matrix
-
newRotationZ
Create and return the generator element of SO(3) which is a counter-clockwise rotation about the z axis.- Parameters:
dblAng
- angle in radians- Returns:
- z-plane counter-clockwise rotation matrix
-
copy
Create a deep copy of the givenR3x3
matrix object. The returned object is completely decoupled from the original.- Parameters:
matTarget
- matrix to be copied- Returns:
- a deep copy of the argument object
-
parse
Create a R3x3 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 3x3=9 numeric values- Throws:
IllegalArgumentException
- wrong number of token stringsNumberFormatException
- bad number format, unparseable
-
clone
Creates and returns a deep copy of this matrix.- Specified by:
clone
in classBaseMatrix<R3x3>
- Since:
- Jul 3, 2014
- See Also:
-
setElem
Set the element specified by the position in the argument to the new value in the second argument.- Parameters:
pos
- matrix positionval
- new element value
-
getElem
Return matrix element value. Get matrix element value at specified position. -
times
Nondestructive Matrix-Vector multiplication.- Returns:
- this*vec
-
newInstance
Handles object creation required by the base class.- Specified by:
newInstance
in classBaseMatrix<R3x3>
- 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()
-