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. More...
 
virtual bool provides_gradient () const =0
 Should return true if the gradient is implemented. More...
 
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. More...
 
virtual double value (const Tensor< double > &x)=0
 Should return the value of the objective function. More...
 
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. More...
 

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.

◆ 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(), max, and pow().

◆ value()

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

Should return the value of the objective function.

◆ 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.


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