MRPT  2.0.2
Namespaces | Files | Functions
Vector and matrices mathematical operations

Detailed Description

and other utilities

Collaboration diagram for Vector and matrices mathematical operations:

Namespaces

 mrpt::math
 This base provides a set of functions for maths stuff.
 

Files

file  ops_containers.h
 This file implements several operations that operate element-wise on individual or pairs of containers.
 

Functions

template<class T >
std::ostream & mrpt::math::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 & mrpt::math::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::CArchivemrpt::math::operator<< (mrpt::serialization::CArchive &ostrm, const CVectorFixed< T, N > &a)
 Binary dump of a CVectorFixed<T,N> to a stream. More...
 
template<typename T , size_t N>
mrpt::serialization::CArchivemrpt::math::operator>> (mrpt::serialization::CArchive &istrm, CVectorFixed< T, N > &a)
 Binary read of a CVectorFixed<T,N> from a stream. More...
 
bool mrpt::math::loadVector (std::istream &f, std::vector< int > &d)
 Loads one row of a text file as a numerical std::vector. More...
 
bool mrpt::math::loadVector (std::istream &f, std::vector< double > &d)
 Loads one row of a text file as a numerical std::vector. More...
 
void mrpt::math::medianFilter (const std::vector< double > &inV, std::vector< double > &outV, int winSize, int numberOfSigmas=2)
 
template<typename T , typename VECTOR >
void mrpt::math::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 > mrpt::math::sequenceStdVec (T first, size_t length)
 Generates a sequence of values [first,first+STEP,first+2*STEP,...]. More...
 
template<class VEC1 , class VEC2 >
void mrpt::math::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 mrpt::math::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 mrpt::math::factorial64 (unsigned int n)
 Computes the factorial of an integer number and returns it as a 64-bit integer number. More...
 
double mrpt::math::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...
 
template<typename VECTOR_T , typename At , size_t N>
VECTOR_T & mrpt::math::loadVector (VECTOR_T &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 > & mrpt::math::loadVector (std::vector< T > &v, At(&theArray)[N])
 
template<class T >
void mrpt::math::wrapTo2PiInPlace (T &a)
 Modifies the given angle to translate it into the [0,2pi[ range. More...
 
template<class T >
mrpt::math::wrapTo2Pi (T a)
 Modifies the given angle to translate it into the [0,2pi[ range. More...
 
template<class T >
mrpt::math::wrapToPi (T a)
 Modifies the given angle to translate it into the ]-pi,pi] range. More...
 
template<class T >
void mrpt::math::wrapToPiInPlace (T &a)
 Modifies the given angle to translate it into the ]-pi,pi] range. More...
 
template<class VECTOR >
void mrpt::math::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 >
mrpt::math::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...
 

Operators for binary streaming of MRPT matrices

template<size_t NROWS, size_t NCOLS>
mrpt::serialization::CArchivemrpt::math::operator>> (mrpt::serialization::CArchive &in, CMatrixFixed< float, NROWS, NCOLS > &M)
 Read operator from a CStream. More...
 
template<size_t NROWS, size_t NCOLS>
mrpt::serialization::CArchivemrpt::math::operator>> (mrpt::serialization::CArchive &in, CMatrixFixed< double, NROWS, NCOLS > &M)
 Read operator from a CStream. More...
 
template<size_t NROWS, size_t NCOLS>
mrpt::serialization::CArchivemrpt::math::operator<< (mrpt::serialization::CArchive &out, const CMatrixFixed< float, NROWS, NCOLS > &M)
 Write operator for writing into a CStream. More...
 
template<size_t NROWS, size_t NCOLS>
mrpt::serialization::CArchivemrpt::math::operator<< (mrpt::serialization::CArchive &out, const CMatrixFixed< double, NROWS, NCOLS > &M)
 Write operator for writing into a CStream. More...
 

Operators for text streaming of MRPT matrices

template<typename MAT >
void mrpt::math::deserializeSymmetricMatrixFrom (MAT &m, mrpt::serialization::CArchive &in)
 Binary serialization of symmetric matrices, saving the space of duplicated values. More...
 
template<typename MAT >
void mrpt::math::serializeSymmetricMatrixTo (MAT &m, mrpt::serialization::CArchive &out)
 Binary serialization of symmetric matrices, saving the space of duplicated values. More...
 

Generic std::vector element-wise operations

template<typename T1 , typename T2 >
std::vector< T1 > & mrpt::math::operator*= (std::vector< T1 > &a, const std::vector< T2 > &b)
 a*=b (element-wise multiplication) More...
 
template<typename T1 >
std::vector< T1 > & mrpt::math::operator*= (std::vector< T1 > &a, const T1 b)
 a*=k (multiplication by a constant) More...
 
template<typename T1 , typename T2 >
std::vector< T1 > mrpt::math::operator* (const std::vector< T1 > &a, const std::vector< T2 > &b)
 a*b (element-wise multiplication) More...
 
template<typename T1 , typename T2 >
std::vector< T1 > & mrpt::math::operator+= (std::vector< T1 > &a, const std::vector< T2 > &b)
 a+=b (element-wise sum) More...
 
template<typename T1 >
std::vector< T1 > & mrpt::math::operator+= (std::vector< T1 > &a, const T1 b)
 a+=b (sum a constant) More...
 
template<typename T1 , typename T2 >
std::vector< T1 > mrpt::math::operator+ (const std::vector< T1 > &a, const std::vector< T2 > &b)
 a+b (element-wise sum) More...
 
template<typename T1 , typename T2 >
std::vector< T1 > mrpt::math::operator- (const std::vector< T1 > &v1, const std::vector< T2 > &v2)
 

Function Documentation

◆ angDistance()

template<class T >
T mrpt::math::angDistance ( from,
to 
)
inline

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.

near +-pi) Examples: angDistance(0,pi) -> +pi; angDistance(pi,0) -> -pi; angDistance(-3.1,3.1) -> -0.08; angDistance(3.1,-3.1) -> +0.08;

