MRPT  2.0.0
List of all members | Public Types | Public Member Functions | Static Public Attributes
mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN > Class Template Referenceabstract

Detailed Description

template<class TDATA, size_t STATE_LEN>
class mrpt::math::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 27 of file CProbabilityDensityFunction.h.

#include <mrpt/math/CProbabilityDensityFunction.h>

Inheritance diagram for mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >:

Public Types

using type_value = TDATA
 The type of the state the PDF represents. More...
 
using self_t = CProbabilityDensityFunction< TDATA, STATE_LEN >
 
using cov_mat_t = mrpt::math::CMatrixFixed< double, STATE_LEN, STATE_LEN >
 Covariance matrix type. More...
 
using inf_mat_t = cov_mat_t
 Information matrix type. More...
 

Public Member Functions

virtual void getMean (type_value &mean_point) const =0
 Returns the mean, or mathematical expectation of the probability density distribution (PDF). More...
 
virtual std::tuple< cov_mat_t, type_valuegetCovarianceAndMean () const =0
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once. More...
 
virtual void getCovarianceAndMean (cov_mat_t &c, TDATA &mean) const final
 
void getCovarianceDynAndMean (mrpt::math::CMatrixDouble &cov, type_value &mean_point) const
 Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean, both at once. More...
 
type_value 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 (cov_mat_t &cov) const
 Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) More...
 
cov_mat_t 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 (inf_mat_t &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 bool 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...
 
double getCovarianceEntropy () const
 Compute the entropy of the estimated covariance matrix. More...
 

Static Public Attributes

static constexpr 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

◆ cov_mat_t

template<class TDATA, size_t STATE_LEN>
using mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::cov_mat_t = mrpt::math::CMatrixFixed<double, STATE_LEN, STATE_LEN>

Covariance matrix type.

Definition at line 37 of file CProbabilityDensityFunction.h.

◆ inf_mat_t

template<class TDATA, size_t STATE_LEN>
using mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::inf_mat_t = cov_mat_t

Information matrix type.

Definition at line 39 of file CProbabilityDensityFunction.h.

◆ self_t

template<class TDATA, size_t STATE_LEN>
using mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::self_t = CProbabilityDensityFunction<TDATA, STATE_LEN>

Definition at line 35 of file CProbabilityDensityFunction.h.

◆ type_value

template<class TDATA, size_t STATE_LEN>
using mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::type_value = TDATA

The type of the state the PDF represents.

Definition at line 34 of file CProbabilityDensityFunction.h.

Member Function Documentation

◆ drawManySamples()

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::math::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::CPosePDFGaussianInf, mrpt::poses::CPose3DPDFGaussian, mrpt::poses::CPose3DPDFSOG, mrpt::poses::CPosePDFGaussian, mrpt::poses::CPose3DPDFGaussianInf, mrpt::poses::CPose3DQuatPDFGaussian, mrpt::poses::CPose3DQuatPDFGaussianInf, mrpt::poses::CPose3DPDFParticles, mrpt::poses::CPose3DPDFGrid, and mrpt::poses::CPosePDFGrid.

Definition at line 151 of file CProbabilityDensityFunction.h.

◆ drawSingleSample()

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

Draws a single sample from the distribution.

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

Here is the caller graph for this function:

◆ getCovariance() [1/3]

template<class TDATA, size_t STATE_LEN>
void mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovariance ( mrpt::math::CMatrixDouble 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 88 of file CProbabilityDensityFunction.h.

Referenced by mrpt::poses::CPosePDFGaussian::copyFrom(), mrpt::poses::CPosePDFGaussianInf::copyFrom(), mrpt::poses::CPosePDFSOG::copyFrom(), and mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal().

Here is the caller graph for this function:

◆ getCovariance() [2/3]

template<class TDATA, size_t STATE_LEN>
void mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovariance ( cov_mat_t 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 98 of file CProbabilityDensityFunction.h.

◆ getCovariance() [3/3]

template<class TDATA, size_t STATE_LEN>
cov_mat_t mrpt::math::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 108 of file CProbabilityDensityFunction.h.

Referenced by mrpt::math::CProbabilityDensityFunction< CPose2D, 3 >::getCovarianceEntropy(), and mrpt::math::CProbabilityDensityFunction< CPose2D, 3 >::getInformationMatrix().

Here is the caller graph for this function:

◆ getCovarianceAndMean() [1/2]

template<class TDATA, size_t STATE_LEN>
virtual std::tuple<cov_mat_t, type_value> mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovarianceAndMean ( ) const
pure virtual

◆ getCovarianceAndMean() [2/2]

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovarianceAndMean ( cov_mat_t c,
TDATA &  mean 
) const
inlinefinalvirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 54 of file CProbabilityDensityFunction.h.

◆ getCovarianceDynAndMean()

template<class TDATA, size_t STATE_LEN>
void mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::getCovarianceDynAndMean ( mrpt::math::CMatrixDouble cov,
type_value 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 65 of file CProbabilityDensityFunction.h.

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

Here is the caller graph for this function:

◆ getCovarianceEntropy()

template<class TDATA, size_t STATE_LEN>
double mrpt::math::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 167 of file CProbabilityDensityFunction.h.

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

Here is the caller graph for this function:

◆ getInformationMatrix()

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::getInformationMatrix ( inf_mat_t 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 130 of file CProbabilityDensityFunction.h.

◆ getMean()

template<class TDATA, size_t STATE_LEN>
virtual void mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::getMean ( type_value mean_point) const
pure virtual

Returns the mean, or mathematical expectation of the probability density distribution (PDF).

See also
getCovarianceAndMean, getInformationMatrix

Referenced by mrpt::poses::CPosePDFGaussian::copyFrom(), mrpt::poses::CPosePDFGaussianInf::copyFrom(), mrpt::poses::CPosePDFSOG::copyFrom(), and mrpt::math::CProbabilityDensityFunction< CPose2D, 3 >::getMeanVal().

Here is the caller graph for this function:

◆ getMeanVal()

template<class TDATA, size_t STATE_LEN>
type_value mrpt::math::CProbabilityDensityFunction< TDATA, STATE_LEN >::getMeanVal ( ) const
inline

Returns the mean, or mathematical expectation of the probability density distribution (PDF).

See also
getCovariance, getInformationMatrix

Definition at line 77 of file CProbabilityDensityFunction.h.

Referenced by mrpt::poses::CPosePDFGaussian::copyFrom(), mrpt::poses::CPosePDFGaussianInf::copyFrom(), mrpt::slam::CMetricMapBuilderICP::initialize(), mrpt::slam::CMetricMapBuilderRBPF::initialize(), mrpt::slam::CMetricMapBuilderICP::processObservation(), and TEST().

Here is the caller graph for this function:

◆ isInfType()

template<class TDATA, size_t STATE_LEN>
virtual bool mrpt::math::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 123 of file CProbabilityDensityFunction.h.

◆ saveToTextFile()

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

Member Data Documentation

◆ state_length

template<class TDATA, size_t STATE_LEN>
constexpr size_t mrpt::math::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 32 of file CProbabilityDensityFunction.h.




Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020