MADNESS 0.10.1
Public Member Functions | List of all members
OptimizationTargetInterface Struct Referenceabstract

The interface to be provided by functions to be optimized. More...

Public Member Functions

virtual Tensor< double > gradient (const Tensor< double > &x)
 Should return the derivative of the function.
 
virtual bool provides_gradient () const =0
 Should return true if the gradient is implemented.
 
double test_gradient (Tensor< double > &x, double value_precision, bool doprint=true)
 Numerical test of the derivative ... optionally prints to stdout, returns max abs error.
 
virtual double value (const Tensor< double > &x)=0
 Should return the value of the objective function.
 
virtual void value_and_gradient (const Tensor< double > &x, double &value, Tensor< double > &gradient)
 Reimplement if more efficient to evaluate both value and gradient in one call.
 

Detailed Description

The interface to be provided by functions to be optimized.

Member Function Documentation

◆ gradient()

virtual Tensor< double > OptimizationTargetInterface::gradient ( const Tensor< double > &  x)
inlinevirtual

Should return the derivative of the function.

Referenced by test_gradient(), and value_and_gradient().

◆ provides_gradient()

virtual bool OptimizationTargetInterface::provides_gradient ( ) const
pure virtual

Should return true if the gradient is implemented.

◆ test_gradient()

double OptimizationTargetInterface::test_gradient ( Tensor< double > &  x,
double  value_precision,
bool  doprint = true 
)
inline

Numerical test of the derivative ... optionally prints to stdout, returns max abs error.

References madness::abs(), madness::BaseTensor::dim(), gradient(), max, pow(), and value().

◆ value()

virtual double OptimizationTargetInterface::value ( const Tensor< double > &  x)
pure virtual

Should return the value of the objective function.

Referenced by test_gradient(), and value_and_gradient().

◆ value_and_gradient()

virtual void OptimizationTargetInterface::value_and_gradient ( const Tensor< double > &  x,
double &  value,
Tensor< double > &  gradient 
)
inlinevirtual

Reimplement if more efficient to evaluate both value and gradient in one call.

References gradient(), and value().


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