OV::OVm3 Class Reference

3x3 floating point matrix class. Container for 3x3 floating point matrices with access operators. More...

#include <ovalgebra.h>


Public Member Functions

 OVm3 ()
 Empty constructor, sets identity matrix.
 OVm3 (float *m)
 Constructor from array of 9 floats.
 OVm3 (float e00, float e01, float e02, float e10, float e11, float e12, float e20, float e21, float e22)
 Constructor from 9 elements.
 ~OVm3 ()
 Destructor.
 operator float * ()
 Automatic typecast operator. Enables use of OVm3 in glFunc[v]() functions.
float & operator[] (int index)
 Linear access operator. 'int' and 'unsigned int' as well as const declared versions avaliable.
float & operator[] (unsigned int index)
const float & operator[] (int index) const
const float & operator[] (unsigned int index) const
float & operator() (int row, int col)
 Access operator. 'int' and 'unsigned int' as well as const declared versions avaliable.
float & operator() (unsigned int row, unsigned int col)
const float & operator() (int row, int col) const
const float & operator() (unsigned int row, unsigned int col) const
OVm3 operator * (const float f)
 Operator for multiplication with scalar.
OVv3 operator * (const OVv3 &v)
 Operator for multiplication with vector. This function could easily be re-implemented using an array of floats instead of OV3f.
OVm3 operator * (const OVm3 &a)
 Operator for multiplication with 3x3 matrix. This function could easily be re-implemented using an array of floats instead of OVm3.
void operator= (const float *a)
 = operator. This function could easily be re-implemented using an array of floats instead of OVm3.
OVv9 Get ()
 Use only if OV9f is wanted, else use overloaded typecast (OVm3 -> float*).
OVv3 GetRow (int index)
 Access operator for entire row of matrix.
OVv3 GetCol (int index)
 Access operator for entire column of matrix.
void Set (float *a)
 Sets matrix elements.
void SetRow (int index, float *v)
 Sets one row of matrix elements.
void SetCol (int index, float *v)
 Sets one column of matrix elements.
void Print ()
 Prints matrix to commandline.
void Clear ()
 Clears matrix to 0.
void SetToIdentityMatrix ()
 Sets matrix to identity.
float GetDeterminant ()
 Determinant of object matrix.
OVm3 GetTranspose ()
 Transpose of object matrix.
OVm3 GetInverse ()
 Inverse of object matrix. Using adjoint transpose matrices to calculate inverse.

Protected Member Functions

float Det2x2 (float &e00, float &e01, float &e10, float &e11)
 Determinant of any 2x2 matrix.
float Det3x3 (float &e00, float &e01, float &e02, float &e10, float &e11, float &e12, float &e20, float &e21, float &e22)
 Determinant of any 3x3 matrix.

Private Attributes

float e [9]


Detailed Description

3x3 floating point matrix class. Container for 3x3 floating point matrices with access operators.


Constructor & Destructor Documentation

OV::OVm3::OVm3 (  )  [inline]

Empty constructor, sets identity matrix.

OV::OVm3::OVm3 ( float *  m  )  [inline]

Constructor from array of 9 floats.

OV::OVm3::OVm3 ( float  e00,
float  e01,
float  e02,
float  e10,
float  e11,
float  e12,
float  e20,
float  e21,
float  e22 
)

Constructor from 9 elements.

Parameters:
eXX = eRC, element (R,C) in matrix.

OV::OVm3::~OVm3 (  )  [inline]

Destructor.


Member Function Documentation

OV::OVm3::operator float * (  )  [inline]

Automatic typecast operator. Enables use of OVm3 in glFunc[v]() functions.

Returns:
Returns pointer to first element in matrix

float& OV::OVm3::operator[] ( int  index  )  [inline]

Linear access operator. 'int' and 'unsigned int' as well as const declared versions avaliable.

Parameters:
index Linear index of element.
Returns:
Returns indexed element.

float& OV::OVm3::operator[] ( unsigned int  index  )  [inline]

const float& OV::OVm3::operator[] ( int  index  )  const [inline]

const float& OV::OVm3::operator[] ( unsigned int  index  )  const [inline]

