This template class extends the class "CMatrixTemplate" for storing "objects" at each matrix entry.
This class allows a very efficient representation of sparse matrixes where each cell is an arbitrary C++ class, but its use must carefully observe the following rules:
#include <mrpt/math/CMatrixTemplateObjects.h>

Public Member Functions | |
| CMatrixTemplateObjects (const CMatrixTemplate< T > &m) | |
| Copy constructor. | |
| CMatrixTemplateObjects (size_t row=3, size_t col=3) | |
| Constructor. | |
| virtual void | setSize (size_t row, size_t col) |
| Changes the size of matrix. | |
| virtual | ~CMatrixTemplateObjects () |
| Destructor. | |
| void | freeAllObjects () |
| Delete all the objects in the matrix and set all entries to NULL pointers. | |
| CMatrixTemplateObjects & | operator= (const CMatrixTemplateObjects &m) |
| Assignment operator. | |
| void | setDestroyBehavior (bool freeObjects=true) |
| Sets the behavior on matrix destroy. | |
| void | allocAllObjects () |
| Alloc memory for all the non-NULL entries in the matrix. | |
Private Attributes | |
| bool | m_freeObjects |
| mrpt::math::CMatrixTemplateObjects::CMatrixTemplateObjects | ( | const CMatrixTemplate< T > & | m | ) | [inline] |
Copy constructor.
Definition at line 59 of file CMatrixTemplateObjects.h.
| mrpt::math::CMatrixTemplateObjects::CMatrixTemplateObjects | ( | size_t | row = 3, |
| size_t | col = 3 |
||
| ) | [inline] |
Constructor.
Definition at line 65 of file CMatrixTemplateObjects.h.
References getRowCount(), and getColCount().
| virtual mrpt::math::CMatrixTemplateObjects::~CMatrixTemplateObjects | ( | ) | [inline, virtual] |
Destructor.
Definition at line 82 of file CMatrixTemplateObjects.h.
References m_freeObjects, and freeAllObjects().
| void mrpt::math::CMatrixTemplateObjects::allocAllObjects | ( | ) | [inline] |
Alloc memory for all the non-NULL entries in the matrix.
See the general description of the class on the top.
Definition at line 124 of file CMatrixTemplateObjects.h.
References getRowCount(), and getColCount().
| void mrpt::math::CMatrixTemplateObjects::freeAllObjects | ( | ) | [inline] |
Delete all the objects in the matrix and set all entries to NULL pointers.
Definition at line 90 of file CMatrixTemplateObjects.h.
References getRowCount(), and getColCount().
Referenced by ~CMatrixTemplateObjects().
| CMatrixTemplateObjects& mrpt::math::CMatrixTemplateObjects::operator= | ( | const CMatrixTemplateObjects & | m | ) | [inline] |
Assignment operator.
Definition at line 103 of file CMatrixTemplateObjects.h.
References mrpt::math::CMatrixTemplate< T * >::realloc(), getRowCount(), and getColCount().
| void mrpt::math::CMatrixTemplateObjects::setDestroyBehavior | ( | bool | freeObjects = true | ) | [inline] |
Sets the behavior on matrix destroy.
See the general description of the class on the top.
Definition at line 116 of file CMatrixTemplateObjects.h.
References m_freeObjects.
| virtual void mrpt::math::CMatrixTemplateObjects::setSize | ( | size_t | row, |
| size_t | col | ||
| ) | [inline, virtual] |
Changes the size of matrix.
Definition at line 74 of file CMatrixTemplateObjects.h.
References mrpt::math::CMatrixTemplate< T * >::realloc().
bool mrpt::math::CMatrixTemplateObjects::m_freeObjects [private] |
Definition at line 54 of file CMatrixTemplateObjects.h.
Referenced by ~CMatrixTemplateObjects(), and setDestroyBehavior().
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Sun Oct 16 12:16:33 UTC 2011 |