gnu.gleem.linalg
Class Matf

java.lang.Object
  |
  +--gnu.gleem.linalg.Matf

public class Matf
extends java.lang.Object

Arbitrary-size single-precision matrix class. Currently very simple and only supports a few needed operations.


Constructor Summary
Matf(int nRow, int nCol)
           
Matf(Matf arg)
           
 
Method Summary
 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
 Matf mul(Matf b)
          Returns this * b; creates new matrix
 Vecf 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 index
 Mat2f 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

DimensionMismatchException

mul

public Vecf mul(Vecf v)
         throws DimensionMismatchException
Returns this * v, assuming v is a column vector.

DimensionMismatchException

toMat2f

public Mat2f toMat2f()
              throws DimensionMismatchException
If this is a 2x2 matrix, returns it as a Mat2f.

DimensionMismatchException

toMat3f

public Mat3f toMat3f()
              throws DimensionMismatchException
If this is a 3x3 matrix, returns it as a Mat3f.

DimensionMismatchException

toMat4f

public Mat4f toMat4f()
              throws DimensionMismatchException
If this is a 4x4 matrix, returns it as a Mat4f.

DimensionMismatchException