float& OV::OVm3::operator() ( int  row,
int  col 
) [inline]

Access operator. 'int' and 'unsigned int' as well as const declared versions avaliable.

Parameters:
row Row index of element.
col Column index of element.
Returns:
Returns indexed element.

float& OV::OVm3::operator() ( unsigned int  row,
unsigned int  col 
) [inline]

const float& OV::OVm3::operator() ( int  row,
int  col 
) const [inline]

const float& OV::OVm3::operator() ( unsigned int  row,
unsigned int  col 
) const [inline]

OVm3 OV::OVm3::operator * ( const float  f  ) 

Operator for multiplication with scalar.

Parameters:
f Constant scalar.
Returns:
Returns result of multiplication as OVm3 matrix.

OVv3 OV::OVm3::operator * ( const OVv3 v  ) 

Operator for multiplication with vector. This function could easily be re-implemented using an array of floats instead of OV3f.

Parameters:
v Constant reference to vector.
Returns:
Returns result of multiplication as OV3f vector.

OVm3 OV::OVm3::operator * ( const OVm3 m  ) 

Operator for multiplication with 3x3 matrix. This function could easily be re-implemented using an array of floats instead of OVm3.

Parameters:
m Constant reference to matrix.
Returns:
Returns result of multiplication as OVm3 matrix.

void OV::OVm3::operator= ( const float *  a  ) 

= operator. This function could easily be re-implemented using an array of floats instead of OVm3.

Parameters:
a Constant reference to matrix.

OVv9 OV::OVm3::Get (  )  [inline]

Use only if OV9f is wanted, else use overloaded typecast (OVm3 -> float*).

Returns:
Returns elements as vector (compatible with float*).

OVv3 OV::OVm3::GetRow ( int  index  ) 

Access operator for entire row of matrix.

Parameters:
index Row index.
Returns:
Returns indexed row as OV3f vector.

OVv3 OV::OVm3::GetCol ( int  index  ) 

Access operator for entire column of matrix.

Parameters:
index Column index.
Returns:
Returns indexed column as OV3f vector.

void OV::OVm3::Set ( float *  a  ) 

Sets matrix elements.

Parameters:
a Array of 9 floats.

void OV::OVm3::SetRow ( int  index,
float *  v 
)

Sets one row of matrix elements.

Parameters:
index Row index.
v Contains the elements to which the row should be set

void OV::OVm3::SetCol ( int  index,
float *  v 
)

Sets one column of matrix elements.

Parameters:
index Column index.
v Contains the elements to which the column should be set

void OV::OVm3::Print (  ) 

Prints matrix to commandline.

void OV::OVm3::Clear (  ) 

Clears matrix to 0.

void OV::OVm3::SetToIdentityMatrix (  ) 

Sets matrix to identity.

float OV::OVm3::GetDeterminant (  ) 

Determinant of object matrix.

Returns:
Scalar value of determinant.

OVm3 OV::OVm3::GetTranspose (  ) 

Transpose of object matrix.

Returns:
Transpose OVm3 matrix.

OVm3 OV::OVm3::GetInverse (  ) 

Inverse of object matrix. Using adjoint transpose matrices to calculate inverse.

Returns:
Inverse OVm3 matrix.

float OV::OVm3::Det2x2 ( float &  e00,
float &  e01,
float &  e10,
float &  e11 
) [inline, protected]

Determinant of any 2x2 matrix.

Parameters:
eXX eXX = eRC, element (R,C) in matrix.
Returns:
Scalar value of determinant.

float OV::OVm3::Det3x3 ( float &  e00,
float &  e01,
float &  e02,
float &  e10,
float &  e11,
float &  e12,
float &  e20,
float &  e21,
float &  e22 
) [inline, protected]

Determinant of any 3x3 matrix.

Parameters:
eXX eXX = eRC, element (R,C) in matrix.
Returns:
Scalar value of determinant.


Field Documentation

float OV::OVm3::e[9] [private]

Array of matrix elements.


The documentation for this class was generated from the following files:
Generated on Thu May 17 20:28:04 2007 for Ocean View by  doxygen 1.5.2