#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] |
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.
eXX | = eRC, element (R,C) in matrix. |
OV::OVm3::~OVm3 | ( | ) | [inline] |
Destructor.
OV::OVm3::operator float * | ( | ) | [inline] |
Automatic typecast operator. Enables use of OVm3 in glFunc[v]() functions.
float& OV::OVm3::operator[] | ( | int | index | ) | [inline] |
Linear access operator. 'int' and 'unsigned int' as well as const declared versions avaliable.
index | Linear index of 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.
row | Row index of element. | |
col | Column index of 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.
f | Constant scalar. |
Operator for multiplication with vector. This function could easily be re-implemented using an array of floats instead of OV3f.
v | Constant reference to vector. |
void OV::OVm3::operator= | ( | const float * | a | ) |
= operator. This function could easily be re-implemented using an array of floats instead of OVm3.
a | Constant reference to matrix. |
OVv9 OV::OVm3::Get | ( | ) | [inline] |
Use only if OV9f is wanted, else use overloaded typecast (OVm3 -> float*).
OVv3 OV::OVm3::GetRow | ( | int | index | ) |
Access operator for entire row of matrix.
index | Row index. |
OVv3 OV::OVm3::GetCol | ( | int | index | ) |
Access operator for entire column of matrix.
index | Column index. |
void OV::OVm3::Set | ( | float * | a | ) |
Sets matrix elements.
a | Array of 9 floats. |
void OV::OVm3::SetRow | ( | int | index, | |
float * | v | |||
) |
Sets one row of matrix elements.
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.
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.
OVm3 OV::OVm3::GetInverse | ( | ) |
Inverse of object matrix. Using adjoint transpose matrices to calculate inverse.
float OV::OVm3::Det2x2 | ( | float & | e00, | |
float & | e01, | |||
float & | e10, | |||
float & | e11 | |||
) | [inline, protected] |
Determinant of any 2x2 matrix.
eXX | eXX = eRC, element (R,C) in matrix. |
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.
eXX | eXX = eRC, element (R,C) in matrix. |
float OV::OVm3::e[9] [private] |
Array of matrix elements.