Main MRPT website > C++ reference
MRPT logo
Classes | Functions
Interpolation, least-squares fit, splines

Detailed Description

Collaboration diagram for Interpolation, least-squares fit, splines:

Classes

class  mrpt::math::CSplineInterpolator1D
 A (persistent) sequence of (x,y) coordinates, allowing queries of intermediate points through spline interpolation, where possible. More...
 
class  mrpt::poses::CPose3DInterpolator
 A trajectory in time and in 6D (CPose3D) that interpolates using splines the intervals between a set of given time-referenced poses. More...
 

Functions

template<class T , class VECTOR >
mrpt::math::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 BASE_IMPEXP mrpt::math::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...
 
double BASE_IMPEXP mrpt::math::spline (const double t, const vector_double &x, const vector_double &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 >
NUMTYPE mrpt::math::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 >
void mrpt::math::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...
 

Function Documentation

◆ interpolate()

template<class T , class VECTOR >
T mrpt::math::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".

If the point "x" is out of the range [x0,x1], the closest extreme "ys" value is returned.

See also
spline, interpolate2points

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

References ASSERT_, MRPT_END, and MRPT_START.

◆ interpolate2points()

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

If wrap2pi is true, output is wrapped to ]-pi,pi] (It is assumed that input "y" values already are in the correct range).

See also
spline, interpolate, leastSquareLinearFit

◆ leastSquareLinearFit() [1/2]

template<typename NUMTYPE , class VECTORLIKE >
NUMTYPE mrpt::math::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".

The vectors x and y must have size >=2, and all values of "x" must be different. 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).

See also
spline
getRegressionLine, getRegressionPlane

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

References ASSERT_, MRPT_END, MRPT_START, t(), and mrpt::math::wrapToPi().

◆ leastSquareLinearFit() [2/2]

template<class VECTORLIKE1 , class VECTORLIKE2 , class VECTORLIKE3 >
void mrpt::math::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".

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).

See also
spline, getRegressionLine, getRegressionPlane

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

References ASSERT_, MRPT_END, MRPT_START, and mrpt::math::wrapToPi().

◆ spline()

double BASE_IMPEXP mrpt::math::spline ( const double  t,
const vector_double x,
const vector_double 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).

See also
leastSquareLinearFit



Page generated by Doxygen 1.8.14 for MRPT 1.0.2 SVN: at lun oct 28 00:52:41 CET 2019 Hosted on:
SourceForge.net Logo