Package org.gephi.lib.gleem.linalg
Class Matf
- java.lang.Object
-
- org.gephi.lib.gleem.linalg.Matf
-
public class Matf extends Object
Arbitrary-size single-precision matrix class. Currently very simple and only supports a few needed operations.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
get(int i, int j)
Gets the (i,j)th element of this matrix, where i is the row index and j is the column indexMatf
mul(Matf b)
Returns this * b; creates new matrixVecf
mul(Vecf v)
Returns this * v, assuming v is a column vector.int
nCol()
int
nRow()
void
set(int i, int j, float val)
Sets the (i,j)th element of this matrix, where i is the row index and j is the column indexMat2f
toMat2f()
If this is a 2x2 matrix, returns it as a Mat2f.Mat3f
toMat3f()
If this is a 3x3 matrix, returns it as a Mat3f.Mat4f
toMat4f()
If this is a 4x4 matrix, returns it as a Mat4f.Matf
transpose()
Returns transpose of this matrix; creates new matrix
-
-
-
Constructor Detail
-
Matf
public Matf(int nRow, int nCol)
-
Matf
public Matf(Matf arg)
-
-
Method Detail
-
nRow
public int nRow()
-
nCol
public int nCol()
-
get
public float get(int i, int j)
Gets the (i,j)th element of this matrix, where i is the row index and j is the column index
-
set
public void set(int i, int j, float val)
Sets the (i,j)th element of this matrix, where i is the row index and j is the column index
-
transpose
public Matf transpose()
Returns transpose of this matrix; creates new matrix
-
mul
public Matf mul(Matf b) throws DimensionMismatchException
Returns this * b; creates new matrix- Throws:
DimensionMismatchException
-
mul
public Vecf mul(Vecf v) throws DimensionMismatchException
Returns this * v, assuming v is a column vector.- Throws:
DimensionMismatchException
-
toMat2f
public Mat2f toMat2f() throws DimensionMismatchException
If this is a 2x2 matrix, returns it as a Mat2f.- Throws:
DimensionMismatchException
-
toMat3f
public Mat3f toMat3f() throws DimensionMismatchException
If this is a 3x3 matrix, returns it as a Mat3f.- Throws:
DimensionMismatchException
-
toMat4f
public Mat4f toMat4f() throws DimensionMismatchException
If this is a 4x4 matrix, returns it as a Mat4f.- Throws:
DimensionMismatchException
-
-