This base provides a set of functions for maths stuff.
mrpt_math_grp
Namespaces | |
detail | |
Classes | |
class | CArrayNumeric |
CArrayNumeric is an array for numeric types supporting several mathematical operations (actually, just a wrapper on Eigen::Matrix<T,N,1>) More... | |
class | CAtan2LookUpTable |
A look-up-table (LUT) of atan values for any (x,y) value in a square/rectangular grid of predefined resolution. More... | |
class | CAtan2LookUpTableMultiRes |
Like CAtan2LookUpTable but with a multiresolution grid for increasingly better accuracy in points nearer to the origin. More... | |
class | CBinaryRelation |
This class models a binary relation through the elements of any given set. More... | |
class | CConstMatrixColumnAccessor |
A vector-like wrapper for a const Matrix for accessing the elements of a given column with a [] operator. More... | |
class | CConstMatrixColumnAccessorExtended |
A vector-like wrapper for a const Matrix for accessing the elements of a given column with a [] operator, with offset and custom spacing. More... | |
class | CConstMatrixRowAccessor |
A vector-like wrapper for a const Matrix for accessing the elements of a given row with a [] operator. More... | |
class | CConstMatrixRowAccessorExtended |
A vector-like wrapper for a const Matrix for accessing the elements of a given row with a [] operator, with offset and custom spacing. More... | |
struct | CExceptionNotDefPos |
Used in mrpt::math::CSparseMatrix. More... | |
class | CHistogram |
This class provides an easy way of computing histograms for unidimensional real valued variables. More... | |
class | CLevenbergMarquardtTempl |
An implementation of the Levenberg-Marquardt algorithm for least-square minimization. More... | |
class | CMatrix |
This class is a "CSerializable" wrapper for "CMatrixFloat". More... | |
class | CMatrixB |
This class is a "CSerializable" wrapper for "CMatrixBool". More... | |
class | CMatrixBool |
Declares a matrix of booleans (non serializable). More... | |
class | CMatrixColumnAccessor |
A vector-like wrapper for a Matrix for accessing the elements of a given column with a [] operator. More... | |
class | CMatrixColumnAccessorExtended |
A vector-like wrapper for a Matrix for accessing the elements of a given column with a [] operator, with offset and custom spacing. More... | |
class | CMatrixD |
This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric<double>". More... | |
class | CMatrixFixedNumeric |
A numeric matrix of compile-time fixed size. More... | |
class | CMatrixRowAccessor |
A vector-like wrapper for a Matrix for accessing the elements of a given row with a [] operator. More... | |
class | CMatrixRowAccessorExtended |
A vector-like wrapper for a Matrix for accessing the elements of a given row with a [] operator, with offset and custom spacing. More... | |
class | CMatrixTemplate |
This template class provides the basic functionality for a general 2D any-size, resizable container of numerical or non-numerical elements. More... | |
class | CMatrixTemplateNumeric |
A matrix of dynamic size. More... | |
class | CMatrixTemplateObjects |
This template class extends the class "CMatrixTemplate" for storing "objects" at each matrix entry. More... | |
struct | CMatrixTemplateSize |
Auxiliary class used in CMatrixTemplate:size(), CMatrixTemplate::resize(), CMatrixFixedNumeric::size(), CMatrixFixedNumeric::resize(), to mimic the behavior of STL-containers. More... | |
class | CMonteCarlo |
Montecarlo simulation for experiments in 1D. More... | |
struct | ContainerType |
ContainerType<T>::element_t exposes the value of any STL or Eigen container. More... | |
struct | ContainerType< Eigen::EigenBase< Derived > > |
Specialization for Eigen containers. More... | |
class | CPolygon |
A wrapper of a TPolygon2D class, implementing CSerializable. More... | |
class | CProbabilityDensityFunction |
A generic template for probability density distributions (PDFs). More... | |
class | CQuaternion |
A quaternion, which can represent a 3D rotation as pair , with a real part "r" and a 3D vector , or alternatively, q = r + ix + jy + kz. More... | |
class | CSparseMatrix |
A sparse matrix structure, wrapping T. More... | |
class | CSparseMatrixTemplate |
A sparse matrix container (with cells of any type), with iterators. More... | |
class | CSparseSymmetricalMatrix |
A sparse matrix container for square symmetrical content around the main diagonal. More... | |
class | CSplineInterpolator1D |
A (persistent) sequence of (x,y) coordinates, allowing queries of intermediate points through spline interpolation, where possible. More... | |
class | dynamic_vector |
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction. More... | |
class | FAddPoint |
class | KDTreeCapable |
A generic adaptor class for providing Nearest Neighbor (NN) lookup via the nanoflann library. More... | |
struct | LowPassFilter_IIR1 |
1-order low-pass IIR filter. More... | |
struct | MatrixBlockSparseCols |
A templated column-indexed efficient storage of block-sparse Jacobian or Hessian matrices, together with other arbitrary information. More... | |
class | ModelSearch |
Model search implementations: RANSAC and genetic algorithm. More... | |
class | RANSAC_Template |
A generic RANSAC implementation with models as matrices. More... | |
struct | RobustKernel |
struct | RobustKernel< rkLeastSquares, T > |
No robust kernel, use standard least squares: rho(r) = r^2. More... | |
struct | RobustKernel< rkPseudoHuber, T > |
Pseudo-huber robust kernel: rho(r) = 2 * delta^2 * ( -1+sqrt( 1+ r^2/delta^2 ) ) More... | |
struct | TLine2D |
2D line without bounds, represented by its equation . More... | |
struct | TLine3D |
3D line, represented by a base point and a director vector. More... | |
struct | TObject2D |
Standard type for storing any lightweight 2D type. More... | |
struct | TObject3D |
Standard object for storing any 3D lightweight object. More... | |
struct | TPlane |
3D Plane, represented by its equation More... | |
struct | TPoint2D |
Lightweight 2D point. More... | |
struct | TPoint3D |
Lightweight 3D point. More... | |
struct | TPoint3Df |
Lightweight 3D point (float version). More... | |
struct | TPointXYZfIu8 |
XYZ point (float) + Intensity(u8) More... | |
struct | TPointXYZfRGBu8 |
XYZ point (float) + RGB(u8) More... | |
struct | TPointXYZIu8 |
XYZ point (double) + Intensity(u8) More... | |
struct | TPointXYZRGBu8 |
XYZ point (double) + RGB(u8) More... | |
class | TPolygon2D |
2D polygon, inheriting from std::vector<TPoint2D>. More... | |
class | TPolygon3D |
3D polygon, inheriting from std::vector<TPoint3D> More... | |
class | TPolygonWithPlane |
Slightly heavyweight type to speed-up calculations with polygons in 3D. More... | |
struct | TPose2D |
Lightweight 2D pose. More... | |
struct | TPose3D |
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates). More... | |
struct | TPose3DQuat |
Lightweight 3D pose (three spatial coordinates, plus a quaternion ). More... | |
struct | TPoseOrPoint |
Base type of all TPoseXX and TPointXX classes in mrpt::math. More... | |
struct | TSegment2D |
2D segment, consisting of two points. More... | |
struct | TSegment3D |
3D segment, consisting of two points. More... | |
struct | TTwist2D |
2D twist: 2D velocity vector (vx,vy) + planar angular velocity (omega) More... | |
struct | TTwist3D |
3D twist: 3D velocity vector (vx,vy,vz) + angular velocity (wx,wy,wz) More... | |
Typedefs | |
template<std::size_t N> | |
using | CArrayFloat = CArrayNumeric< float, N > |
A partial specialization of CArrayNumeric for float numbers. More... | |
template<std::size_t N> | |
using | CArrayDouble = CArrayNumeric< double, N > |
A partial specialization of CArrayNumeric for double numbers. More... | |
template<std::size_t N> | |
using | CArrayInt = CArrayNumeric< int, N > |
A partial specialization of CArrayNumeric for int numbers. More... | |
template<std::size_t N> | |
using | CArrayUInt = CArrayNumeric< unsigned int, N > |
A partial specialization of CArrayNumeric for unsigned int numbers. More... | |
using | CLevenbergMarquardt = CLevenbergMarquardtTempl< mrpt::math::CVectorDouble > |
The default name for the LM class is an instantiation for "double". More... | |
using | CMatrixFloat = CMatrixTemplateNumeric< float > |
Declares a matrix of float numbers (non serializable). More... | |
using | CMatrixDouble = CMatrixTemplateNumeric< double > |
Declares a matrix of double numbers (non serializable). More... | |
using | CMatrixUInt = CMatrixTemplateNumeric< unsigned int > |
Declares a matrix of unsigned ints (non serializable). More... | |
using | CMatrixLongDouble = CMatrixTemplateNumeric< double > |
Declares a matrix of "long doubles" (non serializable), or of "doubles" if the compiler does not support "long double". More... | |
using | CQuaternionDouble = CQuaternion< double > |
A quaternion of data type "double". More... | |
using | CQuaternionFloat = CQuaternion< float > |
A quaternion of data type "float". More... | |
using | CVectorFloat = dynamic_vector< float > |
Column vector, like Eigen::MatrixXf, but automatically initialized to zeros since construction. More... | |
using | CVectorDouble = dynamic_vector< double > |
Column vector, like Eigen::MatrixXd, but automatically initialized to zeros since construction. More... | |
using | TPlane3D = TPlane |
using | RANSAC = RANSAC_Template< double > |
The default instance of RANSAC, for double type. More... | |
using | FFT_TYPE = float |
Copyright(C) 1997 Takuya OOURA (email: ooura). @mmm .t.u- toky o.ac. jpMore... | |
Enumerations | |
enum | TConstructorFlags_Quaternions { UNINITIALIZED_QUATERNION = 0 } |
enum | TMatrixTextFileFormat { MATRIX_FORMAT_ENG = 0, MATRIX_FORMAT_FIXED = 1, MATRIX_FORMAT_INT = 2 } |
enum | TConstructorFlags_Matrices { UNINITIALIZED_MATRIX = 0 } |
For usage in one of the constructors of CMatrixFixedNumeric or CMatrixTemplate (and derived classes), if it's not required to fill it with zeros at the constructor to save time. More... | |
enum | TRobustKernelType { rkLeastSquares = 0, rkPseudoHuber } |
The different types of kernels for usage within a robustified least-squares estimator. More... | |
Functions | |
template<class MATRIXLIKE > | |
size_t | size (const MATRIXLIKE &m, const int dim) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, CMatrix::Ptr &pObj) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, CMatrixD::Ptr &pObj) |
double | normalPDF (double x, double mu, double std) |
Evaluates the univariate normal (Gaussian) distribution at a given point "x". More... | |
template<class VECTORLIKE1 , class VECTORLIKE2 , class MATRIXLIKE > | |
MATRIXLIKE::Scalar | normalPDFInf (const VECTORLIKE1 &x, const VECTORLIKE2 &mu, const MATRIXLIKE &cov_inv, const bool scaled_pdf=false) |
Evaluates the multivariate normal (Gaussian) distribution at a given point "x". More... | |
template<class VECTORLIKE1 , class VECTORLIKE2 , class MATRIXLIKE > | |
MATRIXLIKE::Scalar | normalPDF (const VECTORLIKE1 &x, const VECTORLIKE2 &mu, const MATRIXLIKE &cov, const bool scaled_pdf=false) |
Evaluates the multivariate normal (Gaussian) distribution at a given point "x". More... | |
template<typename VECTORLIKE , typename MATRIXLIKE > | |
MATRIXLIKE::Scalar | normalPDF (const VECTORLIKE &d, const MATRIXLIKE &cov) |
Evaluates the multivariate normal (Gaussian) distribution at a given point given its distance vector "d" from the Gaussian mean. More... | |
template<typename VECTORLIKE1 , typename MATRIXLIKE1 , typename VECTORLIKE2 , typename MATRIXLIKE2 > | |
double | KLD_Gaussians (const VECTORLIKE1 &mu0, const MATRIXLIKE1 &cov0, const VECTORLIKE2 &mu1, const MATRIXLIKE2 &cov1) |
Kullback-Leibler divergence (KLD) between two independent multivariate Gaussians. More... | |
double | normalQuantile (double p) |
Evaluates the Gaussian distribution quantile for the probability value p=[0,1]. More... | |
double | normalCDF (double p) |
Evaluates the Gaussian cumulative density function. More... | |
double | chi2inv (double P, unsigned int dim=1) |
The "quantile" of the Chi-Square distribution, for dimension "dim" and probability 0<P<1 (the inverse of chi2CDF) An aproximation from the Wilson-Hilferty transformation is used. More... | |
double | noncentralChi2CDF (unsigned int degreesOfFreedom, double noncentrality, double arg) |
double | chi2CDF (unsigned int degreesOfFreedom, double arg) |
double | chi2PDF (unsigned int degreesOfFreedom, double arg, double accuracy=1e-7) |
std::pair< double, double > | noncentralChi2PDF_CDF (unsigned int degreesOfFreedom, double noncentrality, double arg, double eps=1e-7) |
Returns the 'exact' PDF (first) and CDF (second) of a Non-central chi-squared probability distribution, using an iterative method. More... | |
template<typename CONTAINER > | |
void | confidenceIntervals (const CONTAINER &data, typename mrpt::math::ContainerType< CONTAINER >::element_t &out_mean, typename mrpt::math::ContainerType< CONTAINER >::element_t &out_lower_conf_interval, typename mrpt::math::ContainerType< CONTAINER >::element_t &out_upper_conf_interval, const double confidenceInterval=0.1, const size_t histogramNumBins=1000) |
Return the mean and the 10%-90% confidence points (or with any other confidence value) of a set of samples by building the cummulative CDF of all the elements of the container. More... | |
void | fft_real (CVectorFloat &in_realData, CVectorFloat &out_FFT_Re, CVectorFloat &out_FFT_Im, CVectorFloat &out_FFT_Mag) |
Computes the FFT of a 2^N-size vector of real numbers, and returns the Re+Im+Magnitude parts. More... | |
void | dft2_real (const CMatrixFloat &in_data, CMatrixFloat &out_real, CMatrixFloat &out_imag) |
Compute the 2D Discrete Fourier Transform (DFT) of a real matrix, returning the real and imaginary parts separately. More... | |
void | idft2_real (const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_data) |
Compute the 2D inverse Discrete Fourier Transform (DFT) More... | |
void | dft2_complex (const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_real, CMatrixFloat &out_imag) |
Compute the 2D Discrete Fourier Transform (DFT) of a complex matrix, returning the real and imaginary parts separately. More... | |
void | idft2_complex (const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_real, CMatrixFloat &out_imag) |
Compute the 2D inverse Discrete Fourier Transform (DFT). More... | |
void | cross_correlation_FFT (const CMatrixFloat &A, const CMatrixFloat &B, CMatrixFloat &out_corr) |
Correlation of two matrixes using 2D FFT. More... | |
double | fresnel_sin_integral (double x) noexcept |
Evaluates the integral from 0 to x of sqrt(2/pi) sin(t^2) dt. More... | |
double | fresnel_cos_integral (double x) noexcept |
Evaluates the integral from 0 to x of sqrt(2/pi) cos(t^2) dt. More... | |
long double | lfresnel_sin_integral (long double x) noexcept |
long double version of fresnel_sin_integral More... | |
long double | lfresnel_cos_integral (long double x) noexcept |
long double version of fresnel_cos_integral More... | |
template<class MATRIXLIKE1 , class MATRIXLIKE2 > | |
void | homogeneousMatrixInverse (const MATRIXLIKE1 &M, MATRIXLIKE2 &out_inverse_M) |
Efficiently compute the inverse of a 4x4 homogeneous matrix by only transposing the rotation 3x3 part and solving the translation with dot products. More... | |
template<class IN_ROTMATRIX , class IN_XYZ , class OUT_ROTMATRIX , class OUT_XYZ > | |
void | homogeneousMatrixInverse (const IN_ROTMATRIX &in_R, const IN_XYZ &in_xyz, OUT_ROTMATRIX &out_R, OUT_XYZ &out_xyz) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
template<class MATRIXLIKE > | |
void | homogeneousMatrixInverse (MATRIXLIKE &M) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
template<class T , class VECTOR > | |
T | interpolate (const T &x, const VECTOR &ys, const T &x0, const T &x1) |
Interpolate a data sequence "ys" ranging from "x0" to "x1" (equally spaced), to obtain the approximation of the sequence at the point "x". More... | |
double | interpolate2points (const double x, const double x0, const double y0, const double x1, const double y1, bool wrap2pi=false) |
Linear interpolation/extrapolation: evaluates at "x" the line (x0,y0)-(x1,y1). More... | |
template<typename NUMTYPE , class VECTORLIKE > | |
NUMTYPE | spline (const NUMTYPE t, const VECTORLIKE &x, const VECTORLIKE &y, bool wrap2pi=false) |
Interpolates the value of a function in a point "t" given 4 SORTED points where "t" is between the two middle points If wrap2pi is true, output "y" values are wrapped to ]-pi,pi] (It is assumed that input "y" values already are in the correct range). More... | |
template<typename NUMTYPE , class VECTORLIKE , int NUM_POINTS = Eigen::Dynamic> | |
NUMTYPE | leastSquareLinearFit (const NUMTYPE t, const VECTORLIKE &x, const VECTORLIKE &y, bool wrap2pi=false) |
Interpolates or extrapolates using a least-square linear fit of the set of values "x" and "y", evaluated at a single point "t". More... | |
template<class VECTORLIKE1 , class VECTORLIKE2 , class VECTORLIKE3 , int NUM_POINTS = Eigen::Dynamic> | |
void | leastSquareLinearFit (const VECTORLIKE1 &ts, VECTORLIKE2 &outs, const VECTORLIKE3 &x, const VECTORLIKE3 &y, bool wrap2pi=false) |
Interpolates or extrapolates using a least-square linear fit of the set of values "x" and "y", evaluated at a sequence of points "ts" and returned at "outs". More... | |
TPose3D | operator- (const TPose3D &p) |
Unary $\ominus$ operator: computes inverse SE(3) element. More... | |
TPose3D | operator- (const TPose3D &b, const TPose3D &a) |
Binary $\ominus$ operator: $b \ominus a$ computes the relative SE(3) pose of b "as seen from" a More... | |
std::ostream & | operator<< (std::ostream &o, const TPoint2D &p) |
std::ostream & | operator<< (std::ostream &o, const TPoint3D &p) |
std::ostream & | operator<< (std::ostream &o, const TPose2D &p) |
std::ostream & | operator<< (std::ostream &o, const TPose3D &p) |
std::ostream & | operator<< (std::ostream &o, const TPose3DQuat &p) |
constexpr TPoint3D | operator- (const TPoint3D &p1) |
Unary minus operator for 3D points. More... | |
constexpr bool | operator== (const TPoint2D &p1, const TPoint2D &p2) |
Exact comparison between 2D points. More... | |
constexpr bool | operator!= (const TPoint2D &p1, const TPoint2D &p2) |
Exact comparison between 2D points. More... | |
constexpr bool | operator== (const TPoint3D &p1, const TPoint3D &p2) |
Exact comparison between 3D points. More... | |
constexpr bool | operator!= (const TPoint3D &p1, const TPoint3D &p2) |
Exact comparison between 3D points. More... | |
bool | operator== (const TPose2D &p1, const TPose2D &p2) |
Exact comparison between 2D poses, taking possible cycles into account. More... | |
bool | operator!= (const TPose2D &p1, const TPose2D &p2) |
Exact comparison between 2D poses, taking possible cycles into account. More... | |
bool | operator== (const TPose3D &p1, const TPose3D &p2) |
Exact comparison between 3D poses, taking possible cycles into account. More... | |
bool | operator!= (const TPose3D &p1, const TPose3D &p2) |
Exact comparison between 3D poses, taking possible cycles into account. More... | |
bool | operator== (const TSegment2D &s1, const TSegment2D &s2) |
bool | operator!= (const TSegment2D &s1, const TSegment2D &s2) |
bool | operator== (const TSegment3D &s1, const TSegment3D &s2) |
bool | operator!= (const TSegment3D &s1, const TSegment3D &s2) |
template<class PoseOrPoint , typename = std::enable_if_t<std::is_base_of< mrpt::math::TPoseOrPoint, PoseOrPoint>::value>> | |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, PoseOrPoint &o) |
template<class PoseOrPoint , typename = std::enable_if_t<std::is_base_of< mrpt::math::TPoseOrPoint, PoseOrPoint>::value>> | |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const PoseOrPoint &o) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::TSegment2D &s) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const mrpt::math::TSegment2D &s) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::TLine2D &l) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const mrpt::math::TLine2D &l) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::TObject2D &o) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const mrpt::math::TObject2D &o) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::TSegment3D &s) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const mrpt::math::TSegment3D &s) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::TLine3D &l) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const mrpt::math::TLine3D &l) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::TPlane &p) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const mrpt::math::TPlane &p) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::TObject3D &o) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const mrpt::math::TObject3D &o) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::TTwist2D &o) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const mrpt::math::TTwist2D &o) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::TTwist3D &o) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &out, const mrpt::math::TTwist3D &o) |
template<class CONTAINER1 , class CONTAINER2 > | |
void | cumsum (const CONTAINER1 &in_data, CONTAINER2 &out_cumsum) |
template<class CONTAINER > | |
CONTAINER::Scalar | norm (const CONTAINER &v) |
template<class CONTAINER > | |
CONTAINER::Scalar | norm_inf (const CONTAINER &v) |
template<class MAT_A , class SKEW_3VECTOR , class MAT_OUT > | |
void | multiply_A_skew3 (const MAT_A &A, const SKEW_3VECTOR &v, MAT_OUT &out) |
Only for vectors/arrays "v" of length3, compute out = A * Skew(v), where Skew(v) is the skew symmetric matric generated from v (see mrpt::math::skew_symmetric3) More... | |
template<class SKEW_3VECTOR , class MAT_A , class MAT_OUT > | |
void | multiply_skew3_A (const SKEW_3VECTOR &v, const MAT_A &A, MAT_OUT &out) |
Only for vectors/arrays "v" of length3, compute out = Skew(v) * A, where Skew(v) is the skew symmetric matric generated from v (see mrpt::math::skew_symmetric3) More... | |
template<class T > | |
T | wrapTo2Pi (T a) |
Modifies the given angle to translate it into the [0,2pi[ range. More... | |
template<typename MAT > | |
CMatrixRowAccessor< MAT > | getRowAccessor (MAT &m, size_t rowIdx) |
template<typename MAT > | |
CMatrixRowAccessorExtended< MAT > | getRowAccessor (MAT &m, size_t rowIdx, size_t offset, size_t space=1) |
template<typename MAT > | |
CConstMatrixRowAccessor< MAT > | getRowAccessor (const MAT &m, size_t rowIdx) |
template<typename MAT > | |
CConstMatrixRowAccessorExtended< MAT > | getRowAccessor (const MAT &m, size_t rowIdx, size_t offset, size_t space=1) |
template<typename MAT > | |
CMatrixColumnAccessor< MAT > | getColumnAccessor (MAT &m, size_t colIdx) |
template<typename MAT > | |
CMatrixColumnAccessorExtended< MAT > | getColumnAccessor (MAT &m, size_t colIdx, size_t offset, size_t space=1) |
template<typename MAT > | |
CConstMatrixColumnAccessor< MAT > | getColumnAccessor (const MAT &m, size_t colIdx) |
template<typename MAT > | |
CConstMatrixColumnAccessorExtended< MAT > | getColumnAccessor (const MAT &m, size_t colIdx, size_t offset, size_t space=1) |
template<class VECTORLIKE , class VECTORLIKE2 , class VECTORLIKE3 , class MATRIXLIKE , class USERPARAM > | |
void | estimateJacobian (const VECTORLIKE &x, const std::function< void(const VECTORLIKE &x, const USERPARAM &y, VECTORLIKE3 &out)> &functor, const VECTORLIKE2 &increments, const USERPARAM &userParam, MATRIXLIKE &out_Jacobian) |
Estimate the Jacobian of a multi-dimensional function around a point "x", using finite differences of a given size in each input dimension. More... | |
template<class CONTAINER > | |
std::vector< double > | histogram (const CONTAINER &v, double limit_min, double limit_max, size_t number_bins, bool do_normalization=false, std::vector< double > *out_bin_centers=nullptr) |
Computes the normalized or normal histogram of a sequence of numbers given the number of bins and the limits. More... | |
template<class EIGEN_CONTAINER > | |
void | resizeLike (EIGEN_CONTAINER &trg, const EIGEN_CONTAINER &src) |
template<typename T > | |
void | resizeLike (std::vector< T > &trg, const std::vector< T > &src) |
template<class CONTAINER1 , class CONTAINER2 , typename VALUE > | |
void | cumsum_tmpl (const CONTAINER1 &in_data, CONTAINER2 &out_cumsum) |
Computes the cumulative sum of all the elements, saving the result in another container. More... | |
template<class CONTAINER > | |
CONTAINER | cumsum (const CONTAINER &in_data) |
Computes the cumulative sum of all the elements. More... | |
template<class CONTAINER > | |
CONTAINER::Scalar | maximum (const CONTAINER &v) |
template<class CONTAINER > | |
CONTAINER::Scalar | minimum (const CONTAINER &v) |
template<typename T > | |
T | maximum (const std::vector< T > &v) |
template<typename T > | |
T | minimum (const std::vector< T > &v) |
template<class Derived > | |
const Eigen::MatrixBase< Derived >::AdjointReturnType | operator~ (const Eigen::MatrixBase< Derived > &m) |
Transpose operator for matrices. More... | |
template<class Derived > | |
Eigen::MatrixBase< Derived >::PlainObject | operator! (const Eigen::MatrixBase< Derived > &m) |
Unary inversion operator. More... | |
template<typename MAT_H , typename MAT_C , typename MAT_R > | |
void | multiply_HCHt (const MAT_H &H, const MAT_C &C, MAT_R &R, bool accumResultInOutput) |
R = H * C * H^t (with C symmetric) More... | |
template<typename VECTOR_H , typename MAT_C > | |
MAT_C::Scalar | multiply_HCHt_scalar (const VECTOR_H &H, const MAT_C &C) |
r (a scalar) = H * C * H^t (with a vector H and a symmetric matrix C) More... | |
template<typename MAT_H , typename MAT_C , typename MAT_R > | |
void | multiply_HtCH (const MAT_H &H, const MAT_C &C, MAT_R &R, bool accumResultInOutput) |
R = H^t * C * H (with C symmetric) More... | |
template<class MAT_IN , class VECTOR , class MAT_OUT > | |
void | meanAndCovMat (const MAT_IN &v, VECTOR &out_mean, MAT_OUT &out_cov) |
Computes the mean vector and covariance from a list of samples in an NxM matrix, where each row is a sample, so the covariance is MxM. More... | |
template<class MATRIX > | |
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, so the covariance is MxM. More... | |
template<class T > | |
std::ostream & | operator<< (std::ostream &out, const std::vector< T > &d) |
A template function for printing out the contents of a std::vector variable. More... | |
template<class T > | |
std::ostream & | operator<< (std::ostream &out, std::vector< T > *d) |
A template function for printing out the contents of a std::vector variable. More... | |
template<typename T , size_t N> | |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &ostrm, const CArrayNumeric< T, N > &a) |
Binary dump of a CArrayNumeric<T,N> to a stream. More... | |
template<typename T , size_t N> | |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &istrm, CArrayNumeric< T, N > &a) |
Binary read of a CArrayNumeric<T,N> from a stream. More... | |
int | solve_poly3 (double *x, double a, double b, double c) noexcept |
Solves cubic equation x^3 + a*x^2 + b*x + c = 0 . More... | |
int | solve_poly4 (double *x, double a, double b, double c, double d) noexcept |
Solves quartic equation x^4 + a*x^3 + b*x^2 + c*x + d = 0 by Dekart-Euler method. More... | |
int | solve_poly5 (double *x, double a, double b, double c, double d, double e) noexcept |
Solves equation x^5 + a*x^4 + b*x^3 + c*x^2 + d*x + e = 0 . More... | |
int | solve_poly4Bi (double *x, double b, double d) noexcept |
Solve equation x^4 + b*x^2 + d = 0. More... | |
int | solve_poly4De (double *x, double b, double c, double d) noexcept |
Solve equation x^4 + b*x^2 + c*x + d = 0. More... | |
int | solve_poly2 (double a, double b, double c, double &r1, double &r2) noexcept |
Solves equation a*x^2 + b*x + c = 0 . More... | |
template<class VECTORLIKE1 , class MATLIKE1 , class USERPARAM , class VECTORLIKE2 , class VECTORLIKE3 , class MATLIKE2 > | |
void | transform_gaussian_unscented (const VECTORLIKE1 &x_mean, const MATLIKE1 &x_cov, void(*functor)(const VECTORLIKE1 &x, const USERPARAM &fixed_param, VECTORLIKE3 &y), const USERPARAM &fixed_param, VECTORLIKE2 &y_mean, MATLIKE2 &y_cov, const bool *elem_do_wrap2pi=nullptr, const double alpha=1e-3, const double K=0, const double beta=2.0) |
Scaled unscented transformation (SUT) for estimating the Gaussian distribution of a variable Y=f(X) for an arbitrary function f() provided by the user. More... | |
template<class VECTORLIKE1 , class MATLIKE1 , class USERPARAM , class VECTORLIKE2 , class VECTORLIKE3 , class MATLIKE2 > | |
void | transform_gaussian_montecarlo (const VECTORLIKE1 &x_mean, const MATLIKE1 &x_cov, void(*functor)(const VECTORLIKE1 &x, const USERPARAM &fixed_param, VECTORLIKE3 &y), const USERPARAM &fixed_param, VECTORLIKE2 &y_mean, MATLIKE2 &y_cov, const size_t num_samples=1000, mrpt::aligned_std_vector< VECTORLIKE3 > *out_samples_y=nullptr) |
Simple Montecarlo-base estimation of the Gaussian distribution of a variable Y=f(X) for an arbitrary function f() provided by the user. More... | |
template<class VECTORLIKE1 , class MATLIKE1 , class USERPARAM , class VECTORLIKE2 , class VECTORLIKE3 , class MATLIKE2 > | |
void | transform_gaussian_linear (const VECTORLIKE1 &x_mean, const MATLIKE1 &x_cov, void(*functor)(const VECTORLIKE1 &x, const USERPARAM &fixed_param, VECTORLIKE3 &y), const USERPARAM &fixed_param, VECTORLIKE2 &y_mean, MATLIKE2 &y_cov, const VECTORLIKE1 &x_increments) |
First order uncertainty propagation estimator of the Gaussian distribution of a variable Y=f(X) for an arbitrary function f() provided by the user. More... | |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &s, const mrpt::math::CVectorFloat &a) |
mrpt::serialization::CArchive & | operator<< (mrpt::serialization::CArchive &s, const mrpt::math::CVectorDouble &a) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::CVectorDouble &a) |
mrpt::serialization::CArchive & | operator>> (mrpt::serialization::CArchive &in, mrpt::math::CVectorFloat &a) |
template<class T1 , class T2 > | |
bool | approximatelyEqual (T1 a, T1 b, T2 epsilon) |
Compare 2 floats and determine whether they are equal. More... | |
template<class T > | |
bool | approximatelyEqual (T a, T b) |
Compare 2 floats and determine whether they are equal. More... | |
template<class T > | |
T | absDiff (const T &lhs, const T &rhs) |
Absolute difference between two numbers. More... | |
bool | loadVector (std::istream &f, std::vector< int > &d) |
Loads one row of a text file as a numerical std::vector. More... | |
bool | loadVector (std::istream &f, std::vector< double > &d) |
Loads one row of a text file as a numerical std::vector. More... | |
void | medianFilter (const std::vector< double > &inV, std::vector< double > &outV, const int &winSize, const int &numberOfSigmas=2) |
template<typename T , typename VECTOR > | |
void | linspace (T first, T last, size_t count, VECTOR &out_vector) |
Generates an equidistant sequence of numbers given the first one, the last one and the desired number of points. More... | |
template<class T , T STEP> | |
std::vector< T > | sequenceStdVec (T first, size_t length) |
Generates a sequence of values [first,first+STEP,first+2*STEP,...]. More... | |
template<class VEC1 , class VEC2 > | |
void | normalize (const VEC1 &v, VEC2 &out_v) |
Normalize a vector, such as its norm is the unity. More... | |
template<class VECTOR_OF_VECTORS , class VECTORLIKE > | |
void | extractColumnFromVectorOfVectors (const size_t colIndex, const VECTOR_OF_VECTORS &data, VECTORLIKE &out_column) |
Extract a column from a vector of vectors, and store it in another vector. More... | |
uint64_t | factorial64 (unsigned int n) |
Computes the factorial of an integer number and returns it as a 64-bit integer number. More... | |
double | factorial (unsigned int n) |
Computes the factorial of an integer number and returns it as a double value (internally it uses logarithms for avoiding overflow). More... | |
std::string | MATLAB_plotCovariance2D (const CMatrixFloat &cov22, const CVectorFloat &mean, const float &stdCount, const std::string &style=std::string("b"), const size_t &nEllipsePoints=30) |
Generates a string with the MATLAB commands required to plot an confidence interval (ellipse) for a 2D Gaussian ('float' version). More... | |
std::string | MATLAB_plotCovariance2D (const CMatrixDouble &cov22, const CVectorDouble &mean, const float &stdCount, const std::string &style=std::string("b"), const size_t &nEllipsePoints=30) |
Generates a string with the MATLAB commands required to plot an confidence interval (ellipse) for a 2D Gaussian ('double' version). More... | |
template<typename EIGEN_VECTOR , typename At , size_t N> | |
EIGEN_VECTOR & | loadVector (EIGEN_VECTOR &v, At(&theArray)[N]) |
Assignment operator for initializing a std::vector from a C array (The vector will be automatically set to the correct size). More... | |
template<typename T , typename At , size_t N> | |
std::vector< T > & | loadVector (std::vector< T > &v, At(&theArray)[N]) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
template<class TRIPLET > | |
bool | saveEigenSparseTripletsToFile (const std::string &sFile, std::vector< TRIPLET > &tri) |
Saves to a plain-text file the nonzero entries of a Eigen sparse matrix, represented as a vector of triplets. More... | |
template<typename Derived > | |
mxArray * | convertToMatlab (const Eigen::EigenBase< Derived > &mat) |
Convert vectors, arrays and matrices into Matlab vectors/matrices. More... | |
template<typename CONTAINER > | |
mxArray * | convertVectorToMatlab (const CONTAINER &vec) |
Convert std::vector<> or std::deque<> of numeric types into Matlab vectors. More... | |
template<class T > | |
void | wrapTo2PiInPlace (T &a) |
Modifies the given angle to translate it into the [0,2pi[ range. More... | |
template<class T > | |
T | wrapToPi (T a) |
Modifies the given angle to translate it into the ]-pi,pi] range. More... | |
template<class T > | |
void | wrapToPiInPlace (T &a) |
Modifies the given angle to translate it into the ]-pi,pi] range. More... | |
template<class VECTOR > | |
void | unwrap2PiSequence (VECTOR &x) |
Modify a sequence of angle values such as no consecutive values have a jump larger than PI in absolute value. More... | |
template<class T > | |
T | angDistance (T from, T to) |
Computes the shortest angular increment (or distance) between two planar orientations, such that it is constrained to [-pi,pi] and is correct for any combination of angles (e.g. More... | |
static void | four1 (float data[], unsigned long nn, int isign) |
static void | realft (float data[], unsigned long n) |
static void | makewt (int nw, int *ip, FFT_TYPE *w) |
static void | bitrv2 (int n, int *ip, FFT_TYPE *a) |
Copyright(C) 1997 Takuya OOURA (email: ooura). @mmm .t.u- toky o.ac. jpMore... | |
static void | cftbsub (int n, FFT_TYPE *a, FFT_TYPE *w) |
static void | cftfsub (int n, FFT_TYPE *a, FFT_TYPE *w) |
static void | rftfsub (int n, FFT_TYPE *a, int nc, FFT_TYPE *c) |
static void | rftbsub (int n, FFT_TYPE *a, int nc, FFT_TYPE *c) |
static void | makect (int nc, int *ip, FFT_TYPE *c) |
Copyright(C) 1997 Takuya OOURA (email: ooura). @mmm .t.u- toky o.ac. jpMore... | |
static void | cdft (int n, int isgn, FFT_TYPE *a, int *ip, FFT_TYPE *w) |
Copyright(C) 1997 Takuya OOURA (email: ooura). @mmm .t.u- toky o.ac. jpMore... | |
static void | rdft (int n, int isgn, FFT_TYPE *a, int *ip, FFT_TYPE *w) |
static void | rdft2d (int n1, int n2, int isgn, FFT_TYPE **a, FFT_TYPE *t, int *ip, FFT_TYPE *w) |
static void | cdft2d (int n1, int n2, int isgn, FFT_TYPE **a, FFT_TYPE *t, int *ip, FFT_TYPE *w) |
template<class T > | |
void | removeUnusedVertices (T &poly) |
template<class T > | |
void | removeRepVertices (T &poly) |
double | isLeft (const mrpt::math::TPoint2D &P0, const mrpt::math::TPoint2D &P1, const mrpt::math::TPoint2D &P2) |
template<typename T > | |
void | ransac3Dplane_fit (const CMatrixTemplateNumeric< T > &allData, const std::vector< size_t > &useIndices, vector< CMatrixTemplateNumeric< T >> &fitModels) |
template<typename T > | |
void | ransac3Dplane_distance (const CMatrixTemplateNumeric< T > &allData, const vector< CMatrixTemplateNumeric< T >> &testModels, const T distanceThreshold, unsigned int &out_bestModelIndex, std::vector< size_t > &out_inlierIndices) |
template<typename T > | |
bool | ransac3Dplane_degenerate (const CMatrixTemplateNumeric< T > &allData, const std::vector< size_t > &useIndices) |
Return "true" if the selected points are a degenerate (invalid) case. More... | |
Variables | |
static constexpr unsigned char | GEOMETRIC_TYPE_POINT = 0 |
Object type identifier for TPoint2D or TPoint3D. More... | |
static constexpr unsigned char | GEOMETRIC_TYPE_SEGMENT = 1 |
Object type identifier for TSegment2D or TSegment3D. More... | |
static constexpr unsigned char | GEOMETRIC_TYPE_LINE = 2 |
Object type identifier for TLine2D or TLine3D. More... | |
static constexpr unsigned char | GEOMETRIC_TYPE_POLYGON = 3 |
Object type identifier for TPolygon2D or TPolygon3D. More... | |
static constexpr unsigned char | GEOMETRIC_TYPE_PLANE = 4 |
Object type identifier for TPlane. More... | |
static constexpr unsigned char | GEOMETRIC_TYPE_UNDEFINED = 255 |
Object type identifier for empty TObject2D or TObject3D. More... | |
using mrpt::math::CArrayDouble = typedef CArrayNumeric<double, N> |
A partial specialization of CArrayNumeric for double numbers.
Definition at line 64 of file CArrayNumeric.h.
using mrpt::math::CArrayFloat = typedef CArrayNumeric<float, N> |
A partial specialization of CArrayNumeric for float numbers.
Definition at line 59 of file CArrayNumeric.h.
using mrpt::math::CArrayInt = typedef CArrayNumeric<int, N> |
A partial specialization of CArrayNumeric for int numbers.
Definition at line 69 of file CArrayNumeric.h.
using mrpt::math::CArrayUInt = typedef CArrayNumeric<unsigned int, N> |
A partial specialization of CArrayNumeric for unsigned int numbers.
Definition at line 74 of file CArrayNumeric.h.
The default name for the LM class is an instantiation for "double".
Definition at line 260 of file CLevenbergMarquardt.h.
typedef CMatrixTemplateNumeric< double > mrpt::math::CMatrixDouble |
Declares a matrix of double numbers (non serializable).
For a serializable version, use math::CMatrixD
Definition at line 144 of file CMatrixTemplateNumeric.h.
using mrpt::math::CMatrixDouble12 = typedef CMatrixFixedNumeric<double, 1, 2> |
Definition at line 63 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble13 = typedef CMatrixFixedNumeric<double, 1, 3> |
Definition at line 61 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble15 = typedef CMatrixFixedNumeric<double, 1, 5> |
Definition at line 70 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble16 = typedef CMatrixFixedNumeric<double, 1, 6> |
Definition at line 66 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble17 = typedef CMatrixFixedNumeric<double, 1, 7> |
Definition at line 68 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble21 = typedef CMatrixFixedNumeric<double, 2, 1> |
Definition at line 64 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble22 = typedef CMatrixFixedNumeric<double, 2, 2> |
Definition at line 54 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble23 = typedef CMatrixFixedNumeric<double, 2, 3> |
Definition at line 55 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble31 = typedef CMatrixFixedNumeric<double, 3, 1> |
Definition at line 62 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble32 = typedef CMatrixFixedNumeric<double, 3, 2> |
Definition at line 56 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble33 = typedef CMatrixFixedNumeric<double, 3, 3> |
Definition at line 57 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble41 = typedef CMatrixFixedNumeric<double, 4, 1> |
Definition at line 71 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble44 = typedef CMatrixFixedNumeric<double, 4, 4> |
Definition at line 58 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble51 = typedef CMatrixFixedNumeric<double, 5, 1> |
Definition at line 69 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble61 = typedef CMatrixFixedNumeric<double, 6, 1> |
Definition at line 65 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble66 = typedef CMatrixFixedNumeric<double, 6, 6> |
Definition at line 59 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble71 = typedef CMatrixFixedNumeric<double, 7, 1> |
Definition at line 67 of file eigen_frwds.h.
using mrpt::math::CMatrixDouble77 = typedef CMatrixFixedNumeric<double, 7, 7> |
Definition at line 60 of file eigen_frwds.h.
typedef CMatrixTemplateNumeric< float > mrpt::math::CMatrixFloat |
Declares a matrix of float numbers (non serializable).
For a serializable version, use math::CMatrix
Definition at line 138 of file CMatrixTemplateNumeric.h.
using mrpt::math::CMatrixFloat12 = typedef CMatrixFixedNumeric<float, 1, 2> |
Definition at line 82 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat13 = typedef CMatrixFixedNumeric<float, 1, 3> |
Definition at line 80 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat15 = typedef CMatrixFixedNumeric<float, 1, 5> |
Definition at line 89 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat16 = typedef CMatrixFixedNumeric<float, 1, 6> |
Definition at line 85 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat17 = typedef CMatrixFixedNumeric<float, 1, 7> |
Definition at line 87 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat21 = typedef CMatrixFixedNumeric<float, 2, 1> |
Definition at line 83 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat22 = typedef CMatrixFixedNumeric<float, 2, 2> |
Definition at line 73 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat23 = typedef CMatrixFixedNumeric<float, 2, 3> |
Definition at line 74 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat31 = typedef CMatrixFixedNumeric<float, 3, 1> |
Definition at line 81 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat32 = typedef CMatrixFixedNumeric<float, 3, 2> |
Definition at line 75 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat33 = typedef CMatrixFixedNumeric<float, 3, 3> |
Definition at line 76 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat44 = typedef CMatrixFixedNumeric<float, 4, 4> |
Definition at line 77 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat51 = typedef CMatrixFixedNumeric<float, 5, 1> |
Definition at line 88 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat61 = typedef CMatrixFixedNumeric<float, 6, 1> |
Definition at line 84 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat66 = typedef CMatrixFixedNumeric<float, 6, 6> |
Definition at line 78 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat71 = typedef CMatrixFixedNumeric<float, 7, 1> |
Definition at line 86 of file eigen_frwds.h.
using mrpt::math::CMatrixFloat77 = typedef CMatrixFixedNumeric<float, 7, 7> |
Definition at line 79 of file eigen_frwds.h.
using mrpt::math::CMatrixLongDouble = typedef CMatrixTemplateNumeric<double> |
Declares a matrix of "long doubles" (non serializable), or of "doubles" if the compiler does not support "long double".
Definition at line 162 of file CMatrixTemplateNumeric.h.
using mrpt::math::CMatrixUInt = typedef CMatrixTemplateNumeric<unsigned int> |
Declares a matrix of unsigned ints (non serializable).
Definition at line 149 of file CMatrixTemplateNumeric.h.
using mrpt::math::CQuaternionDouble = typedef CQuaternion<double> |
A quaternion of data type "double".
Definition at line 504 of file CQuaternion.h.
using mrpt::math::CQuaternionFloat = typedef CQuaternion<float> |
A quaternion of data type "float".
Definition at line 506 of file CQuaternion.h.
typedef dynamic_vector< double > mrpt::math::CVectorDouble |
Column vector, like Eigen::MatrixXd, but automatically initialized to zeros since construction.
Definition at line 46 of file eigen_frwds.h.
typedef dynamic_vector< float > mrpt::math::CVectorFloat |
Column vector, like Eigen::MatrixXf, but automatically initialized to zeros since construction.
Definition at line 45 of file eigen_frwds.h.
using mrpt::math::FFT_TYPE = typedef float |
Copyright(C) 1997 Takuya OOURA (email: ooura). @mmm .t.u- toky o.ac. jp
You may use, copy, modify this code for any purpose and without fee. You may distribute this ORIGINAL package.
Definition at line 149 of file fourier.cpp.
For usage in one of the constructors of CMatrixFixedNumeric or CMatrixTemplate (and derived classes), if it's not required to fill it with zeros at the constructor to save time.
Enumerator | |
---|---|
UNINITIALIZED_MATRIX |
Definition at line 73 of file math_frwds.h.
Enumerator | |
---|---|
UNINITIALIZED_QUATERNION |
Definition at line 22 of file CQuaternion.h.
Selection of the number format in CMatrixTemplate::saveToTextFile
Enumerator | |
---|---|
MATRIX_FORMAT_ENG | engineering format 'e' |
MATRIX_FORMAT_FIXED | fixed floating point 'f' |
MATRIX_FORMAT_INT | intergers 'i' |
Definition at line 60 of file math_frwds.h.
T mrpt::math::absDiff | ( | const T & | lhs, |
const T & | rhs | ||
) |
Absolute difference between two numbers.
Definition at line 54 of file math/include/mrpt/math/utils.h.
Referenced by mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::checkRegistrationCondition2D(), mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::checkRegistrationCondition3D(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph(), mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::registerNewEdge(), and mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::updateState().
void mrpt::math::adjustRange | ( | CONTAINER & | m, |
const typename CONTAINER::Scalar | minVal, | ||
const typename CONTAINER::Scalar | maxVal | ||
) |
Adjusts the range of all the elements such as the minimum and maximum values being those supplied by the user.
Definition at line 285 of file ops_containers.h.
References minimum_maximum().
bool mrpt::math::approximatelyEqual | ( | T | a, |
T | b | ||
) |
Compare 2 floats and determine whether they are equal.
a | Fist num |
b | Second num |
Definition at line 45 of file math/include/mrpt/math/utils.h.
References approximatelyEqual().
bool mrpt::math::approximatelyEqual | ( | T1 | a, |
T1 | b, | ||
T2 | epsilon | ||
) |
Compare 2 floats and determine whether they are equal.
a | Fist num |
b | Second num |
epsilon | Difference below which a, b are considered equal |
Definition at line 34 of file math/include/mrpt/math/utils.h.
Referenced by mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::addScanMatchingEdges(), approximatelyEqual(), and mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::computeDominantEigenVector().
|
static |
Copyright(C) 1997 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp). You may use, copy, modify this code for any purpose and without fee. You may distribute this ORIGINAL package.
-----— Complex DFT (Discrete Fourier Transform) -----— [definition] <case1> X[k1][k2] = sum_j1=0^n1-1 sum_j2=0^n2-1 x[j1][j2] * exp(2*pi*i*j1*k1/n1) * exp(2*pi*i*j2*k2/n2), 0<=k1<n1, 0<=k2<n2 <case2> X[k1][k2] = sum_j1=0^n1-1 sum_j2=0^n2-1 x[j1][j2] * exp(-2*pi*i*j1*k1/n1) * exp(-2*pi*i*j2*k2/n2), 0<=k1<n1, 0<=k2<n2 (notes: sum_j=0^n-1 is a summation from j=0 to n-1) [usage] <case1> ip[0] = 0; // first time only cdft2d(n1, 2*n2, 1, a, t, ip, w); <case2> ip[0] = 0; // first time only cdft2d(n1, 2*n2, -1, a, t, ip, w); [parameters] n1 :data length (int) n1 >= 1, n1 = power of 2 2*n2 :data length (int) n2 >= 1, n2 = power of 2 a[0...n1-1][0...2*n2-1] :input/output data (double **) input data a[j1][2*j2] = Re(x[j1][j2]), a[j1][2*j2+1] = Im(x[j1][j2]), 0<=j1<n1, 0<=j2<n2 output data a[k1][2*k2] = Re(X[k1][k2]), a[k1][2*k2+1] = Im(X[k1][k2]), 0<=k1<n1, 0<=k2<n2 t[0...2*n1-1] :work area (double *) ip[0...*] :work area for bit reversal (int *) length of ip >= 2+sqrt(n) ; if n % 4 == 0 2+sqrt(n/2); otherwise (n = max(n1, n2)) ip[0],ip[1] are pointers of the cos/sin table. w[0...*] :cos/sin table (double *) length of w >= max(n1/2, n2/2) w[],ip[] are initialized if ip[0] == 0. [remark] Inverse of cdft2d(n1, 2*n2, -1, a, t, ip, w); is cdft2d(n1, 2*n2, 1, a, t, ip, w); for (j1 = 0; j1 <= n1 - 1; j1++) { for (j2 = 0; j2 <= 2 * n2 - 1; j2++) { a[j1][j2] *= 1.0 / (n1 * n2); } }
Definition at line 888 of file fourier.cpp.
References cdft(), and makewt().
Referenced by dft2_complex(), and idft2_complex().
Definition at line 158 of file fourier.cpp.
Definition at line 278 of file fourier.cpp.
CONTAINER & mrpt::math::containerFromPoseOrPoint | ( | CONTAINER & | C, |
const POINT_OR_POSE & | p | ||
) |
Conversion of poses (TPose2D,TPoint2D,..., mrpt::poses::CPoint2D,CPose3D,...) to MRPT containers (vector/matrix)
Conversion of poses to MRPT containers (vector/matrix)
Definition at line 23 of file point_poses2vectors.h.
References static_size.
size_t mrpt::math::countCommonElements | ( | const CONTAINER1 & | a, |
const CONTAINER2 & | b | ||
) |
Counts the number of elements that appear in both STL-like containers (comparison through the == operator) It is assumed that no repeated elements appear within each of the containers.
Definition at line 271 of file ops_containers.h.
Referenced by mrpt::slam::CRangeBearingKFSLAM::computeOffDiagonalBlocksApproximationError().
|
inline |
Computes the covariance matrix from a list of samples in an NxM matrix, where each row is a sample, so the covariance is MxM.
v | The set of data, as a NxM matrix. |
out_cov | The output MxM matrix for the estimated covariance matrix. |
Definition at line 148 of file ops_matrices.h.
References meanAndCovMat().
Referenced by mrpt::poses::CPosePDFSOG::assureSymmetry(), mrpt::poses::CPosePDFGaussianInf::bayesianFusion(), mrpt::poses::CPosePDFSOG::bayesianFusion(), mrpt::poses::CPosePDFSOG::changeCoordinatesReference(), mrpt::detectors::CFaceDetection::checkIfFacePlaneCov(), mrpt::poses::CPose3DPDFGaussianInf::copyFrom(), mrpt::poses::CPosePDFSOG::copyFrom(), mrpt::random::CRandomGenerator::drawDefinitePositiveMatrix(), mrpt::random::CRandomGenerator::drawGaussianMultivariate(), mrpt::random::CRandomGenerator::drawGaussianMultivariateMany(), mrpt::poses::CPose3DPDFGaussianInf::drawManySamples(), mrpt::poses::CPosePDFGaussianInf::drawManySamples(), mrpt::poses::CPose3DPDFGaussianInf::drawSingleSample(), mrpt::poses::CPosePDFGaussianInf::drawSingleSample(), mrpt::poses::CPosePDFGaussianInf::evaluateNormalizedPDF(), mrpt::poses::CPosePDFSOG::evaluateNormalizedPDF(), mrpt::poses::CPosePDFSOG::evaluatePDF(), PosePDFGaussTests::generateRandomPose2DPDF(), Pose3DPDFGaussTests::generateRandomPose3DPDF(), Pose3DQuatPDFGaussTests::generateRandomPose3DPDF(), mrpt::math::CProbabilityDensityFunction< CPose2D, 3 >::getCovariance(), mrpt::poses::CPosePDFGrid::getCovarianceAndMean(), mrpt::poses::CPointPDFParticles::getCovarianceAndMean(), mrpt::poses::CPose3DPDFParticles::getCovarianceAndMean(), mrpt::poses::CPose3DQuatPDFGaussianInf::getCovarianceAndMean(), mrpt::poses::CPosePDFParticles::getCovarianceAndMean(), mrpt::poses::CPosePDFSOG::getCovarianceAndMean(), mrpt::math::CProbabilityDensityFunction< CPose2D, 3 >::getCovarianceDynAndMean(), mrpt::math::CProbabilityDensityFunction< CPose2D, 3 >::getInformationMatrix(), mrpt::poses::CPosePDFSOG::getMostLikelyCovarianceAndMean(), mrpt::pbmap::getMultiDimMeanShift_color(), mrpt::poses::CPosePDFSOG::inverse(), mahalanobisDistance(), mahalanobisDistance2(), mahalanobisDistance2AndLogPDF(), mahalanobisDistance2AndPDF(), mrpt::poses::CPose3DPDFGaussianInf::mahalanobisDistanceTo(), MATLAB_plotCovariance2D(), mrpt::poses::CPosePDFSOG::mergeModes(), normalPDF(), mrpt::poses::CPosePDFGaussianInf::operator+=(), mrpt::opengl::CSetOfObjects::posePDF2opengl(), mrpt::obs::CActionRobotMovement2D::prepareFastDrawSingleSample_modelGaussian(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::random::randomNormalMultiDimensional(), mrpt::random::randomNormalMultiDimensionalMany(), mrpt::poses::CPosePDFSOG::rotateAllCovariances(), run_test_pf_localization(), mrpt::slam::CRangeBearingKFSLAM2D::saveMapAndPath2DRepresentationAsMATLABFile(), mrpt::slam::CRangeBearingKFSLAM::saveMapAndPath2DRepresentationAsMATLABFile(), mrpt::maps::CLandmarksMap::saveToMATLABScript2D(), mrpt::poses::CPoseRandomSampler::setPosePDF(), and TEST().
|
inline |
Computes the covariance matrix from a list of values given as a vector of vectors, where each row is a sample.
v | The set of data, as a vector of N vectors of M elements. |
out_cov | The output MxM matrix for the estimated covariance matrix. |
RETURN_MATRIX | The type of the returned matrix, e.g. Eigen::MatrixXd |
Definition at line 397 of file ops_containers.h.
References meanAndCovVec().
|
inline |
Computes the cumulative sum of all the elements.
Definition at line 121 of file ops_containers.h.
References cumsum().
|
inline |
Definition at line 111 of file ops_containers.h.
References cumsum_tmpl().
Referenced by confidenceIntervals(), and cumsum().
|
inline |
Computes the cumulative sum of all the elements, saving the result in another container.
This works for both matrices (even mixing their types) and vectores/arrays (even mixing types), and even to store the cumsum of any matrix into any vector/array, but not in opposite direction.
Definition at line 102 of file ops_containers.h.
References resizeLike().
Referenced by cumsum().
|
inline |
v1*v2: The dot product of two containers (vectors/arrays/matrices)
Definition at line 190 of file ops_containers.h.
|
inline |
v1*v2: The dot product of any two objects supporting []
Definition at line 198 of file ops_containers.h.
void mrpt::math::estimateJacobian | ( | const VECTORLIKE & | x, |
const std::function< void(const VECTORLIKE &x, const USERPARAM &y, VECTORLIKE3 &out)> & | functor, | ||
const VECTORLIKE2 & | increments, | ||
const USERPARAM & | userParam, | ||
MATRIXLIKE & | out_Jacobian | ||
) |
Estimate the Jacobian of a multi-dimensional function around a point "x", using finite differences of a given size in each input dimension.
The template argument USERPARAM is for the data can be passed to the functor. If it is not required, set to "int" or any other basic type.
This is a generic template which works with: VECTORLIKE: vector_float, CVectorDouble, CArrayNumeric<>, double [N], ... MATRIXLIKE: CMatrixTemplateNumeric, CMatrixFixedNumeric
Definition at line 31 of file num_jacobian.h.
References ASSERT_, MRPT_END, and MRPT_START.
Referenced by Pose3DTests::check_jacob_expe_e_at_0(), Pose3DTests::check_jacob_LnT_T(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute(), mrpt::vision::recompute_errors_and_Jacobians(), mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration(), Pose3DQuatTests::test_composePointJacob(), Pose3DTests::test_composePointJacob(), Pose3DTests::test_composePointJacob_se3(), Pose3DQuatTests::test_invComposePointJacob(), Pose3DTests::test_invComposePointJacob(), Pose3DTests::test_invComposePointJacob_se3(), Pose3DTests::test_Jacob_dAexpeD_de(), Pose3DTests::test_Jacob_dexpeD_de(), SE_traits_tests< POSE_TYPE >::test_jacobs_P1DP2inv(), Pose3DQuatTests::test_normalizeJacob(), Pose3DQuatTests::test_sphericalCoords(), Pose3DQuatPDFGaussTests::testCompositionJacobian(), Pose3DPDFGaussTests::testCompositionJacobian(), and transform_gaussian_linear().
|
static |
Definition at line 33 of file fourier.cpp.
Referenced by realft().
|
inline |
Definition at line 679 of file matrix_adaptors.h.
|
inline |
Definition at line 740 of file matrix_adaptors.h.
|
inline |
Definition at line 548 of file matrix_adaptors.h.
|
inline |
Definition at line 623 of file matrix_adaptors.h.
|
inline |
Definition at line 415 of file matrix_adaptors.h.
|
inline |
Definition at line 477 of file matrix_adaptors.h.
|
inline |
Definition at line 280 of file matrix_adaptors.h.
|
inline |
Definition at line 357 of file matrix_adaptors.h.
std::vector<double> mrpt::math::histogram | ( | const CONTAINER & | v, |
double | limit_min, | ||
double | limit_max, | ||
size_t | number_bins, | ||
bool | do_normalization = false , |
||
std::vector< double > * | out_bin_centers = nullptr |
||
) |
Computes the normalized or normal histogram of a sequence of numbers given the number of bins and the limits.
In any case this is a "linear" histogram, i.e. for matrices, all the elements are taken as if they were a plain sequence, not taking into account they were in columns or rows. If desired, out_bin_centers can be set to receive the bins centers.
Definition at line 65 of file ops_containers.h.
References mrpt::math::CHistogram::add(), mrpt::math::CHistogram::getHistogram(), and mrpt::math::CHistogram::getHistogramNormalized().
Referenced by confidenceIntervals(), and mrpt::pbmap::getMode().
void mrpt::math::homogeneousMatrixInverse | ( | const IN_ROTMATRIX & | in_R, |
const IN_XYZ & | in_xyz, | ||
OUT_ROTMATRIX & | out_R, | ||
OUT_XYZ & | out_xyz | ||
) |
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 79 of file homog_matrices.h.
References ASSERT_, MRPT_END, and MRPT_START.
void mrpt::math::homogeneousMatrixInverse | ( | const MATRIXLIKE1 & | M, |
MATRIXLIKE2 & | out_inverse_M | ||
) |
Efficiently compute the inverse of a 4x4 homogeneous matrix by only transposing the rotation 3x3 part and solving the translation with dot products.
This is a generic template which works with: MATRIXLIKE: CMatrixTemplateNumeric, CMatrixFixedNumeric
Definition at line 24 of file homog_matrices.h.
References ASSERT_, MRPT_END, and MRPT_START.
Referenced by mrpt::poses::CPoseOrPoint< CPoint3D >::getInverseHomogeneousMatrix(), mrpt::math::TPose3D::getInverseHomogeneousMatrix(), mrpt::poses::CPose3D::inverse(), mrpt::poses::CPose3D::inverseComposeFrom(), mrpt::poses::CPose3D::inverseComposePoint(), and mrpt::obs::detail::project3DPointsFromDepthImageInto().
|
inline |
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 108 of file homog_matrices.h.
References ASSERTDEB_.
|
inline |
Definition at line 1026 of file lightweight_geom_data.cpp.
References mrpt::math::TPoint2D::x, and mrpt::math::TPoint2D::y.
Referenced by mrpt::math::TPolygon2D::contains().
|
inline |
k-means algorithm to cluster a list of N points of arbitrary dimensionality into exactly K clusters.
The list of input points can be any template CONTAINER<POINT> with:
k | [IN] Number of cluster to look for. |
points | [IN] The list of N input points. It can be any STL-like containers of std::vector<float/double>, for example a std::vector<mrpt::math::CVectorDouble>, a std::list<CVectorFloat>, etc... |
assignments | [OUT] At output it will have a number [0,k-1] for each of the N input points. |
out_centers | [OUT] If not nullptr, at output will have the centers of each group. Can be of any of the supported types of "points", but the basic coordinates should be float or double exactly as in "points". |
attempts | [IN] Number of attempts. |
Definition at line 124 of file include/mrpt/math/kmeans.h.
References mrpt::math::detail::stub_kmeans().
|
inline |
k-means++ algorithm to cluster a list of N points of arbitrary dimensionality into exactly K clusters.
The list of input points can be any template CONTAINER<POINT> with:
k | [IN] Number of cluster to look for. |
points | [IN] The list of N input points. It can be any STL-like containers of std::vector<float/double>, for example a std::vector<mrpt::math::CVectorDouble>, a std::list<CVectorFloat>, etc... |
assignments | [OUT] At output it will have a number [0,k-1] for each of the N input points. |
out_centers | [OUT] If not nullptr, at output will have the centers of each group. Can be of any of the supported types of "points", but the basic coordinates should be float or double exactly as in "points". |
attempts | [IN] Number of attempts. |
Definition at line 159 of file include/mrpt/math/kmeans.h.
References mrpt::math::detail::stub_kmeans().
Referenced by find_chessboard_corners_multiple().
Copyright(C) 1997 Takuya OOURA (email: ooura). @mmm .t.u- toky o.ac. jp
You may use, copy, modify this code for any purpose and without fee. You may distribute this ORIGINAL package.
Definition at line 432 of file fourier.cpp.
|
inline |
Definition at line 139 of file ops_containers.h.
Referenced by averageLogLikelihood(), mrpt::poses::CPointPDFParticles::computeKurtosis(), mrpt::bayes::CParticleFilterCapable::computeResampling(), confidenceIntervals(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::particlesEvaluator_AuxPFOptimal(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_implementation_pfAuxiliaryPFStandardAndOptimal(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfAuxiliaryPFOptimal(), mrpt::bayes::CParticleFilterCapable::prepareFastDrawSample(), weightedHistogram(), and weightedHistogramLog().
|
inline |
Definition at line 150 of file ops_containers.h.
References ASSERT_, and mrpt::keep_max().
|
inline |
Computes the mean value of a vector.
Definition at line 234 of file ops_containers.h.
References sum().
Referenced by mrpt::slam::CGridMapAligner::AlignPDF_robustMatch(), confidenceIntervals(), mrpt::maps::CGasConcentrationGridMap2D::internal_insertObservation(), MATLAB_plotCovariance2D(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_implementation_pfAuxiliaryPFStandardAndOptimal(), mrpt::opengl::CSetOfObjects::posePDF2opengl(), and mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfAuxiliaryPFOptimal().
void mrpt::math::meanAndCovMat | ( | const MAT_IN & | v, |
VECTOR & | out_mean, | ||
MAT_OUT & | out_cov | ||
) |
Computes the mean vector and covariance from a list of samples in an NxM matrix, where each row is a sample, so the covariance is MxM.
v | The set of data as a NxM matrix, of types: CMatrixTemplateNumeric or CMatrixFixedNumeric |
out_mean | The output M-vector for the estimated mean. |
out_cov | The output MxM matrix for the estimated covariance matrix, this can also be either a fixed-size of dynamic size matrix. |
Definition at line 103 of file ops_matrices.h.
References ASSERTMSG_, and mrpt::square().
Referenced by cov().
void mrpt::math::meanAndCovVec | ( | const VECTOR_OF_VECTOR & | v, |
VECTORLIKE & | out_mean, | ||
MATRIXLIKE & | out_cov | ||
) |
Computes the mean vector and covariance from a list of values given as a vector of vectors, where each row is a sample.
v | The set of data, as a vector of N vectors of M elements. |
out_mean | The output M-vector for the estimated mean. |
out_cov | The output MxM matrix for the estimated covariance matrix. |
Definition at line 351 of file ops_containers.h.
References ASSERTMSG_, and mrpt::square().
Referenced by covVector().
void mrpt::math::meanAndStd | ( | const VECTORLIKE & | v, |
double & | out_mean, | ||
double & | out_std, | ||
bool | unbiased = true |
||
) |
Computes the standard deviation of a vector.
v | The set of data |
out_mean | The output for the estimated mean |
out_std | The output for the estimated standard deviation |
unbiased | If set to true or false the std is normalized by "N-1" or "N", respectively. |
Definition at line 306 of file ops_containers.h.
References mrpt::square(), and sum().
Referenced by mrpt::vision::CFeature::internal_distanceBetweenPolarImages(), stddev(), and mrpt::vision::updateBaseList().
|
inline |
Definition at line 144 of file ops_containers.h.
Referenced by mrpt::slam::CGridMapAligner::AlignPDF_robustMatch(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_implementation_pfAuxiliaryPFStandardAndOptimal(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfAuxiliaryPFOptimal(), weightedHistogram(), and weightedHistogramLog().
|
inline |
Definition at line 158 of file ops_containers.h.
References ASSERT_, and mrpt::keep_min().
|
inline |
Return the maximum and minimum values of a Eigen-based vector or matrix.
Definition at line 258 of file ops_containers.h.
|
inline |
Return the maximum and minimum values of a std::vector.
Definition at line 244 of file ops_containers.h.
References ASSERT_, mrpt::keep_max(), and mrpt::keep_min().
Referenced by adjustRange(), confidenceIntervals(), and mrpt::opengl::CPointCloud::render().
void mrpt::math::multiply_A_skew3 | ( | const MAT_A & | A, |
const SKEW_3VECTOR & | v, | ||
MAT_OUT & | out | ||
) |
Only for vectors/arrays "v" of length3, compute out = A * Skew(v), where Skew(v) is the skew symmetric matric generated from v (see mrpt::math::skew_symmetric3)
Definition at line 166 of file ops_matrices.h.
References ASSERT_EQUAL_, MRPT_END, and MRPT_START.
Referenced by multiply_A_skew3().
|
inline |
MAT_C::Scalar mrpt::math::multiply_HCHt_scalar | ( | const VECTOR_H & | H, |
const MAT_C & | C | ||
) |
r (a scalar) = H * C * H^t (with a vector H and a symmetric matrix C)
Definition at line 69 of file ops_matrices.h.
Referenced by mrpt::graphs::detail::graph_ops< graph_t >::auxMaha2Dist(), mrpt::slam::joint_pdf_metric(), KLD_Gaussians(), mahalanobisDistance2(), mahalanobisDistance2AndLogPDF(), mrpt::poses::CPosePDFGaussian::mahalanobisDistanceTo(), mrpt::poses::CPosePDFGaussianInf::mahalanobisDistanceTo(), normalPDF(), and normalPDFInf().
void mrpt::math::multiply_HtCH | ( | const MAT_H & | H, |
const MAT_C & | C, | ||
MAT_R & | R, | ||
bool | accumResultInOutput | ||
) |
void mrpt::math::multiply_skew3_A | ( | const SKEW_3VECTOR & | v, |
const MAT_A & | A, | ||
MAT_OUT & | out | ||
) |
Only for vectors/arrays "v" of length3, compute out = Skew(v) * A, where Skew(v) is the skew symmetric matric generated from v (see mrpt::math::skew_symmetric3)
Definition at line 190 of file ops_matrices.h.
References ASSERT_EQUAL_, MRPT_END, and MRPT_START.
Referenced by multiply_skew3_A().
double mrpt::math::ncc_vector | ( | const CONT1 & | patch1, |
const CONT2 & | patch2 | ||
) |
Normalised Cross Correlation between two vector patches The Matlab code for this is a = a - mean2(a); b = b - mean2(b); r = sum(sum(a.
*b))/sqrt(sum(sum(a.*a))*sum(sum(b.*b)));
Definition at line 412 of file ops_containers.h.
References ASSERT_, ASSERTMSG_, and mrpt::square().
|
inline |
Definition at line 134 of file ops_containers.h.
Referenced by mrpt::pbmap::Plane::calcConvexHullandParams(), mrpt::nav::collision_free_dist_arc_circ_robot(), mrpt::vision::pnp::ppnp::compute_pose(), mrpt::vision::pnp::rpnp::compute_pose(), mrpt::poses::CPoses2DSequence::computeTraveledDistanceAfter(), mrpt::poses::CPoses3DSequence::computeTraveledDistanceAfter(), mrpt::pbmap::SubgraphMatcher::evalBinaryConstraints(), mrpt::nav::CHolonomicFullEval::evalSingleTarget(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute(), mrpt::pbmap::getMultiDimMeanShift_color(), mrpt::poses::CPoseInterpolatorBase< 3 >::getPreviousPoseWithMinDistance(), mrpt::pbmap::PbMapMaker::mergePlanes(), mrpt::graphslam::optimize_graph_spa_levmarq(), ransac3Dplane_distance(), mrpt::vision::pnp::p3p::solve(), TEST(), and mrpt::pbmap::PbMapMaker::watchProperties().
|
inline |
Definition at line 129 of file ops_containers.h.
Referenced by mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute(), and mrpt::graphslam::optimize_graph_spa_levmarq().
CArchive & mrpt::math::operator<< | ( | mrpt::serialization::CArchive & | s, |
const mrpt::math::CVectorDouble & | a | ||
) |
CArchive & mrpt::math::operator<< | ( | mrpt::serialization::CArchive & | s, |
const mrpt::math::CVectorFloat & | a | ||
) |
mrpt::serialization::CArchive& mrpt::math::operator>> | ( | mrpt::serialization::CArchive & | in, |
CMatrix::Ptr & | pObj | ||
) |
mrpt::serialization::CArchive& mrpt::math::operator>> | ( | mrpt::serialization::CArchive & | in, |
CMatrixD::Ptr & | pObj | ||
) |
CArchive & mrpt::math::operator>> | ( | mrpt::serialization::CArchive & | in, |
mrpt::math::CVectorDouble & | a | ||
) |
Definition at line 619 of file math.cpp.
References mrpt::serialization::CArchive::ReadBufferFixEndianness().
CArchive & mrpt::math::operator>> | ( | mrpt::serialization::CArchive & | in, |
mrpt::math::CVectorFloat & | a | ||
) |
Definition at line 613 of file math.cpp.
References mrpt::serialization::CArchive::ReadBufferFixEndianness().
bool mrpt::math::ransac3Dplane_degenerate | ( | const CMatrixTemplateNumeric< T > & | allData, |
const std::vector< size_t > & | useIndices | ||
) |
Return "true" if the selected points are a degenerate (invalid) case.
Definition at line 94 of file ransac_applications.cpp.
References MRPT_UNUSED_PARAM.
void mrpt::math::ransac3Dplane_distance | ( | const CMatrixTemplateNumeric< T > & | allData, |
const vector< CMatrixTemplateNumeric< T >> & | testModels, | ||
const T | distanceThreshold, | ||
unsigned int & | out_bestModelIndex, | ||
std::vector< size_t > & | out_inlierIndices | ||
) |
Definition at line 60 of file ransac_applications.cpp.
References ASSERT_, mrpt::math::TPlane::coefs, and mrpt::math::TPlane::distance().
void mrpt::math::ransac3Dplane_fit | ( | const CMatrixTemplateNumeric< T > & | allData, |
const std::vector< size_t > & | useIndices, | ||
vector< CMatrixTemplateNumeric< T >> & | fitModels | ||
) |
Definition at line 26 of file ransac_applications.cpp.
References ASSERT_, and mrpt::math::TPlane::coefs.
|
static |
Copyright(C) 1997 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp). You may use, copy, modify this code for any purpose and without fee. You may distribute this ORIGINAL package.
-----— Real DFT / Inverse of Real DFT -----— [definition] <case1> RDFT R[k1][k2] = sum_j1=0^n1-1 sum_j2=0^n2-1 a[j1][j2] * cos(2*pi*j1*k1/n1 + 2*pi*j2*k2/n2), 0<=k1<n1, 0<=k2<n2 I[k1][k2] = sum_j1=0^n1-1 sum_j2=0^n2-1 a[j1][j2] * sin(2*pi*j1*k1/n1 + 2*pi*j2*k2/n2), 0<=k1<n1, 0<=k2<n2 <case2> IRDFT (excluding scale) a[k1][k2] = (1/2) * sum_j1=0^n1-1 sum_j2=0^n2-1 (R[j1][j2] * cos(2*pi*j1*k1/n1 + 2*pi*j2*k2/n2) + I[j1][j2] * sin(2*pi*j1*k1/n1 + 2*pi*j2*k2/n2)), 0<=k1<n1, 0<=k2<n2 (notes: R[n1-k1][n2-k2] = R[k1][k2], I[n1-k1][n2-k2] = -I[k1][k2], R[n1-k1][0] = R[k1][0], I[n1-k1][0] = -I[k1][0], R[0][n2-k2] = R[0][k2], I[0][n2-k2] = -I[0][k2], 0<k1<n1, 0<k2<n2) [usage] <case1> ip[0] = 0; // first time only rdft2d(n1, n2, 1, a, t, ip, w); <case2> ip[0] = 0; // first time only rdft2d(n1, n2, -1, a, t, ip, w); [parameters] n1 :data length (int) n1 >= 2, n1 = power of 2 n2 :data length (int) n2 >= 2, n2 = power of 2 a[0...n1-1][0...n2-1] :input/output data (FFT_TYPE **) <case1> output data a[k1][2*k2] = R[k1][k2] = R[n1-k1][n2-k2], a[k1][2*k2+1] = I[k1][k2] = -I[n1-k1][n2-k2], 0<k1<n1, 0<k2<n2/2, a[0][2*k2] = R[0][k2] = R[0][n2-k2], a[0][2*k2+1] = I[0][k2] = -I[0][n2-k2], 0<k2<n2/2, a[k1][0] = R[k1][0] = R[n1-k1][0], a[k1][1] = I[k1][0] = -I[n1-k1][0], a[n1-k1][1] = R[k1][n2/2] = R[n1-k1][n2/2], a[n1-k1][0] = -I[k1][n2/2] = I[n1-k1][n2/2], 0<k1<n1/2, a[0][0] = R[0][0], a[0][1] = R[0][n2/2], a[n1/2][0] = R[n1/2][0], a[n1/2][1] = R[n1/2][n2/2] <case2> input data a[j1][2*j2] = R[j1][j2] = R[n1-j1][n2-j2], a[j1][2*j2+1] = I[j1][j2] = -I[n1-j1][n2-j2], 0<j1<n1, 0<j2<n2/2, a[0][2*j2] = R[0][j2] = R[0][n2-j2], a[0][2*j2+1] = I[0][j2] = -I[0][n2-j2], 0<j2<n2/2, a[j1][0] = R[j1][0] = R[n1-j1][0], a[j1][1] = I[j1][0] = -I[n1-j1][0], a[n1-j1][1] = R[j1][n2/2] = R[n1-j1][n2/2], a[n1-j1][0] = -I[j1][n2/2] = I[n1-j1][n2/2], 0<j1<n1/2, a[0][0] = R[0][0], a[0][1] = R[0][n2/2], a[n1/2][0] = R[n1/2][0], a[n1/2][1] = R[n1/2][n2/2] t[0...2*n1-1] :work area (FFT_TYPE *) ip[0...*] :work area for bit reversal (int *) length of ip >= 2+sqrt(n) ; if n % 4 == 0 2+sqrt(n/2); otherwise (n = max(n1, n2/2)) ip[0],ip[1] are pointers of the cos/sin table. w[0...*] :cos/sin table (FFT_TYPE *) length of w >= max(n1/2, n2/4) + n2/4 w[],ip[] are initialized if ip[0] == 0. [remark] Inverse of rdft2d(n1, n2, 1, a, t, ip, w); is rdft2d(n1, n2, -1, a, t, ip, w); for (j1 = 0; j1 <= n1 - 1; j1++) { for (j2 = 0; j2 <= n2 - 1; j2++) { a[j1][j2] *= 2.0 / (n1 * n2); } }
Definition at line 736 of file fourier.cpp.
References cdft(), makect(), makewt(), and rdft().
Referenced by dft2_real(), and idft2_real().
|
static |
|
inline |
Definition at line 964 of file lightweight_geom_data.cpp.
References distance(), and getEpsilon().
Referenced by mrpt::math::TPolygon2D::removeRepeatedVertices(), and mrpt::math::TPolygon3D::removeRepeatedVertices().
|
inline |
Definition at line 932 of file lightweight_geom_data.cpp.
References distance(), and getEpsilon().
Referenced by mrpt::math::TPolygon2D::removeRedundantVertices(), and mrpt::math::TPolygon3D::removeRedundantVertices().
void mrpt::math::resizeLike | ( | EIGEN_CONTAINER & | trg, |
const EIGEN_CONTAINER & | src | ||
) |
Definition at line 84 of file ops_containers.h.
Referenced by cumsum_tmpl().
void mrpt::math::resizeLike | ( | std::vector< T > & | trg, |
const std::vector< T > & | src | ||
) |
Definition at line 89 of file ops_containers.h.
Definition at line 613 of file fourier.cpp.
Referenced by rdft().
Definition at line 544 of file fourier.cpp.
Referenced by rdft().
|
inline |
Returns the size of the matrix in the i'th dimension: 1=rows, 2=columns (MATLAB-compatible function)
Definition at line 23 of file math/include/mrpt/math/bits_math.h.
References THROW_EXCEPTION_FMT.
Referenced by mrpt::math::TPolygon2D::contains(), mrpt::math::TPolygon2D::getAsSegmentList(), mrpt::math::TPolygon3D::getAsSegmentList(), mrpt::math::TPolygon2D::getBoundingBox(), mrpt::math::TPolygon2D::getCenter(), mrpt::math::TPolygon3D::getCenter(), mrpt::math::TPolygon2D::getPlotData(), mrpt::math::TPolygon2D::isConvex(), mrpt::tfest::TMatchingPairList::overallSquareError(), mrpt::tfest::TMatchingPairList::overallSquareErrorAndPoints(), and mrpt::tfest::TMatchingPairList::squareErrorVector().
|
inline |
Compute the square norm of anything implementing [].
Definition at line 181 of file ops_containers.h.
References mrpt::square().
VALUE mrpt::math::squareNorm_accum | ( | const VALUE | total, |
const CONTAINER & | v | ||
) |
Accumulate the squared-norm of a vector/array/matrix into "total" (this function is compatible with std::accumulate).
Definition at line 173 of file ops_containers.h.
|
inline |
Computes the standard deviation of a vector.
v | The set of data |
unbiased | If set to true or false the std is normalized by "N-1" or "N", respectively. |
Definition at line 336 of file ops_containers.h.
References meanAndStd().
Referenced by mrpt::pbmap::getHistogramMeanShift().
|
inline |
Computes the sum of all the elements.
Definition at line 211 of file ops_containers.h.
Referenced by mrpt::vision::CDifodo::buildCoordinatesPyramid(), mrpt::vision::CDifodo::buildCoordinatesPyramidFast(), Pose3DTests::check_jacob_LnT_T(), mrpt::detectors::CFaceDetection::checkIfFaceRegions(), mrpt::vision::computeHistogramOfOrientations(), mrpt::nav::CHolonomicND::evaluateGaps(), mrpt::detectors::CFaceDetection::experimental_viewFacePointsAndEigenVects(), mrpt::pbmap::getHistogramMeanShift(), mrpt::pbmap::getMultiDimMeanShift_color(), mrpt::graphslam::detail::CEdgeCounter::getTotalNumOfEdges(), mrpt::slam::CICP::ICP_Method_LM(), mrpt::vision::pnp::p3p::jacobi_4x4(), mean(), meanAndStd(), meanAndStd(), meanAndStdAll(), noncentralChi2PDF_CDF(), mrpt::vision::reprojectionResiduals(), reprojectionResidualsElement(), run_test_so3_avrg(), mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration(), TEST(), Pose3DQuatTests::test_composePointJacob(), Pose3DTests::test_composePointJacob(), Pose3DTests::test_composePointJacob_se3(), QuaternionTests::test_ExpAndLnMatches(), TEST_F(), QuaternionTests::test_gimbalLock(), Pose3DQuatTests::test_invComposePointJacob(), Pose3DTests::test_invComposePointJacob(), Pose3DTests::test_invComposePointJacob_se3(), Pose3DTests::test_inverse(), SE_traits_tests< POSE_TYPE >::test_jacobs_P1DP2inv(), QuaternionTests::test_lnAndExpMatches(), Pose3DQuatTests::test_normalizeJacob(), Pose3DQuatTests::test_sphericalCoords(), Pose3DQuatPDFGaussTests::testCompositionJacobian(), Pose3DPDFGaussTests::testCompositionJacobian(), and mrpt::graphs::ScalarFactorGraph::updateEstimation().
|
inline |
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 218 of file ops_containers.h.
|
inline |
Computes the sum of all the elements, with a custom return type.
Definition at line 226 of file ops_containers.h.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST |