curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate > Class Template Reference

Represents a constant_curve curve, always returning the same value and a null derivative. More...

#include <curves/constant_curve.h>

Inheritance diagram for curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >:
Collaboration diagram for curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >:

Public Types

typedef Point point_t
 
typedef Point_derivate point_derivate_t
 
typedef Time time_t
 
typedef Numeric num_t
 
typedef constant_curve< Time, Numeric, Safe, Point, Point_derivate > constant_curve_t
 
typedef constant_curve< Time, Numeric, Safe, Point_derivate > curve_derivate_t
 
typedef curve_abc< Time, Numeric, Safe, point_t, Point_derivate > curve_abc_t
 
- Public Types inherited from curves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >
typedef Point point_t
 
typedef Point_derivate point_derivate_t
 
typedef Time time_t
 
typedef Numeric num_t
 
typedef curve_abc< Time, Numeric, Safe, point_t, point_derivate_tcurve_t
 
typedef curve_abc< Time, Numeric, Safe, point_derivate_tcurve_derivate_t
 
typedef boost::shared_ptr< curve_tcurve_ptr_t
 

Public Member Functions

 constant_curve ()
 Empty constructor. Curve obtained this way can not perform other class functions. More...
 
 constant_curve (const Point &value, const time_t T_min=0., const time_t T_max=std::numeric_limits< time_t >::max())
 Constructor.. More...
 
 constant_curve (const constant_curve_t &other)
 Copy constructor. More...
 
virtual ~constant_curve ()
 Destructor. More...
 
virtual point_t operator() (const time_t t) const
 Evaluation of the cubic spline at time t. More...
 
curve_derivate_t compute_derivate () const
 Compute the derived curve at order N. Computes the derivative order N, $\frac{d^Nx(t)}{dt^N}$ of bezier curve of parametric equation x(t). More...
 
virtual curve_derivate_tcompute_derivate_ptr (const std::size_t) const
 Compute the derived curve at order N. More...
 
virtual point_derivate_t derivate (const time_t t, const std::size_t) const
 Evaluate the derivative of order N of curve at time t. More...
 
