Main MRPT website > C++ reference for MRPT 1.5.6
List of all members | Public Types | Public Member Functions | Static Public Attributes
mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN > Class Template Referenceabstract

Detailed Description

template<class TDATA, size_t STATE_LEN>
class mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >

A generic template for probability density distributions (PDFs).

This template is used as base for many classes in mrpt::poses Any derived class must implement getMean() and a getCovarianceAndMean(). Other methods such as getMean() or getCovariance() are implemented here for convenience.

See Also
mprt::poses::CPosePDF, mprt::poses::CPose3DPDF, mprt::poses::CPointPDF

Definition at line 28 of file CProbabilityDensityFunction.h.

#include <mrpt/utils/CProbabilityDensityFunction.h>

Inheritance diagram for mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >:
Inheritance graph

Public Types

typedef TDATA type_value
 The type of the state the PDF represents. More...
 
typedef
CProbabilityDensityFunction
< TDATA, STATE_LEN > 
self_t
 

Public Member Functions

virtual void getMean (TDATA &mean_point) const =0
 Returns the mean, or mathematical expectation of the probability density distribution (PDF). More...
 
virtual void getCovarianceAndMean (mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov, TDATA &mean_point) const =0
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once. More...
 
void getCovarianceDynAndMean (mrpt::math::CMatrixDouble &cov, TDATA &mean_point) const
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once. More...
 
TDATA getMeanVal () const
 Returns the mean, or mathematical expectation of the probability density distribution (PDF). More...
 
void getCovariance (mrpt::math::CMatrixDouble &cov) const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) More...
 
void getCovariance (mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov) const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) More...
 
mrpt::math::CMatrixFixedNumeric
< double, STATE_LEN, STATE_LEN > 
getCovariance () const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) More...
 
virtual bool isInfType () const
 Returns whether the class instance holds the uncertainty in covariance or information form. More...
 
virtual void getInformationMatrix (mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &inf) const
 Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix) Unless reimplemented in derived classes, this method first reads the covariance, then invert it. More...
 
virtual void saveToTextFile (const std::string &file) const =0
 Save PDF's particles to a text file. More...
 
virtual void drawSingleSample (TDATA &outPart) const =0
 Draws a single sample from the distribution. More...
 
virtual void drawManySamples (size_t N, std::vector< mrpt::math::CVectorDouble > &outSamples) const
 Draws a number of samples from the distribution, and saves as a list of 1xSTATE_LEN vectors, where each row contains a (x,y,z,yaw,pitch,roll) datum. More...
 
virtual void changeCoordinatesReference (const mrpt::poses::CPose3D &newReferenceBase)=0
 this = p (+) this. More...
 
double getCovarianceEntropy () const
 Compute the entropy of the estimated covariance matrix. More...
 

Static Public Attributes

static const size_t state_length = STATE_LEN
 The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll). More...
 

Member Typedef Documentation

template<class TDATA, size_t STATE_LEN>
typedef CProbabilityDensityFunction<TDATA, STATE_LEN> mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::self_t

Definition at line 33 of file CProbabilityDensityFunction.h.

template<class TDATA, size_t STATE_LEN>
typedef TDATA mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::type_value

The type of the state the PDF represents.

Definition at line 32 of file CProbabilityDensityFunction.h.

Member Function Documentation

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::changeCoordinatesReference ( const mrpt::poses::CPose3D newReferenceBase)
pure virtual
template<class TDATA, size_t STATE_LEN>
virtual void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::drawManySamples ( size_t  N,
std::vector< mrpt::math::CVectorDouble > &  outSamples 
) const
inlinevirtual

Draws a number of samples from the distribution, and saves as a list of 1xSTATE_LEN vectors, where each row contains a (x,y,z,yaw,pitch,roll) datum.

This base method just call N times to drawSingleSample, but derived classes should implemented optimized method for each particular PDF.

Reimplemented in mrpt::poses::CPosePDFSOG, mrpt::poses::CPose3DPDFGaussian, mrpt::poses::CPosePDFGaussian, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPose3DPDFSOG, mrpt::poses::CPose3DPDFGaussianInf, mrpt::poses::CPose3DQuatPDFGaussianInf, mrpt::poses::CPose3DQuatPDFGaussian, mrpt::poses::CPose3DPDFParticles, and mrpt::poses::CPosePDFGrid.

Definition at line 125 of file CProbabilityDensityFunction.h.

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::drawSingleSample ( TDATA &  outPart) const
pure virtual

Draws a single sample from the distribution.

Referenced by mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >::drawManySamples().

template<class TDATA, size_t STATE_LEN>
void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovariance ( mrpt::math::CMatrixDouble cov) const
inline
template<class TDATA, size_t STATE_LEN>
void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovariance ( mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  cov) const
inline

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See Also
getMean, getCovarianceAndMean, getInformationMatrix

Definition at line 77 of file CProbabilityDensityFunction.h.

template<class TDATA, size_t STATE_LEN>
mrpt::math::CMatrixFixedNumeric<double,STATE_LEN,STATE_LEN> mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovariance ( ) const
inline

Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)

See Also
getMean, getInformationMatrix

Definition at line 86 of file CProbabilityDensityFunction.h.

Referenced by mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >::getCovarianceEntropy().

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovarianceAndMean ( mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  cov,
TDATA &  mean_point 
) const
pure virtual
template<class TDATA, size_t STATE_LEN>
void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovarianceDynAndMean ( mrpt::math::CMatrixDouble cov,
TDATA &  mean_point 
) const
inline

Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once.

See Also
getMean, getInformationMatrix

Definition at line 48 of file CProbabilityDensityFunction.h.

Referenced by mrpt::utils::CProbabilityDensityFunction< CPose2D, 3 >::getCovariance().

template<class TDATA, size_t STATE_LEN>
double mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovarianceEntropy ( ) const
inline

Compute the entropy of the estimated covariance matrix.

See Also
http://en.wikipedia.org/wiki/Multivariate_normal_distribution#Entropy

Definition at line 144 of file CProbabilityDensityFunction.h.

Referenced by mrpt::maps::CMultiMetricMapPDF::getCurrentEntropyOfPaths().

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::getInformationMatrix ( mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &  inf) const
inlinevirtual

Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix) Unless reimplemented in derived classes, this method first reads the covariance, then invert it.

See Also
getMean, getCovarianceAndMean

Definition at line 106 of file CProbabilityDensityFunction.h.

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::getMean ( TDATA &  mean_point) const
pure virtual
template<class TDATA, size_t STATE_LEN>
TDATA mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::getMeanVal ( ) const
inline
template<class TDATA, size_t STATE_LEN>
virtual bool mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::isInfType ( ) const
inlinevirtual

Returns whether the class instance holds the uncertainty in covariance or information form.

Note
By default this is going to be covariance form. *Inf classes (e.g. CPosePDFGaussianInf) store it in information form.
See Also
mrpt::traits::is_inf_type

Reimplemented in mrpt::poses::CPose3DPDFGaussianInf, mrpt::poses::CPosePDFGaussianInf, and mrpt::poses::CPose3DQuatPDFGaussianInf.

Definition at line 100 of file CProbabilityDensityFunction.h.

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::saveToTextFile ( const std::string file) const
pure virtual

Member Data Documentation

template<class TDATA, size_t STATE_LEN>
const size_t mrpt::utils::CProbabilityDensityFunction< TDATA, STATE_LEN >::state_length = STATE_LEN
static

The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll).

Definition at line 31 of file CProbabilityDensityFunction.h.




Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018