Package xal.tools.math
Class GenericMatrix
- All Implemented Interfaces:
IArchive
Concrete implementation of a BaseMatrix class for general matrices.
- Author:
- Blaz Kranjc
-
Field Summary
Fields inherited from class xal.tools.math.BaseMatrix
ATTR_DATA, DBL_EPS, ULPS_BRACKET
-
Constructor Summary
ConstructorsConstructorDescriptionGenericMatrix
(double[][] arr) Instance a matrix with elements provided in an array.GenericMatrix
(int cntRows, int cntCols) Instance a zero matrix of provided size.GenericMatrix
(BaseMatrix<M> mat) Deep copy of any matrix to GenericMatrix. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Base classes must override the clone operation in order to make deep copies of the current object.static GenericSquareMatrix
createSquare
(BaseMatrix<?> m) Create a copy of provided matrix as a square matrix.protected GenericMatrix
newInstance
(int row, int cnt) Creates a new, uninitialized instance of this matrix type.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
-
Constructor Details
-
GenericMatrix
public GenericMatrix(int cntRows, int cntCols) Instance a zero matrix of provided size.- Parameters:
cntRows
- Number of rows.cntCols
- Number of columns.- See Also:
-
GenericMatrix
public GenericMatrix(double[][] arr) Instance a matrix with elements provided in an array.- Parameters:
arr
- Array containing the elements of matrix.- See Also:
-
BaseMatrix#BaseMatrix(int, int, double[][])
-
GenericMatrix
Deep copy of any matrix to GenericMatrix.- Parameters:
mat
- Matrix object.
-
-
Method Details
-
createSquare
Create a copy of provided matrix as a square matrix.- Parameters:
m
- Generic matrix to be transformed to a square matrix
-
clone
Description copied from class:BaseMatrix
Base classes must override the clone operation in order to make deep copies of the current object. This operation cannot be done without the exact type.- Specified by:
clone
in classBaseMatrix<GenericMatrix>
- See Also:
-
newInstance
Description copied from class:BaseMatrix
Creates a new, uninitialized instance of this matrix type.
NOTE: · This method was made abstract by Ivo List. Rather than use reflection to instantiate new objects, this function is now delegated to the concrete classes. This architecture is more robust and allows the compiler to do more error checking.
- Specified by:
newInstance
in classBaseMatrix<GenericMatrix>
- Parameters:
row
- Number of rows.cnt
- Number of columns.- Returns:
- uninitialized matrix object of type
M
- See Also:
-
BaseMatrix#newInstance()
-