Go to the documentation of this file.
26 template <
class TDATA,
size_t STATE_LEN>
152 size_t N, std::vector<mrpt::math::CVectorDouble>& outSamples)
const
154 outSamples.resize(N);
156 for (
size_t i = 0; i < N; i++)
169 static const double ln_2PI = 1.8378770664093454835606594728112;
170 return 0.5 * (STATE_LEN + STATE_LEN * ln_2PI +
173 std::numeric_limits<double>::epsilon())));
CMatrixDouble cov(const MATRIX &v)
Computes the covariance matrix from a list of samples in an NxM matrix, where each row is a sample,...
static constexpr 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 std::tuple< cov_mat_t, type_value > getCovarianceAndMean() const =0
Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean,...
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,...
double mean(const CONTAINER &v)
Computes the mean value of a vector.
A generic template for probability density distributions (PDFs).
virtual bool saveToTextFile(const std::string &file) const =0
Save PDF's particles to a text file.
virtual void getInformationMatrix(inf_mat_t &inf) const
Returns the information (inverse covariance) matrix (a STATE_LEN x STATE_LEN matrix) Unless reimpleme...
Derived inverse_LLt() const
Returns the inverse of a symmetric matrix using LLt.
A compile-time fixed-size numeric matrix container.
virtual bool isInfType() const
Returns whether the class instance holds the uncertainty in covariance or information form.
virtual void getCovarianceAndMean(cov_mat_t &c, TDATA &mean) const final
This is an overloaded member function, provided for convenience. It differs from the above function o...
void getCovariance(cov_mat_t &cov) const
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
cov_mat_t getCovariance() const
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
mrpt::math::CMatrixFixed< double, STATE_LEN, STATE_LEN > cov_mat_t
Covariance matrix type.
type_value getMeanVal() const
Returns the mean, or mathematical expectation of the probability density distribution (PDF).
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,...
virtual void getMean(type_value &mean_point) const =0
Returns the mean, or mathematical expectation of the probability density distribution (PDF).
double getCovarianceEntropy() const
Compute the entropy of the estimated covariance matrix.
This base provides a set of functions for maths stuff.
void getCovariance(mrpt::math::CMatrixDouble &cov) const
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix)
CVectorDynamic< double > CVectorDouble
CPose2D type_value
The type of the state the PDF represents.
virtual void drawSingleSample(TDATA &outPart) const =0
Draws a single sample from the distribution.
Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020 | |