Matrix Class Reference
[System]

Four-by-four matrix with multiplication and inversion. More...

#include <Matrix.hpp>

List of all members.

Public Member Functions

 Matrix ()
 Matrix (float a0, float a1, float a2, float a3, float b0, float b1, float b2, float b3, float c0, float c1, float c2, float c3, float d0, float d1, float d2, float d3)
float getDeterminant () const
int getColumns () const
Matrix getInverse () const
int getRows () const
int getSize () const
Matrix getTranspose () const
float & operator() (int i, int j)
float operator() (int i, int j) const
void print ()
void set (float array[16])
void toArray (float *array)

Protected Member Functions

Matrix getSubmatrix (int i, int j) const
float det (int n) const

Private Member Functions

 Matrix (int size)

Private Attributes

float arr [4][4]
int size

Friends

Matrix operator* (const Matrix &A, const Matrix &B)
Vector operator* (const Matrix &A, const Vector &B)

Detailed Description

Four-by-four matrix with multiplication and inversion.


Constructor & Destructor Documentation

Matrix (  ) 

Creates the identity matrix.

Matrix ( float  a0,
float  a1,
float  a2,
float  a3,
float  b0,
float  b1,
float  b2,
float  b3,
float  c0,
float  c1,
float  c2,
float  c3,
float  d0,
float  d1,
float  d2,
float  d3 
)

Creates a matrix from explicit values.

Matrix ( int  size  )  [private]

Creates an uninitialized matrix


Member Function Documentation

float det ( int  n  )  const [protected]

Calculate the determinant of a part of the matrix.

int getColumns (  )  const [inline]
Returns:
the number of columns
float getDeterminant (  )  const [inline]

Calculate the determinant of the entire matrix.

Matrix getInverse (  )  const

Get the inverse of this matrix.

int getRows (  )  const [inline]
Returns:
the number of rows.
Matrix getSubmatrix ( int  i,
int  j 
) const [protected]
Returns:
a new matrix with row i and column j deleted.
Matrix getTranspose (  )  const
Returns:
matrix with rows and columns switched.
float operator() ( int  i,
int  j 
) const

Returns one of the elements in the matrix.

float & operator() ( int  i,
int  j 
)

Returns one of the elements in the matrix.

void print (  ) 

Pretty prints the matrix to standard out.

void set ( float  array[16]  ) 

Sets the Matrix from values in the array (column-major order).

void toArray ( float *  array  ) 

Puts the matrix into a single-subscript array (column-major order).


Friends And Related Function Documentation

Vector operator* ( const Matrix A,
const Vector B 
) [friend]

Multiplies a matrix with a vector.

Matrix operator* ( const Matrix A,
const Matrix B 
) [friend]

Multiplies two matrices together.


The documentation for this class was generated from the following files:
Generated on Wed Jun 9 01:36:36 2010 for Gander by  doxygen 1.6.3