public class PhaseMatrix extends SquareMatrix<PhaseMatrix> implements java.io.Serializable
.Modifier and Type | Class and Description |
---|---|
static class |
PhaseMatrix.IND
Enumeration for the element position indices of a homogeneous
phase space objects.
|
Modifier and Type | Field and Description |
---|---|
static int |
IND_HOM
index of homogeneous coordinate
|
static int |
IND_X
index of x position
|
static int |
IND_XP
index of x' position
|
static int |
IND_Y
index of y position
|
static int |
IND_YP
index of y' position
|
static int |
IND_Z
index of z position
|
static int |
IND_ZP
index of z' position
|
static int |
INT_SIZE
number of dimensions (DIM=7)
|
ATTR_DATA, matImpl
Constructor and Description |
---|
PhaseMatrix()
Creates a new instance of PhaseMatrix initialized to zero.
|
PhaseMatrix(DataAdaptor daSource)
Create a new
PhaseMatrix object and initialize with the data
source behind the DataAdaptor interface. |
PhaseMatrix(double[][] arrValues)
Initializing constructor for class
PhaseMatrix . |
PhaseMatrix(PhaseMatrix matInit)
Copy Constructor - create a deep copy of the target phase matrix.
|
PhaseMatrix(java.lang.String strValues)
Parsing Constructor - create a PhaseMatrix instance and initialize it
according to a token string of element values.
|
Modifier and Type | Method and Description |
---|---|
PhaseMatrix |
clone()
Creates and returns a deep copy of this matrix.
|
void |
homogenize()
Explicitly enforce the homogeneous nature of this matrix.
|
static PhaseMatrix |
identity()
Create an identity phase matrix
|
double |
max()
We must redefine the norm of any matrix on projective space to
eliminate the homogeneous coordinate.
|
PhaseMatrix |
minus(PhaseMatrix matSub)
Non-destructive matrix subtraction.
|
void |
minusEquals(PhaseMatrix matSub)
In-place matrix subtraction.
|
protected PhaseMatrix |
newInstance()
Handles object creation required by the base class.
|
double |
norm1()
We must redefine the norm of any matrix on projective space to
eliminate the homogeneous coordinate.
|
double |
norm2()
We must redefine the norm of any matrix on projective space to
eliminate the homogeneous coordinate.
|
double |
normF()
We must redefine the norm of any matrix on projective space to
eliminate the homogeneous coordinate.
|
double |
normInf()
We must redefine the norm of any matrix on projective space to
eliminate the homogeneous coordinate.
|
static PhaseMatrix |
parse(java.lang.String strTokens)
Create a PhaseMatrix instance and initialize it
according to a token string of element values.
|
PhaseMatrix |
plus(PhaseMatrix matAddend)
Non-destructive matrix addition.
|
void |
plusEquals(PhaseMatrix matAddend)
In-place matrix addition.
|
R6 |
projectColumn(int j)
Projects the jth column onto R6.
|
R6 |
projectColumn(PhaseMatrix.IND j)
Projects the jth column onto R6.
|
R4x4 |
projectR4x4()
Projects the
PhaseMatrix onto the space of
4×4 matrices. |
R6x6 |
projectR6x6()
Projects the
PhaseMatrix onto the space of
6×6 matrices. |
R6 |
projectRow(int i)
Projects the ith row onto R6.
|
R6 |
projectRow(PhaseMatrix.IND i)
Projects the ith row onto R6.
|
static PhaseMatrix |
rotationProduct(R3x3 matSO3)
Compute the rotation matrix in phase space that is essentially the
Cartesian product of the given rotation matrix in SO(3).
|
void |
setElem(PhaseMatrix.IND iRow,
PhaseMatrix.IND iCol,
double s)
Element assignment - assigns matrix element to the specified value
|
static PhaseMatrix |
spatialTranslation(R3 vecDispl)
Create a phase matrix representing a linear translation
operator on homogeneous phase space that only affects the
spatial coordinates.
|
static PhaseMatrix |
translation(PhaseVector vecTrans)
Create a phase matrix representing a linear translation
operator on homogeneous phase space.
|
static PhaseMatrix |
zero()
Create a new instance of a zero phase matrix.
|
assignIdentity, conjugateInv, conjugateTrans, det, getSize, inverse, isEquivalentTo, isSymmetric, setElem, solve, solveInPlace, times, times, times, timesEquals, timesEquals, transpose
assignMatrix, assignZero, conditionNumber, copy, equals, getArrayCopy, getColCnt, getElem, getElem, getMatrix, getRowCnt, hashCode, load, newInstance, print, save, setElem, setMatrix, setMatrix, setSubMatrix, toString, toStringMatrix, toStringMatrix, toStringMatrix
public static final int IND_X
public static final int IND_XP
public static final int IND_Y
public static final int IND_YP
public static final int IND_Z
public static final int IND_ZP
public static final int IND_HOM
public static final int INT_SIZE
public PhaseMatrix()
public PhaseMatrix(PhaseMatrix matInit)
matInit
- initial valuepublic PhaseMatrix(DataAdaptor daSource) throws DataFormatException
PhaseMatrix
object and initialize with the data
source behind the DataAdaptor
interface.daSource
- data source containing initialization dataDataFormatException
- malformed dataIArchive.load(xal.tools.data.DataAdaptor)
public PhaseMatrix(java.lang.String strValues) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException
strValues
- token vector of 7x7=49 numeric valuesjava.lang.IllegalArgumentException
- wrong number of token stringsjava.lang.NumberFormatException
- bad number format, unparseableBaseMatrix.setMatrix(java.lang.String)
public PhaseMatrix(double[][] arrValues) throws java.lang.ArrayIndexOutOfBoundsException
PhaseMatrix
. The values of
the new matrix object are set to the given Java primitive type array (the
array is not modified).arrValues
- initial values for the new matrixjava.lang.ArrayIndexOutOfBoundsException
- the argument must have dimensions 7×7public static PhaseMatrix zero()
public static PhaseMatrix identity()
public static PhaseMatrix translation(PhaseVector vecTrans)
Create a phase matrix representing a linear translation
operator on homogeneous phase space. Multiplication by the
returned PhaseMatrix
object is equivalent to
translation by the given PhaseVector
argument.
Specifically, if the argument Δ has coordinates
Δ = (Δx, Δx', Δdy, Δdy',
Δdz, Δdz', 1)T
then the returned matrix T(Δ) has the form
|1 0 0 0 0 0 Δx | |0 1 0 0 0 0 Δx'| T(Δ) = |0 0 1 0 0 0 Δy | |0 0 0 1 0 0 Δy'| |0 0 0 0 1 0 Δz | |0 0 0 0 0 1 Δz'| |0 0 0 0 0 0 1 |Consequently, given a phase vector v of the form
|x | |x'| v = |y | |y'| |z | |z'| |1 |Then operation on v by T(Δ) has the result
|x + Δx | |x'+ Δx'| T(Δ)v = |y + Δy | |y'+ Δy'| |z + Δz | |z'+ Δz'| | 1 |which we see is equivalent to the simple vector addition v + Δ.
vecTrans
- translation vector Δpublic static PhaseMatrix spatialTranslation(R3 vecDispl)
Create a phase matrix representing a linear translation
operator on homogeneous phase space that only affects the
spatial coordinates. Multiplication by the
returned PhaseMatrix
object is equivalent to
translation by the given R3
argument projected
into phase space.
Specifically, if the argument Δ has coordinates
Δ = (Δx, Δdy, Δdz)T
then the returned matrix T(dv) has the form
|1 0 0 0 0 0 Δx| |0 1 0 0 0 0 0 | T(dv) = |0 0 1 0 0 0 Δy| |0 0 0 1 0 0 0 | |0 0 0 0 1 0 Δz| |0 0 0 0 0 1 0 | |0 0 0 0 0 0 1|which is the translation operator in phase space restricted to the spatial coordinates.
See
for further
discussion of translation operators and their representation by
homogeneous phase-space matrices.
translation(PhaseVector)
vecDispl
- the spatial displacement vector Δtranslation(PhaseVector)
public static PhaseMatrix rotationProduct(R3x3 matSO3)
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).
matSO3
- a rotation matrix in three dimensions, i.e., a member of SO(3) ⊂ R3×3public static PhaseMatrix parse(java.lang.String strTokens) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException
strTokens
- token vector of 7x7=49 numeric valuesjava.lang.IllegalArgumentException
- wrong number of token stringsjava.lang.NumberFormatException
- bad number format, unparseablepublic PhaseMatrix clone()
clone
in class BaseMatrix<PhaseMatrix>
BaseMatrix.clone()
protected PhaseMatrix newInstance()
newInstance
in class BaseMatrix<PhaseMatrix>
M
BaseMatrix.newInstance()
public void setElem(PhaseMatrix.IND iRow, PhaseMatrix.IND iCol, double s)
iRow
- row indexiCol
- column indexs
- new matrix element valuepublic void homogenize()
public R6x6 projectR6x6()
Projects the PhaseMatrix
onto the space of
6×6 matrices. The projective dimension of this phase matrix
is lost in the projection, that is, the homogeneous coordinate and
all the actions associated with it (primarily translations).
This method is useful when the phase matrix represents the statistics of a centered beam, or when it represents a transfer map without any translation.
public R4x4 projectR4x4()
Projects the PhaseMatrix
onto the space of
4×4 matrices. The projective dimension of this phase matrix
is lost in the projection, as is the longitudinal components of the
matrix. that is, the last three columns and the last three rows are
truncated.
This method is useful when the phase matrix represents the transverse properties of a beam, or when it represents a transverse action on a beam.
public R6 projectRow(PhaseMatrix.IND i)
i
- index of the matrix row to be returned, i ∈ {0,...,5}projectRow(int)
public R6 projectRow(int i)
i
- index of the matrix row to be returned, i ∈ {0,...,5}public R6 projectColumn(PhaseMatrix.IND j)
j
- index of the matrix column to be returned, j ∈ {0,...,5}projectColumn(int)
public R6 projectColumn(int j)
j
- index of the matrix column to be returned, j ∈ {0,...,5}public PhaseMatrix plus(PhaseMatrix matAddend)
Non-destructive matrix addition. The homogeneous pivot element on the diagonal is unchanged at value 1.
plus
in class BaseMatrix<PhaseMatrix>
matAddend
- matrix to be added to thispublic void plusEquals(PhaseMatrix matAddend)
In-place matrix addition. The homogeneous pivot element on the diagonal is unchanged at value 1.
plusEquals
in class BaseMatrix<PhaseMatrix>
matAddend
- matrix to be added to this (result replaces this)public PhaseMatrix minus(PhaseMatrix matSub)
Non-destructive matrix subtraction. The homogeneous pivot element on the diagonal is unchanged at value 1.
minus
in class BaseMatrix<PhaseMatrix>
matSub
- matrix to be subtracted from this one (subtrahend)public void minusEquals(PhaseMatrix matSub)
In-place matrix subtraction. The homogeneous pivot element on the diagonal is unchanged at value 1.
minusEquals
in class BaseMatrix<PhaseMatrix>
matSub
- matrix to be subtracted from this matrix (result replaces this)public double max()
BaseMatrix
for information on the specific
norm.max
in class BaseMatrix<PhaseMatrix>
BaseMatrix.max()
public double normInf()
BaseMatrix
for information on the specific
norm.normInf
in class BaseMatrix<PhaseMatrix>
BaseMatrix.normInf()
public double norm1()
BaseMatrix
for information on the specific
norm.norm1
in class BaseMatrix<PhaseMatrix>
BaseMatrix.norm1()
public double norm2()
BaseMatrix
for information on the specific
norm.norm2
in class BaseMatrix<PhaseMatrix>
BaseMatrix.norm2()
public double normF()
BaseMatrix
for information on the specific
norm.normF
in class BaseMatrix<PhaseMatrix>
BaseMatrix.normF()