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.
See also the methods in the base class CParticleFilterDataImpl<>.
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 177 of file CParticleFilterData.h.
#include <mrpt/bayes/CParticleFilterData.h>

Public Types | |
| typedef T | CParticleDataContent |
| This is the type inside the corresponding CParticleData class. More... | |
| typedef CProbabilityParticle< T > | CParticleData |
| Use this to refer to each element in the m_particles array. More... | |
| typedef std::deque< CParticleData > | CParticleList |
| Use this type to refer to the list of particles m_particles. More... | |
Public Member Functions | |
| CParticleFilterData () | |
| Default constructor. More... | |
| void | clearParticles () |
| Free the memory of all the particles and reset the array "m_particles" to length zero. More... | |
| virtual | ~CParticleFilterData () |
| Virtual destructor. More... | |
| template<class STREAM > | |
| void | writeParticlesToStream (STREAM &out) const |
| Dumps the sequence of particles and their weights to a stream (requires T implementing CSerializable). More... | |
| template<class STREAM > | |
| void | readParticlesFromStream (STREAM &in) |
| Reads the sequence of particles and their weights from a stream (requires T implementing CSerializable). More... | |
| void | getWeights (std::vector< double > &out_logWeights) const |
| Returns a vector with the sequence of the logaritmic weights of all the samples. More... | |
| const CParticleData * | getMostLikelyParticle () const |
| Returns the particle with the highest weight. More... | |
Public Attributes | |
| CParticleList | m_particles |
| The array of particles. More... | |
| typedef CProbabilityParticle<T> mrpt::bayes::CParticleFilterData< T >::CParticleData |
Use this to refer to each element in the m_particles array.
Definition at line 181 of file CParticleFilterData.h.
| typedef T mrpt::bayes::CParticleFilterData< T >::CParticleDataContent |
This is the type inside the corresponding CParticleData class.
Definition at line 180 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 182 of file CParticleFilterData.h.
|
inline |
Default constructor.
Definition at line 187 of file CParticleFilterData.h.
|
inlinevirtual |
Virtual destructor.
Definition at line 202 of file CParticleFilterData.h.
References 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 192 of file CParticleFilterData.h.
References mrpt::bayes::CParticleFilterData< T >::m_particles, MRPT_END, and MRPT_START.
Referenced by mrpt::bayes::CParticleFilterData< T >::readParticlesFromStream(), and mrpt::bayes::CParticleFilterData< T >::~CParticleFilterData().
|
inline |
Returns the particle with the highest weight.
Definition at line 259 of file CParticleFilterData.h.
References ASSERT_, mrpt::bayes::CParticleFilterData< T >::m_particles, MRPT_END, and MRPT_START.
|
inline |
Returns a vector with the sequence of the logaritmic weights of all the samples.
Definition at line 246 of file CParticleFilterData.h.
References mrpt::bayes::CParticleFilterData< T >::m_particles, MRPT_END, and MRPT_START.
|
inline |
Reads the sequence of particles and their weights from a stream (requires T implementing CSerializable).
Definition at line 226 of file CParticleFilterData.h.
References mrpt::bayes::CParticleFilterData< T >::clearParticles(), mrpt::bayes::CParticleFilterData< T >::m_particles, MRPT_END, and MRPT_START.
|
inline |
Dumps the sequence of particles and their weights to a stream (requires T implementing CSerializable).
Definition at line 211 of file CParticleFilterData.h.
References mrpt::bayes::CParticleFilterData< T >::m_particles, MRPT_END, and MRPT_START.
| CParticleList mrpt::bayes::CParticleFilterData< T >::m_particles |
The array of particles.
Definition at line 184 of file CParticleFilterData.h.
Referenced by mrpt::bayes::CParticleFilterData< T >::clearParticles(), mrpt::bayes::CParticleFilterData< T >::getMostLikelyParticle(), mrpt::bayes::CParticleFilterData< T >::getWeights(), mrpt::bayes::CParticleFilterData< T >::readParticlesFromStream(), and mrpt::bayes::CParticleFilterData< T >::writeParticlesToStream().
| Page generated by Doxygen 1.9.1 for MRPT 1.4.0 SVN: at Fri Sep 3 01:11:30 UTC 2021 |