DART  6.10.1
dart::optimizer::NullFunction Class Reference

NullFunction is a constant-zero Function. More...

#include <Function.hpp>

Inheritance diagram for dart::optimizer::NullFunction:
dart::optimizer::Function

Public Member Functions

 NullFunction (const std::string &_name="null_function")
 Constructor. More...
 
 ~NullFunction () override
 Destructor. More...
 
double eval (const Eigen::VectorXd &) override
 eval() will always return exactly zero More...
 
void evalGradient (const Eigen::VectorXd &_x, Eigen::Map< Eigen::VectorXd > _grad) override
 evalGradient will always set _grad to a zero vector that matches the dimensionality of _x More...
 
void evalHessian (const Eigen::VectorXd &_x, Eigen::Map< Eigen::VectorXd, Eigen::RowMajor > _Hess) override
 evalHessian() will always set _Hess to a zero matrix that matches the dimensionality of _x 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...
 
void evalGradient (const Eigen::VectorXd &_x, Eigen::VectorXd &_grad)
 Evaluates and return the objective function at the point x. More...
 

Protected Attributes

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

Detailed Description

NullFunction is a constant-zero Function.

Constructor & Destructor Documentation

◆ NullFunction()

dart::optimizer::NullFunction::NullFunction ( const std::string &  _name = "null_function")
explicit

Constructor.

◆ ~NullFunction()

dart::optimizer::NullFunction::~NullFunction ( )
override

Destructor.

Member Function Documentation

◆ eval()

double dart::optimizer::NullFunction::eval ( const Eigen::VectorXd &  )
overridevirtual

eval() will always return exactly zero

Implements dart::optimizer::Function.

◆ evalGradient() [1/2]

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

evalGradient will always set _grad to a zero vector that matches the dimensionality of _x

Reimplemented from dart::optimizer::Function.

◆ evalGradient() [2/2]

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

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::NullFunction::evalHessian ( const Eigen::VectorXd &  _x,
Eigen::Map< Eigen::VectorXd, Eigen::RowMajor >  _Hess 
)
overridevirtual

evalHessian() will always set _Hess to a zero matrix that matches the dimensionality of _x

Reimplemented from dart::optimizer::Function.

◆ getName()

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

Returns the name of this Function.

◆ setName()

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

Sets the name of this Function.

Member Data Documentation

◆ mName

std::string dart::optimizer::Function::mName
protectedinherited

Name of this function.