Rigid Body Dynamics Library
Function_< T > Class Template Referenceabstract

#include <Function.h>

+ Inheritance diagram for Function_< T >:

Data Structures

class  Constant
 
class  Linear
 
class  Polynomial
 
class  Sinusoid
 
class  Step
 

Public Member Functions

virtual ~Function_ ()
 
virtual T calcValue (const RigidBodyDynamics::Math::VectorNd &x) const =0
 
virtual T calcDerivative (const std::vector< int > &derivComponents, const RigidBodyDynamics::Math::VectorNd &x) const =0
 
virtual int getArgumentSize () const =0
 
virtual int getMaxDerivativeOrder () const =0
 

Detailed Description

template<class T>
class RigidBodyDynamics::Addons::Geometry::Function_< T >

Definition at line 71 of file Function.h.

Constructor & Destructor Documentation

◆ ~Function_()

virtual ~Function_ ( )
inlinevirtual

Definition at line 78 of file Function.h.

Member Function Documentation

◆ calcDerivative()

virtual T calcDerivative ( const std::vector< int > &  derivComponents,
const RigidBodyDynamics::Math::VectorNd x 
) const
pure virtual

Calculate a partial derivative of this function at a particular point.
Which derivative to take is specified by listing the input components with which to take it. For example, if derivComponents=={0}, that indicates a first derivative with respective to component 0. If derivComponents=={0, 0, 0}, that indicates a third derivative with respective to component 0. If derivComponents=={4, 7}, that indicates a partial second derivative with respect to components 4 and 7.

Parameters
derivComponents
The input components with respect to which the derivative should be taken. Its size must be less than or equal to the value returned by getMaxDerivativeOrder().
x
The RigidBodyDynamics::Math::VectorNd of input arguments. Its size must equal the value returned by getArgumentSize().
Returns
The value of the selected derivative, which is of type T.

Implemented in Function_< T >::Constant, Function_< T >::Linear, Function_< T >::Polynomial, Function_< T >::Sinusoid, SmoothSegmentedFunction, and Function_< T >::Step.

◆ calcValue()

virtual T calcValue ( const RigidBodyDynamics::Math::VectorNd x) const
pure virtual

Calculate the value of this function at a particular point.

Parameters
xthe RigidBodyDynamics::Math::VectorNd of input arguments. Its size must equal the value returned by getArgumentSize().

Implemented in Function_< T >::Constant, Function_< T >::Linear, Function_< T >::Polynomial, Function_< T >::Sinusoid, SmoothSegmentedFunction, and Function_< T >::Step.

◆ getArgumentSize()

virtual int getArgumentSize ( ) const
pure virtual

This provides compatibility with std::vector without requiring any copying. Get the number of components expected in the input vector.

Implemented in Function_< T >::Constant, Function_< T >::Linear, Function_< T >::Polynomial, Function_< T >::Sinusoid, Function_< T >::Step, and SmoothSegmentedFunction.

◆ getMaxDerivativeOrder()

virtual int getMaxDerivativeOrder ( ) const
pure virtual

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