9 #ifndef CProbabilityDensityFunction_H 10 #define CProbabilityDensityFunction_H 27 template <
class TDATA,
size_t STATE_LEN>
38 virtual void getMean(TDATA &mean_point)
const = 0;
125 virtual void drawManySamples(
size_t N, std::vector<mrpt::math::CVectorDouble> & outSamples )
const 127 outSamples.resize(N);
129 for (
size_t i=0;i<N;i++)
132 pnt.getAsVector(outSamples[i]);
146 static const double ln_2PI= 1.8378770664093454835606594728112;
147 return 0.5*( STATE_LEN + STATE_LEN * ln_2PI + log( std::max(
getCovariance().
det(), std::numeric_limits<double>::epsilon() ) ) );
EIGEN_STRONG_INLINE Scalar det() const
virtual void drawSingleSample(TDATA &outPart) const =0
Draws a single sample from the distribution.
double getCovarianceEntropy() const
Compute the entropy of the estimated covariance matrix.
TDATA getMeanVal() const
Returns the mean, or mathematical expectation of the probability density distribution (PDF)...
void getCovariance(mrpt::math::CMatrixDouble &cov) const
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) ...
A numeric matrix of compile-time fixed size.
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...
Eigen::Matrix< typename MATRIX::Scalar, MATRIX::ColsAtCompileTime, MATRIX::ColsAtCompileTime > cov(const MATRIX &v)
Computes the covariance matrix from a list of samples in an NxM matrix, where each row is a sample...
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 reimpleme...
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...
virtual void changeCoordinatesReference(const mrpt::poses::CPose3D &newReferenceBase)=0
this = p (+) this.
virtual void getMean(TDATA &mean_point) const =0
Returns the mean, or mathematical expectation of the probability density distribution (PDF)...
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > getCovariance() const
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) ...
TDATA type_value
The type of the state the PDF represents.
CProbabilityDensityFunction< TDATA, STATE_LEN > self_t
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
virtual bool isInfType() const
Returns whether the class instance holds the uncertainty in covariance or information form...
virtual void saveToTextFile(const std::string &file) const =0
Save PDF's particles to a text file.
static const size_t state_length
The length of the variable, for example, 3 for a 3D point, 6 for a 3D pose (x y z yaw pitch roll)...
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...
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) ...
A generic template for probability density distributions (PDFs).