DART  6.10.1
dart::optimizer::Function Class Referenceabstract

#include <Function.hpp>

Inheritance diagram for dart::optimizer::Function:
dart::constraint::BalanceConstraint dart::dynamics::HierarchicalIK::Constraint dart::dynamics::HierarchicalIK::Objective dart::dynamics::InverseKinematics::Constraint dart::dynamics::InverseKinematics::Objective dart::optimizer::ModularFunction dart::optimizer::NullFunction

Public Member Functions

 Function (const std::string &_name="function")
 Constructor. More...
 
virtual ~Function ()
 Destructor. More...
 
virtual void setName (const std::string &newName)
 Sets the name of this Function. More...
 
const std::string & getName () const
 Returns the name of this Function. More...
 
virtual double eval (const Eigen::VectorXd &x)=0
 Evaluates and returns the objective function at the point x. More...
 
virtual void evalGradient (const Eigen::VectorXd &_x, Eigen::Map< Eigen::VectorXd > _grad)
 Evaluates and returns the objective function at the point x. More...
 
void evalGradient (const Eigen::VectorXd &_x, Eigen::VectorXd &_grad)
 Evaluates and return the objective function at the point x. More...
 
virtual void evalHessian (const Eigen::VectorXd &_x, Eigen::Map< Eigen::VectorXd, Eigen::RowMajor > _Hess)
 Evaluates and return the objective function at the point x. More...
 

Protected Attributes

std::string mName
 Name of this function. More...
 

Constructor & Destructor Documentation

◆ Function()

dart::optimizer::Function::Function ( const std::string &  _name = "function")
explicit

Constructor.

◆ ~Function()

dart::optimizer::Function::~Function ( )
virtual

Destructor.

Member Function Documentation

◆ eval()

virtual double dart::optimizer::Function::eval ( const Eigen::VectorXd &  x)
pure virtual

◆ evalGradient() [1/2]

void dart::optimizer::Function::evalGradient ( const Eigen::VectorXd &  _x,
Eigen::Map< Eigen::VectorXd >  _grad 
)
virtual

◆ evalGradient() [2/2]

void dart::optimizer::Function::evalGradient ( const Eigen::VectorXd &  _x,
Eigen::VectorXd &  _grad 
)

Evaluates and return the objective function at the point x.

If you have a raw array that the gradient will be passed in, then use evalGradient(const Eigen::VectorXd&, Eigen::Map<Eigen::VectorXd>) for better performance.

◆ evalHessian()

void dart::optimizer::Function::evalHessian ( const Eigen::VectorXd &  _x,
Eigen::Map< Eigen::VectorXd, Eigen::RowMajor >  _Hess 
)
virtual

Evaluates and return the objective function at the point x.

Reimplemented in dart::optimizer::NullFunction, and dart::optimizer::ModularFunction.

◆ getName()

const std::string & dart::optimizer::Function::getName ( ) const

Returns the name of this Function.

◆ setName()

void dart::optimizer::Function::setName ( const std::string &  newName)
virtual

Sets the name of this Function.

Member Data Documentation

◆ mName

std::string dart::optimizer::Function::mName
protected

Name of this function.