MRPT logo

mrpt::bayes::CParticleFilterData< T > Class Template Reference

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. More...

#include <mrpt/bayes/CParticleFilterData.h>

List of all members.

Public Types

typedef CProbabilityParticle< T > CParticleData
 Use this to refer to each element in the m_particles array.
typedef std::deque< CParticleDataCParticleList
 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 CParticleDatagetMostLikelyParticle () const
 Returns the particle with the highest weight.

Public Attributes

CParticleList m_particles
 The array of particles.


Detailed Description

template<class T>
class mrpt::bayes::CParticleFilterData< T >

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.

See also:
CParticleFilter, CParticleFilterCapable, IMPLEMENT_PARTICLE_FILTER_CAPABLE

Definition at line 56 of file CParticleFilterData.h.


Member Typedef Documentation

Use this to refer to each element in the m_particles array.

Definition at line 61 of file CParticleFilterData.h.

template<class T>
typedef std::deque<CParticleData> mrpt::bayes::CParticleFilterData< T >::CParticleList

Use this type to refer to the list of particles m_particles.

Definition at line 65 of file CParticleFilterData.h.


Constructor & Destructor Documentation

template<class T>
mrpt::bayes::CParticleFilterData< T >::CParticleFilterData (  )  [inline]

Default constructor.

Definition at line 72 of file CParticleFilterData.h.

template<class T>
virtual mrpt::bayes::CParticleFilterData< T >::~CParticleFilterData (  )  [inline, virtual]

Virtual destructor.

Definition at line 89 of file CParticleFilterData.h.


Member Function Documentation

template<class T>
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 77 of file CParticleFilterData.h.

Referenced by mrpt::bayes::CParticleFilterData< CRBPFParticleData >::readParticlesFromStream(), and mrpt::bayes::CParticleFilterData< CRBPFParticleData >::~CParticleFilterData().

template<class T>
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 146 of file CParticleFilterData.h.

template<class T>
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 133 of file CParticleFilterData.h.

template<class T>
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).

See also:
writeParticlesToStream

Definition at line 113 of file CParticleFilterData.h.

template<class T>
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).

See also:
readParticlesFromStream

Definition at line 99 of file CParticleFilterData.h.


Member Data Documentation




Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:07:47 EST 2009