This template class declares the array of particles and its internal data, managing some memory-related issues and providing an easy implementation of virtual methods required for implementing a CParticleFilterCapable.
By adding IMPLEMENT_PARTICLE_FILTER_CAPABLE(T) to the body of the declaration of classes inheriting from both CParticleFilterData and CParticleFilterCapable, the following pure virtual methods are automatically implemented (the param T must be equal to the argument of the template CParticleFilterData).
Since CProbabilityParticle implements all the required operators, the member "m_particles" can be safely copied with "=" or copy constructor operators and new objects will be created internally instead of copying the internal pointers, which would lead to memory corruption.
Definition at line 56 of file CParticleFilterData.h.
#include <mrpt/bayes/CParticleFilterData.h>

Public Types | |
| typedef T | CParticleDataContent |
| This is the type inside the corresponding CParticleData class. | |
| typedef CProbabilityParticle< T > | CParticleData |
| Use this to refer to each element in the m_particles array. | |
| typedef std::deque< CParticleData > | CParticleList |
| Use this type to refer to the list of particles m_particles. | |
Public Member Functions | |
| CParticleFilterData () | |
| Default constructor. | |
| void | clearParticles () |
| Free the memory of all the particles and reset the array "m_particles" to length zero. | |
| virtual | ~CParticleFilterData () |
| Virtual destructor. | |
| void | writeParticlesToStream (utils::CStream &out) const |
| Dumps the sequence of particles and their weights to a stream (requires T implementing CSerializable). | |
| void | readParticlesFromStream (utils::CStream &in) |
| Reads the sequence of particles and their weights from a stream (requires T implementing CSerializable). | |
| void | getWeights (vector_double &out_logWeights) const |
| Returns a vector with the sequence of the logaritmic weights of all the samples. | |
| const CParticleData * | getMostLikelyParticle () const |
| Returns the particle with the highest weight. | |
Public Attributes | |
| CParticleList | m_particles |
| The array of particles. | |
| typedef CProbabilityParticle<T> mrpt::bayes::CParticleFilterData< T >::CParticleData |
Use this to refer to each element in the m_particles array.
Definition at line 60 of file CParticleFilterData.h.
| typedef T mrpt::bayes::CParticleFilterData< T >::CParticleDataContent |
This is the type inside the corresponding CParticleData class.
Definition at line 59 of file CParticleFilterData.h.
| typedef std::deque<CParticleData> mrpt::bayes::CParticleFilterData< T >::CParticleList |
Use this type to refer to the list of particles m_particles.
Definition at line 61 of file CParticleFilterData.h.
| mrpt::bayes::CParticleFilterData< T >::CParticleFilterData | ( | ) | [inline] |
Default constructor.
Definition at line 66 of file CParticleFilterData.h.
| virtual mrpt::bayes::CParticleFilterData< T >::~CParticleFilterData | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 82 of file CParticleFilterData.h.
| void mrpt::bayes::CParticleFilterData< T >::clearParticles | ( | ) | [inline] |
Free the memory of all the particles and reset the array "m_particles" to length zero.
Definition at line 71 of file CParticleFilterData.h.
Referenced by mrpt::bayes::CParticleFilterData< CRBPFParticleData >::readParticlesFromStream(), and mrpt::bayes::CParticleFilterData< CRBPFParticleData >::~CParticleFilterData().
| const CParticleData* mrpt::bayes::CParticleFilterData< T >::getMostLikelyParticle | ( | ) | const [inline] |
Returns the particle with the highest weight.
Reimplemented in mrpt::poses::CPose3DPDFParticles, and mrpt::poses::CPosePDFParticles.
Definition at line 139 of file CParticleFilterData.h.
| void mrpt::bayes::CParticleFilterData< T >::getWeights | ( | vector_double & | out_logWeights ) | const [inline] |
Returns a vector with the sequence of the logaritmic weights of all the samples.
Definition at line 126 of file CParticleFilterData.h.
| void mrpt::bayes::CParticleFilterData< T >::readParticlesFromStream | ( | utils::CStream & | in ) | [inline] |
Reads the sequence of particles and their weights from a stream (requires T implementing CSerializable).
Definition at line 106 of file CParticleFilterData.h.
| void mrpt::bayes::CParticleFilterData< T >::writeParticlesToStream | ( | utils::CStream & | out ) | const [inline] |
Dumps the sequence of particles and their weights to a stream (requires T implementing CSerializable).
Definition at line 92 of file CParticleFilterData.h.
| CParticleList mrpt::bayes::CParticleFilterData< T >::m_particles |
The array of particles.
Definition at line 63 of file CParticleFilterData.h.
Referenced by mrpt::bayes::CParticleFilterData< CRBPFParticleData >::clearParticles(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getMostLikelyParticle(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getWeights(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::readParticlesFromStream(), and mrpt::bayes::CParticleFilterData< CRBPFParticleData >::writeParticlesToStream().
| Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:30:30 UTC 2011 |