Note
Take care of not instancing this template for integer numbers, since it only works for float, double and long double.
See also
wrapToPi, wrapTo2Pi

Definition at line 95 of file wrap2pi.h.

References M_PI, and mrpt::math::wrapToPiInPlace().

Referenced by mrpt::nav::CAbstractPTGBasedReactive::calc_move_candidate_scores(), mrpt::nav::PoseDistanceMetric< TNodeSE2 >::distance(), mrpt::nav::CParameterizedTrajectoryGenerator::evalClearanceSingleObstacle(), mrpt::obs::CObservationRotatingScan::fromVelodyne(), mrpt::nav::CParameterizedTrajectoryGenerator::getPathTwist(), mrpt::poses::CPoseInterpolatorBase< 3 >::impl_interpolation(), mrpt::nav::PlannerRRT_SE2_TPS::solve(), TEST(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deserializeSymmetricMatrixFrom()

template<typename MAT >
void mrpt::math::deserializeSymmetricMatrixFrom ( MAT &  m,
mrpt::serialization::CArchive in 
)

Binary serialization of symmetric matrices, saving the space of duplicated values.

See also
serializeSymmetricMatrixTo()

Definition at line 95 of file matrix_serialization.h.

References ASSERT_EQUAL_.

Referenced by mrpt::poses::CPosePDFGaussian::serializeFrom(), mrpt::poses::CPointPDFSOG::serializeFrom(), mrpt::poses::CPosePDFSOG::serializeFrom(), mrpt::poses::CPose3DPDFGaussian::serializeFrom(), mrpt::poses::CPose3DPDFGaussianInf::serializeFrom(), and mrpt::poses::CPose3DQuatPDFGaussian::serializeFrom().

Here is the caller graph for this function:

◆ extractColumnFromVectorOfVectors()

template<class VECTOR_OF_VECTORS , class VECTORLIKE >
void mrpt::math::extractColumnFromVectorOfVectors ( const size_t  colIndex,
const VECTOR_OF_VECTORS &  data,
VECTORLIKE &  out_column 
)
inline

Extract a column from a vector of vectors, and store it in another vector.

  • Input data can be: std::vector<mrpt::math::CVectorDouble>, std::deque<std::list<double> >, std::list<CVectorFixedDouble<5> >, etc. etc.
  • Output is the sequence: data[0][idx],data[1][idx],data[2][idx], etc..

For the sake of generality, this function does NOT check the limits in the number of column, unless it's implemented in the [] operator of each of the "rows".

Definition at line 145 of file math/include/mrpt/math/utils.h.

References mrpt::opengl::internal::data.

◆ factorial()

double mrpt::math::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).

