#include <Matrix.h>
Public Member Functions | |
| TMatrix (Int iRowsColumns=1) | |
| TMatrix (Int iRows, Int iColumns) | |
| TMatrix (const Float **aafData, Int iRows, Int iColumns) | |
| TMatrix (Float **aafData, Int iRows, Int iColumns, bool bAdoptPointer) | |
| TMatrix (const TString &rstrValues) | |
| TMatrix (const TMatrix &rMatrix) | |
| Protected copy constructor. | |
| TMatrix (const IMatrix &rMatrix) | |
| Constructor taking interface type matrix. | |
| virtual | ~TMatrix () |
| Virtual destructor. | |
| void | assign (Float **aafData, Int iRows, Int iColumns, bool bAdoptPointer) |
| void | assign (const TMatrix &rMatrix) |
| const Float ** | getCells () const |
| bool | reduce (Int iRow, Int iColumn, TMatrix &rMatrix) const |
| bool | pow (Int iExp, TMatrix &rMatrix) const |
| TString | toString () const |
| virtual void MQUALIFIER | assign (const IMatrix &rMatrix) |
| virtual Float MQUALIFIER | calcDeterminant () const |
| virtual bool MQUALIFIER | calcInverse (IMatrix &rInverseMatrix) const |
| virtual void MQUALIFIER | calcTransposed (IMatrix &rTransposedMatrix) const |
| virtual bool MQUALIFIER | equals (const IMatrix &rMatrix, Float fPrecision=FLOAT_PRECISION) const |
| virtual Float MQUALIFIER | getCell (Int iRow, Int iColumn, bool *pbError=NULL) const |
| virtual bool MQUALIFIER | getRow (Int iRow, IVector &rVector) const |
| virtual bool MQUALIFIER | getColumn (Int iColumn, IVector &rVector) const |
| virtual bool MQUALIFIER | getDiagonalVector (IVector &rDiagVector) const |
| virtual Int MQUALIFIER | getRowCount () const |
| virtual Int MQUALIFIER | getColumnCount () const |
| virtual void MQUALIFIER | initAsIdentityMatrix () |
| virtual void MQUALIFIER | initAsZeroMatrix () |
| virtual bool MQUALIFIER | invert () |
| virtual bool MQUALIFIER | isIdentityMatrix () const |
| virtual bool MQUALIFIER | isInvertible () const |
| virtual bool MQUALIFIER | isSquaredMatrix () const |
| virtual bool MQUALIFIER | isZeroMatrix () const |
| virtual bool MQUALIFIER | setCell (Int iRow, Int iColumn, const Float &rValue) |
| virtual bool MQUALIFIER | setRow (Int iRow, const IVector &rVector) |
| virtual bool MQUALIFIER | setColumn (Int iColumn, const IVector &rVector) |
| virtual void MQUALIFIER | setDiagonalValue (const Float &fValue) |
| virtual void MQUALIFIER | setDiagonalVector (const IVector &rDiagVector) |
| virtual Retval MQUALIFIER | setDimensions (Int iRows, Int iColumns) |
| virtual bool MQUALIFIER | swapCells (Int iRow1, Int iColumn1, Int iRow2, Int iColumn2) |
| virtual void MQUALIFIER | transpose () |
| virtual Float MQUALIFIER | getEntropy () const |
| virtual void MQUALIFIER | addConstant (Float fConstant) |
| virtual void MQUALIFIER | multiplyConstant (Float fConstant) |
| TMatrix | operator+ (const Float &f) const |
| TMatrix | operator- (const Float &f) const |
| TVector | operator* (const IVector &rVector) const |
| TMatrix | operator* (const TMatrix &rMatrix) const |
| TMatrix | operator* (const Float &f) const |
| TMatrix | operator/ (const Float &f) const |
| const TMatrix & | operator+= (const Float &f) |
| const TMatrix & | operator-= (const Float &f) |
| const TMatrix & | operator*= (const Float &f) |
| const TMatrix & | operator/= (const Float &f) |
| const TMatrix & | operator= (const TMatrix &rMatrix) |
| const TMatrix & | operator= (const IMatrix &rMatrix) |
| bool | operator== (const IMatrix &rMatrix) const |
| bool | operator!= (const IMatrix &rMatrix) const |
| Float * | operator[] (Int iIndex) |
Protected Member Functions | |
| void | createDataArray () |
| void | createDataArray (const Float **aafData) |
| void | releaseDataArray () |
Protected Attributes | |
| Float ** | m_aafData |
| Data of the matrix. | |
| Int | m_iRows |
| Number of rows. | |
| Int | m_iColumns |
| Number if columns. | |
This class implements the generic matrix class containing float values.
| zeus::TMatrix::TMatrix | ( | Int | iRowsColumns = 1 ) |
Creates a matrix of size iRowsColumns x iRowsColumns. The matrix is initialized with zero values
| iRowsColumns | : number of rows and columns |
| zeus::TMatrix::TMatrix | ( | Int | iRows, |
| Int | iColumns | ||
| ) |
Creates a matrix of size iRows x iColumns. The matrix is initialized with zero values
| iRows | : number of rows |
| iColumns | : number of columns |
| zeus::TMatrix::TMatrix | ( | const Float ** | aafData, |
| Int | iRows, | ||
| Int | iColumns | ||
| ) |
Creates a matrix of size iRows x iColumns. The matrix is initialized with values given by the double array aafData
| aafData | : data to assign |
| iRows | : number of rows |
| iColumns | : number of columns |
| zeus::TMatrix::TMatrix | ( | Float ** | aafData, |
| Int | iRows, | ||
| Int | iColumns, | ||
| bool | bAdoptPointer | ||
| ) |
Creates a matrix of size iRows x iColumns. The matrix is initialized with values given by the double array aafData. The pointer of the double array might be adapted (managed and released by the Matrix object)
| aafData | : data to assign |
| iRows | : number of rows |
| iColumns | : number of columns |
| bAdoptPointer | : Flag if the pointer should be adapted |
| zeus::TMatrix::TMatrix | ( | const TString & | rstrValues ) |
creates a matrix out of a string representation. The notation is [a11, a12], [a21, a22]
| rstrValues | : string representing the matrix |
| zeus::TMatrix::TMatrix | ( | const TMatrix & | rMatrix ) | [inline] |
Protected copy constructor.
| zeus::TMatrix::TMatrix | ( | const IMatrix & | rMatrix ) | [inline] |
Constructor taking interface type matrix.
| virtual zeus::TMatrix::~TMatrix | ( | ) | [inline, virtual] |
Virtual destructor.
| void MQUALIFIER zeus::TMatrix::addConstant | ( | Float | fConstant ) | [virtual] |
Implements zeus::IMatrix.
| void zeus::TMatrix::assign | ( | Float ** | aafData, |
| Int | iRows, | ||
| Int | iColumns, | ||
| bool | bAdoptPointer | ||
| ) |
Assigns two dimensional float array to the matrix.
| aafData | : Pointer of data to assign |
| iRows | : Number of rows |
| iColumns | : Number of columns |
| bAdoptPointer | : Flag if the pointer should be adapted (=true) or just copied (=false). |
| void zeus::TMatrix::assign | ( | const TMatrix & | rMatrix ) |
Assigns a matrix
| rMatrix | : Matrix to assign |
| void MQUALIFIER zeus::TMatrix::assign | ( | const IMatrix & | rMatrix ) | [virtual] |
Implements zeus::IMatrix.
| Float MQUALIFIER zeus::TMatrix::calcDeterminant | ( | ) | const [virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::calcInverse | ( | IMatrix & | rInverseMatrix ) | const [virtual] |
Implements zeus::IMatrix.
| void MQUALIFIER zeus::TMatrix::calcTransposed | ( | IMatrix & | rTransposedMatrix ) | const [virtual] |
Implements zeus::IMatrix.
| void zeus::TMatrix::createDataArray | ( | ) | [protected] |
creates the array and initializes the array with zeros
| void zeus::TMatrix::createDataArray | ( | const Float ** | aafData ) | [protected] |
creates the array and initializes the data array with the given values from aafData
| aafData | : data array |
| bool MQUALIFIER zeus::TMatrix::equals | ( | const IMatrix & | rMatrix, |
| Float | fPrecision = FLOAT_PRECISION |
||
| ) | const [virtual] |
Implements zeus::IMatrix.
| Float MQUALIFIER zeus::TMatrix::getCell | ( | Int | iRow, |
| Int | iColumn, | ||
| bool * | pbError = NULL |
||
| ) | const [virtual] |
Implements zeus::IMatrix.
| const Float ** zeus::TMatrix::getCells | ( | ) | const [inline] |
Reading cell values as an array of floats.
| bool MQUALIFIER zeus::TMatrix::getColumn | ( | Int | iColumn, |
| IVector & | rVector | ||
| ) | const [virtual] |
Implements zeus::IMatrix.
| Int MQUALIFIER zeus::TMatrix::getColumnCount | ( | ) | const [inline, virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::getDiagonalVector | ( | IVector & | rDiagVector ) | const [virtual] |
Implements zeus::IMatrix.
| Float MQUALIFIER zeus::TMatrix::getEntropy | ( | ) | const [virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::getRow | ( | Int | iRow, |
| IVector & | rVector | ||
| ) | const [virtual] |
Implements zeus::IMatrix.
| Int MQUALIFIER zeus::TMatrix::getRowCount | ( | ) | const [inline, virtual] |
Implements zeus::IMatrix.
| void MQUALIFIER zeus::TMatrix::initAsIdentityMatrix | ( | ) | [virtual] |
Implements zeus::IMatrix.
| void MQUALIFIER zeus::TMatrix::initAsZeroMatrix | ( | ) | [virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::invert | ( | ) | [virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::isIdentityMatrix | ( | ) | const [virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::isInvertible | ( | ) | const [virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::isSquaredMatrix | ( | ) | const [inline, virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::isZeroMatrix | ( | ) | const [virtual] |
Implements zeus::IMatrix.
| void MQUALIFIER zeus::TMatrix::multiplyConstant | ( | Float | fConstant ) | [virtual] |
Implements zeus::IMatrix.
| bool zeus::TMatrix::operator!= | ( | const IMatrix & | rMatrix ) | const [inline] |
Equality to another matrix?
| rMatrix | [IN]: The other matrix. |
Matrix multiplication.
| rMatrix | [IN]: Matrix to be multiplied with this matrix. |
| TMatrix zeus::TMatrix::operator* | ( | const Float & | f ) | const |
Scalar multiplication.
| f | [IN]: Multiplication factor to apply to all cells. |
Vector multiplication.
| rVector | [IN]: Vector to be multiplied with this matrix. |
| const TMatrix & zeus::TMatrix::operator*= | ( | const Float & | f ) | [inline] |
Multiply this matrix by a float value, and assign the result to this matrix.
| f | [IN]: Float value. |
| TMatrix zeus::TMatrix::operator+ | ( | const Float & | f ) | const |
Adds a value to each cell
| f | [IN]: constant to apply to all cells. |
| const TMatrix & zeus::TMatrix::operator+= | ( | const Float & | f ) | [inline] |
adds a float value to this matrix .
| f | [IN]: Float value. |
| TMatrix zeus::TMatrix::operator- | ( | const Float & | f ) | const [inline] |
Subtracts a value from each cell
| f | [IN]: constant to apply to all cells. |
| const TMatrix & zeus::TMatrix::operator-= | ( | const Float & | f ) | [inline] |
subtracts a float value from this matrix .
| f | [IN]: Float value. |
| TMatrix zeus::TMatrix::operator/ | ( | const Float & | f ) | const [inline] |
Divides each component of the matrix by a float value, and returns the resulting matrix
| f | [IN]: Float value. |
| const TMatrix & zeus::TMatrix::operator/= | ( | const Float & | f ) | [inline] |
Divides each component of the matrix by a float value, and assigns the result to this matrix.
| f | [IN]: Float value. |
Assignment of interface type object.
| rMatrix | [IN]: Matrix to be assigned to this matrix. |
Assignment of matrix object.
| rMatrix | [IN]: Matrix to be assigned to this matrix. |
| bool zeus::TMatrix::operator== | ( | const IMatrix & | rMatrix ) | const [inline] |
Equality to another matrix?
| rMatrix | [IN]: The other matrix. |
| Float * zeus::TMatrix::operator[] | ( | Int | iIndex ) | [inline] |
Used to access the data array directly. Be aware that using wrong indecies might cause an access violation.
| iIndex | : Index of the data |
| bool zeus::TMatrix::pow | ( | Int | iExp, |
| TMatrix & | rMatrix | ||
| ) | const |
This is the power function of the matrix, meaning M^2 = M*M
| iExp | : exponent |
| rMatrix | : Return value of the calculated matrix |
| true | : matrix calculated |
| false | : invalid exponent ( < 0) |
| bool zeus::TMatrix::reduce | ( | Int | iRow, |
| Int | iColumn, | ||
| TMatrix & | rMatrix | ||
| ) | const |
Reduces the matrix by the selected column and row. The returned matrix is therefore by one dimension smaller
| iRow | : reducing row |
| iColumn | : reducing column |
| rMatrix | : return value |
| true | : Could reduce the matrix |
| false,: | Unable to reduce the matrix |
| void zeus::TMatrix::releaseDataArray | ( | ) | [protected] |
Releases the array
| bool MQUALIFIER zeus::TMatrix::setCell | ( | Int | iRow, |
| Int | iColumn, | ||
| const Float & | rValue | ||
| ) | [virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::setColumn | ( | Int | iColumn, |
| const IVector & | rVector | ||
| ) | [virtual] |
Implements zeus::IMatrix.
| void MQUALIFIER zeus::TMatrix::setDiagonalValue | ( | const Float & | fValue ) | [virtual] |
Implements zeus::IMatrix.
| void MQUALIFIER zeus::TMatrix::setDiagonalVector | ( | const IVector & | rDiagVector ) | [virtual] |
Implements zeus::IMatrix.
| Retval MQUALIFIER zeus::TMatrix::setDimensions | ( | Int | iRows, |
| Int | iColumns | ||
| ) | [virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::setRow | ( | Int | iRow, |
| const IVector & | rVector | ||
| ) | [virtual] |
Implements zeus::IMatrix.
| bool MQUALIFIER zeus::TMatrix::swapCells | ( | Int | iRow1, |
| Int | iColumn1, | ||
| Int | iRow2, | ||
| Int | iColumn2 | ||
| ) | [virtual] |
Implements zeus::IMatrix.
| TString zeus::TMatrix::toString | ( | ) | const |
Returns a matrix in string notation
| void MQUALIFIER zeus::TMatrix::transpose | ( | ) | [inline, virtual] |
Implements zeus::IMatrix.
Float** zeus::TMatrix::m_aafData [protected] |
Data of the matrix.
Int zeus::TMatrix::m_iColumns [protected] |
Number if columns.
Int zeus::TMatrix::m_iRows [protected] |
Number of rows.