Class MatrixFactory
- Object
-
- MatrixFactory
-
public final class MatrixFactory extends Object
Static utility methods for creating matrix. This factory selects one of theMatrix1
,Matrix2
,Matrix3
,Matrix4
orGeneralMatrix
implementation according the desired matrix size. Note that if the matrix size is know at compile time, it may be more efficient to invoke directly the constructor of the appropriate class instead.- Since:
- 2.2
- Author:
- Martin Desruisseaux (IRD)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static XMatrix
create(int size)
Creates a square identity matrix of sizesize
×size
.static XMatrix
create(int numRow, int numCol)
Creates a matrix of sizenumRow
×numCol
.static XMatrix
create(Matrix matrix)
Creates a new matrix which is a copy of the specified matrix.
-
-
-
Method Detail
-
create
public static XMatrix create(int size)
Creates a square identity matrix of sizesize
×size
.- Parameters:
size
- For an affine transform, this is the number of source and target dimensions + 1.- Returns:
- An identity matrix of the given size.
-
create
public static XMatrix create(int numRow, int numCol)
Creates a matrix of sizenumRow
×numCol
. Elements on the diagonal j==i are set to 1.- Parameters:
numRow
- For an affine transform, this is the number of target dimensions + 1.numCol
- For an affine transform, this is the number of source dimensions + 1.- Returns:
- An identity matrix of the given size.
-
-