Definition at line 68 of file math.cpp.

Referenced by cos_Asymptotic_Series(), Power_Series_C(), Power_Series_S(), and sin_Asymptotic_Series().

Here is the caller graph for this function:

◆ factorial64()

uint64_t mrpt::math::factorial64 ( unsigned int  n)

Computes the factorial of an integer number and returns it as a 64-bit integer number.

Definition at line 56 of file math.cpp.

◆ linspace()

template<typename T , typename VECTOR >
void mrpt::math::linspace ( first,
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.

See also
sequence

Definition at line 84 of file math/include/mrpt/math/utils.h.

Referenced by mrpt::math::CHistogram::getHistogram(), mrpt::math::CHistogram::getHistogramNormalized(), and mrpt::tfest::se3_l2_robust().

Here is the caller graph for this function:

◆ loadVector() [1/4]

bool mrpt::math::loadVector ( std::istream &  f,
std::vector< int > &  d 
)

Loads one row of a text file as a numerical std::vector.

Returns
false on EOF or invalid format. The body of the function is implemented in MATH.cpp

◆ loadVector() [2/4]

bool mrpt::math::loadVector ( std::istream &  f,
std::vector< double > &  d 
)

Loads one row of a text file as a numerical std::vector.

Returns
false on EOF or invalid format. The body of the function is implemented in MATH.cpp

◆ loadVector() [3/4]

template<typename VECTOR_T , typename At , size_t N>
VECTOR_T& mrpt::math::loadVector ( VECTOR_T &  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).

const double numbers[] = { 1,2,3,5,6,7,8,9,10 };
loadVector( v, numbers );
Note
This operator performs the appropiate type castings, if required.

Definition at line 202 of file math/include/mrpt/math/utils.h.

◆ loadVector() [4/4]

template<typename T , typename At , size_t N>
std::vector<T>& mrpt::math::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.

Definition at line 212 of file math/include/mrpt/math/utils.h.

◆ medianFilter()

void mrpt::math::medianFilter ( const std::vector< double > &  inV,
std::vector< double > &  outV,
int  winSize,
int  numberOfSigmas = 2 
)

◆ normalize()

template<class VEC1 , class VEC2 >
void mrpt::math::normalize ( const VEC1 &  v,
VEC2 &  out_v 
)

Normalize a vector, such as its norm is the unity.

If the vector has a null norm, the output is a null vector.

Definition at line 120 of file math/include/mrpt/math/utils.h.

References mrpt::square().

Here is the call graph for this function:

◆ operator*()

template<typename T1 , typename T2 >
std::vector<T1> mrpt::math::operator* ( const std::vector< T1 > &  a,
const std::vector< T2 > &  b 
)
inline

a*b (element-wise multiplication)

Definition at line 50 of file ops_vectors.h.

References ASSERT_EQUAL_.

◆ operator*=() [1/2]

template<typename T1 , typename T2 >
std::vector<T1>& mrpt::math::operator*= ( std::vector< T1 > &  a,
const std::vector< T2 > &  b 
)
inline

a*=b (element-wise multiplication)

Definition at line 31 of file ops_vectors.h.

References ASSERT_EQUAL_.

◆ operator*=() [2/2]

template<typename T1 >
std::vector<T1>& mrpt::math::operator*= ( std::vector< T1 > &  a,
const T1  b 
)
inline

a*=k (multiplication by a constant)

Definition at line 41 of file ops_vectors.h.

◆ operator+()

template<typename T1 , typename T2 >
std::vector<T1> mrpt::math::operator+ ( const std::vector< T1 > &  a,
const std::vector< T2 > &  b 
)
inline

a+b (element-wise sum)

Definition at line 81 of file ops_vectors.h.

References ASSERT_EQUAL_.

◆ operator+=() [1/2]

template<typename T1 , typename T2 >
std::vector<T1>& mrpt::math::operator+= ( std::vector< T1 > &  a,
const std::vector< T2 > &  b 
)
inline

a+=b (element-wise sum)

Definition at line 62 of file ops_vectors.h.

References ASSERT_EQUAL_.

◆ operator+=() [2/2]

template<typename T1 >
std::vector<T1>& mrpt::math::operator+= ( std::vector< T1 > &  a,
const T1  b 
)
inline

a+=b (sum a constant)

Definition at line 72 of file ops_vectors.h.

◆ operator-()

template<typename T1 , typename T2 >
std::vector<T1> mrpt::math::operator- ( const std::vector< T1 > &  v1,
const std::vector< T2 > &  v2 
)
inline

Definition at line 92 of file ops_vectors.h.

References ASSERT_EQUAL_.

◆ operator<<() [1/5]

template<size_t NROWS, size_t NCOLS>
mrpt::serialization::CArchive& mrpt::math::operator<< ( mrpt::serialization::CArchive out,
const CMatrixFixed< float, NROWS, NCOLS > &  M 
)

Write operator for writing into a CStream.

The format is compatible with that of CMatrixF & CMatrixD

Definition at line 65 of file matrix_serialization.h.

References out.

◆ operator<<() [2/5]

template<size_t NROWS, size_t NCOLS>
mrpt::serialization::CArchive& mrpt::math::operator<< ( mrpt::serialization::CArchive out,
const CMatrixFixed< double, NROWS, NCOLS > &  M 
)

Write operator for writing into a CStream.

The format is compatible with that of CMatrixF & CMatrixD

Definition at line 77 of file matrix_serialization.h.

References out.

◆ operator<<() [3/5]

template<class T >
std::ostream& mrpt::math::operator<< ( std::ostream &  out,
const std::vector< T > &  d 
)

A template function for printing out the contents of a std::vector variable.

Definition at line 106 of file ops_vectors.h.

References out.

◆ operator<<() [4/5]

template<class T >
std::ostream& mrpt::math::operator<< ( std::ostream &  out,
std::vector< T > *  d 
)

A template function for printing out the contents of a std::vector variable.

Definition at line 121 of file ops_vectors.h.

References out.

◆ operator<<() [5/5]

template<typename T , size_t N>
mrpt::serialization::CArchive& mrpt::math::operator<< ( mrpt::serialization::CArchive ostrm,
const CVectorFixed< T, N > &  a 
)

Binary dump of a CVectorFixed<T,N> to a stream.

Definition at line 135 of file ops_vectors.h.

References mrpt::serialization::CArchive::WriteBufferFixEndianness().

Here is the call graph for this function:

◆ operator>>() [1/3]

template<size_t NROWS, size_t NCOLS>
mrpt::serialization::CArchive& mrpt::math::operator>> ( mrpt::serialization::CArchive in,
CMatrixFixed< float, NROWS, NCOLS > &  M 
)

Read operator from a CStream.

The format is compatible with that of CMatrixF & CMatrixD

Definition at line 30 of file matrix_serialization.h.

References ASSERTMSG_, mrpt::math::CMatrixFixed< T, ROWS, COLS >::cols(), mrpt::math::CMatrixDynamic< T >::cols(), mrpt::format(), mrpt::serialization::CArchive::ReadObject(), mrpt::math::CMatrixFixed< T, ROWS, COLS >::rows(), and mrpt::math::CMatrixDynamic< T >::rows().

Here is the call graph for this function:

◆ operator>>() [2/3]

template<size_t NROWS, size_t NCOLS>
mrpt::serialization::CArchive& mrpt::math::operator>> ( mrpt::serialization::CArchive in,
CMatrixFixed< double, NROWS, NCOLS > &  M 
)

Read operator from a CStream.

The format is compatible with that of CMatrixF & CMatrixD

Definition at line 47 of file matrix_serialization.h.

References ASSERTMSG_, mrpt::math::CMatrixFixed< T, ROWS, COLS >::cols(), mrpt::math::CMatrixDynamic< T >::cols(), mrpt::format(), mrpt::serialization::CArchive::ReadObject(), mrpt::math::CMatrixFixed< T, ROWS, COLS >::rows(), and mrpt::math::CMatrixDynamic< T >::rows().

Here is the call graph for this function:

◆ operator>>() [3/3]

template<typename T , size_t N>
mrpt::serialization::CArchive& mrpt::math::operator>> ( mrpt::serialization::CArchive istrm,
CVectorFixed< T, N > &  a 
)

Binary read of a CVectorFixed<T,N> from a stream.

Definition at line 145 of file ops_vectors.h.

References ASSERTMSG_, mrpt::format(), and mrpt::serialization::CArchive::ReadBufferFixEndianness().

Here is the call graph for this function:

◆ sequenceStdVec()

template<class T , T STEP>
std::vector<T> mrpt::math::sequenceStdVec ( first,
size_t  length 
)
inline

Generates a sequence of values [first,first+STEP,first+2*STEP,...].

See also
linspace, sequence

Definition at line 103 of file math/include/mrpt/math/utils.h.

◆ serializeSymmetricMatrixTo()

template<typename MAT >
void mrpt::math::serializeSymmetricMatrixTo ( MAT &  m,
mrpt::serialization::CArchive out 
)

Binary serialization of symmetric matrices, saving the space of duplicated values.

See also
deserializeSymmetricMatrixFrom()

Definition at line 114 of file matrix_serialization.h.

References ASSERT_EQUAL_, and out.

Referenced by mrpt::poses::CPosePDFGaussian::serializeTo(), mrpt::poses::CPointPDFSOG::serializeTo(), mrpt::poses::CPosePDFSOG::serializeTo(), mrpt::poses::CPose3DPDFGaussian::serializeTo(), mrpt::poses::CPose3DPDFGaussianInf::serializeTo(), and mrpt::poses::CPose3DQuatPDFGaussian::serializeTo().

Here is the caller graph for this function:

◆ unwrap2PiSequence()

template<class VECTOR >
void mrpt::math::unwrap2PiSequence ( VECTOR &  x)

Modify a sequence of angle values such as no consecutive values have a jump larger than PI in absolute value.

See also
wrapToPi

Definition at line 71 of file wrap2pi.h.

References M_PI, and mrpt::math::wrapToPiInPlace().

Referenced by mrpt::poses::CPoseInterpolatorBase< 3 >::impl_interpolation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wrapTo2Pi()

template<class T >
T mrpt::math::wrapTo2Pi ( a)
inline

Modifies the given angle to translate it into the [0,2pi[ range.

Note
Take care of not instancing this template for integer numbers, since it only works for float, double and long double.
See also
wrapToPi, wrapTo2Pi, unwrap2PiSequence

Definition at line 38 of file wrap2pi.h.

References mrpt::math::wrapTo2PiInPlace().

Referenced by mrpt::nav::collision_free_dist_arc_circ_robot(), mrpt::obs::CObservation2DRangeScan::filterByExclusionAngles(), mrpt::math::operator!=(), mrpt::math::operator==(), and mrpt::math::wrapToPi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wrapTo2PiInPlace()

template<class T >
void mrpt::math::wrapTo2PiInPlace ( T &  a)
inline

Modifies the given angle to translate it into the [0,2pi[ range.

Note
Take care of not instancing this template for integer numbers, since it only works for float, double and long double.
See also
wrapToPi, wrapTo2Pi, unwrap2PiSequence

Definition at line 25 of file wrap2pi.h.

References M_PI.

Referenced by mrpt::nav::CPTG_DiffDrive_C::inverseMap_WS2TP(), and mrpt::math::wrapTo2Pi().

Here is the caller graph for this function:

◆ wrapToPi()

template<class T >
T mrpt::math::wrapToPi ( a)
inline

Modifies the given angle to translate it into the ]-pi,pi] range.

Note
Take care of not instancing this template for integer numbers, since it only works for float, double and long double.
See also
wrapTo2Pi, wrapToPiInPlace, unwrap2PiSequence

Definition at line 50 of file wrap2pi.h.

References M_PI, and mrpt::math::wrapTo2Pi().

Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::accumulateAngleDiffs(), mrpt::nav::CParameterizedTrajectoryGenerator::alpha2index(), mrpt::graphs::detail::graph_ops< graph_t >::auxEuclid2Dist(), mrpt::graphslam::deciders::CFixedIntervalsNRD< GRAPH_T >::checkRegistrationCondition(), mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::checkRegistrationCondition(), mrpt::graphslam::deciders::CIncrementalNodeRegistrationDecider< GRAPH_T >::checkRegistrationConditionPose(), mrpt::poses::CPose2D::composeFrom(), mrpt::obs::CActionRobotMovement2D::computeFromOdometry_modelThrun(), mrpt::math::covariancesAndMeanWeighted(), mrpt::nav::CHolonomicND::direction2sector(), mrpt::nav::CHolonomicFullEval::direction2sector(), mrpt::poses::CPose3D::distanceEuclidean6D(), mrpt::poses::CPose3DPDFGaussianInf::drawManySamples(), mrpt::poses::CPose3DPDFGaussian::drawManySamples(), mrpt::obs::CActionRobotMovement2D::drawSingleSample_modelThrun(), mrpt::poses::CPosePDFParticles::evaluatePDF_parzen(), mrpt::math::getAngle(), mrpt::poses::CPose3DPDFParticles::getCovarianceAndMean(), mrpt::poses::CPosePDFParticles::getCovarianceAndMean(), mrpt::obs::CObservationBearingRange::getDescriptionAsText(), mrpt::slam::CICP::ICP3D_Method_Classic(), mrpt::slam::CICP::ICP_Method_Classic(), mrpt::slam::CICP::ICP_Method_LM(), mrpt::maps::CLandmarksMap::internal_computeObservationLikelihood(), mrpt::kinematics::CVehicleSimul_Holo::internal_simulControlStep(), mrpt::math::interpolate2points(), mrpt::poses::CPose2D::inverseComposeFrom(), mrpt::poses::CPose3D::isHorizontal(), mrpt::math::leastSquareLinearFit(), mrpt::math::TPose2D::normalizePhi(), mrpt::poses::CPose2D::normalizePhi(), mrpt::slam::CRangeBearingKFSLAM2D::OnObservationModel(), mrpt::math::TPose2D::operator+(), mrpt::math::TPose2D::operator-(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::processOneLMH(), mrpt::hwdrivers::CNTRIPClient::retrieveListOfMountpoints(), mrpt::apps::CGridMapAlignerApp::run(), run_test_so2_avrg(), mrpt::tfest::se2_l2_robust(), mrpt::poses::CPose3D::setFromValues(), mrpt::maps::CLandmarksMap::simulateRangeBearingReadings(), mrpt::math::spline(), and mrpt::math::wrapToPiInPlace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wrapToPiInPlace()

template<class T >
void mrpt::math::wrapToPiInPlace ( T &  a)
inline

Modifies the given angle to translate it into the ]-pi,pi] range.

Note
Take care of not instancing this template for integer numbers, since it only works for float, double and long double.
See also
wrapToPi,wrapTo2Pi, unwrap2PiSequence

Definition at line 61 of file wrap2pi.h.

References mrpt::math::wrapToPi().

Referenced by mrpt::math::angDistance(), mrpt::graphs::detail::graph_ops< graph_t >::auxMaha2Dist(), mrpt::poses::CPosePDFGaussian::drawManySamples(), mrpt::poses::CPosePDFGaussianInf::drawManySamples(), mrpt::poses::CPosePDFGaussian::mahalanobisDistanceTo(), mrpt::poses::CPosePDFGaussianInf::mahalanobisDistanceTo(), mrpt::poses::CPosePDFSOG::mergeModes(), mrpt::slam::CRangeBearingKFSLAM2D::OnNormalizeStateVector(), mrpt::slam::CRangeBearingKFSLAM2D::OnSubstractObservationVectors(), mrpt::slam::CRangeBearingKFSLAM::OnSubstractObservationVectors(), mrpt::kinematics::CVehicleSimulVirtualBase::simulateOneTimeStep(), mrpt::nav::PlannerRRT_SE2_TPS::solve(), and mrpt::math::unwrap2PiSequence().

Here is the call graph for this function:
Here is the caller graph for this function:



Page generated by Doxygen 1.8.14 for MRPT 2.0.2 Git: 9b4fd2465 Mon May 4 16:59:08 2020 +0200 at lun may 4 17:26:07 CEST 2020