virtual bool isApprox (const constant_curve_t &other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const
 isApprox check if other and *this are approximately equals given a precision treshold Only two curves of the same class can be approximately equals, for comparison between different type of curves see isEquivalent. More...
 
virtual bool isApprox (const curve_abc_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const
 
virtual bool operator== (const constant_curve_t &other) const
 
virtual bool operator!= (const constant_curve_t &other) const
 
virtual std::size_t dim () const
 Get dimension of curve. More...
 
virtual num_t min () const
 Get the minimum time for which the curve is defined. More...
 
virtual num_t max () const
 Get the maximum time for which the curve is defined. More...
 
virtual std::size_t degree () const
 Get the degree of the curve. More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
- Public Member Functions inherited from curves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >
 curve_abc ()
 Constructor. More...
 
virtual ~curve_abc ()
 Destructor. More...
 
bool isEquivalent (const curve_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision(), const size_t order=5) const
 isEquivalent check if other and *this are approximately equal by values, given a precision treshold. This test is done by discretizing both curves and evaluating them and their derivatives. More...
 
virtual bool isApprox (const curve_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const =0
 isApprox check if other and *this are approximately equal given a precision treshold Only two curves of the same class can be approximately equal, for comparison between different type of curves see isEquivalent. More...
 
std::pair< time_t, time_ttimeRange ()
 
template<class Archive >
void serialize (Archive &, const unsigned int version)
 

Public Attributes

Point value_
 
time_t T_min_
 
time_t T_max_
 
std::size_t dim_
 

Friends

class boost::serialization::access
 

Detailed Description

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
class curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >

Represents a constant_curve curve, always returning the same value and a null derivative.

Member Typedef Documentation

◆ constant_curve_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
typedef constant_curve<Time, Numeric, Safe, Point, Point_derivate> curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::constant_curve_t

◆ curve_abc_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
typedef curve_abc<Time, Numeric, Safe, point_t, Point_derivate> curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::curve_abc_t

◆ curve_derivate_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
typedef constant_curve<Time, Numeric, Safe, Point_derivate> curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::curve_derivate_t

◆ num_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
typedef Numeric curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::num_t

◆ point_derivate_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
typedef Point_derivate curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::point_derivate_t

◆ point_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
typedef Point curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::point_t

◆ time_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
typedef Time curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::time_t

Constructor & Destructor Documentation

◆ constant_curve() [1/3]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::constant_curve ( )
inline

Empty constructor. Curve obtained this way can not perform other class functions.

◆ constant_curve() [2/3]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::constant_curve ( const Point &  value,
const time_t  T_min = 0.,
const time_t  T_max = std::numeric_limits<time_t>::max() 
)
inline

Constructor..

Parameters
value: The constant value
T_min: lower bound of the time interval
T_max: upper bound of the time interval

◆ constant_curve() [3/3]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::constant_curve ( const constant_curve_t other)
inline

Copy constructor.

Parameters
other

◆ ~constant_curve()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::~constant_curve ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ compute_derivate()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
curve_derivate_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::compute_derivate ( ) const
inline

Compute the derived curve at order N. Computes the derivative order N, $\frac{d^Nx(t)}{dt^N}$ of bezier curve of parametric equation x(t).

Parameters
order: order of derivative.
Returns
$\frac{d^Nx(t)}{dt^N}$ derivative order N of the curve.

◆ compute_derivate_ptr()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual curve_derivate_t* curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::compute_derivate_ptr ( const std::size_t  ) const
inlinevirtual

Compute the derived curve at order N.

Parameters
order: order of derivative.
Returns
A pointer to $\frac{d^Nx(t)}{dt^N}$ derivative order N of the curve.

Implements curves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ degree()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual std::size_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::degree ( ) const
inlinevirtual

Get the degree of the curve.

Returns
$degree$, the degree of the curve.

Implements curves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ derivate()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual point_derivate_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::derivate ( const time_t  t,
const std::size_t   
) const
inlinevirtual

Evaluate the derivative of order N of curve at time t.

Parameters
t: time when to evaluate the spline.
order: order of derivative.
Returns
$\frac{d^Nx(t)}{dt^N}$, point corresponding on derivative curve of order N at time t.

Implements curves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ dim()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual std::size_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::dim ( ) const
inlinevirtual

Get dimension of curve.

Returns
dimension of curve.

Implements curves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ isApprox() [1/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual bool curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::isApprox ( const constant_curve_t other,
const Numeric  prec = Eigen::NumTraits<Numeric>::dummy_precision() 
) const
inlinevirtual

isApprox check if other and *this are approximately equals given a precision treshold Only two curves of the same class can be approximately equals, for comparison between different type of curves see isEquivalent.

Parameters
otherthe other curve to check
precthe precision treshold, default Eigen::NumTraits<Numeric>::dummy_precision()
Returns
true is the two curves are approximately equals

◆ isApprox() [2/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual bool curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::isApprox ( const curve_abc_t other,
const Numeric  prec = Eigen::NumTraits<Numeric>::dummy_precision() 
) const
inlinevirtual

◆ max()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual num_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::max ( ) const
inlinevirtual

Get the maximum time for which the curve is defined.

Returns
$t_{max}$ upper bound of time range.

Implements curves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ min()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual num_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::min ( ) const
inlinevirtual

Get the minimum time for which the curve is defined.

Returns
$t_{min}$ lower bound of time range.

Implements curves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ operator!=()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual bool curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::operator!= ( const constant_curve_t other) const
inlinevirtual

◆ operator()()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual point_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::operator() ( const time_t  t) const
inlinevirtual

Evaluation of the cubic spline at time t.

Parameters
t: time when to evaluate the spine
Returns
$x(t)$, point corresponding on curve at time t.

Implements curves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ operator==()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
virtual bool curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::operator== ( const constant_curve_t other) const
inlinevirtual

◆ serialize()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
template<class Archive >
void curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Friends And Related Function Documentation

◆ boost::serialization::access

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
friend class boost::serialization::access
friend

Member Data Documentation

◆ dim_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
std::size_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::dim_

◆ T_max_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
time_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::T_max_

◆ T_min_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
time_t curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::T_min_

◆ value_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point>
Point curves::constant_curve< Time, Numeric, Safe, Point, Point_derivate >::value_

The documentation for this class was generated from the following file: