MADNESS
version 0.9
|
The interface to be provided by functions to be optimized. More...
#include <solvers.h>
Public Member Functions | |
virtual double | value (const Tensor< double > &x)=0 |
Should return the value of the objective function. More... | |
virtual bool | provides_gradient () const |
Override this to return true if the derivative is implemented. More... | |
virtual Tensor< double > | gradient (const Tensor< double > &x) |
Should return the derivative of the 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... | |
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 | ~OptimizationTargetInterface () |
The interface to be provided by functions to be optimized.
|
inlinevirtual |
|
inlinevirtual |
Should return the derivative of the function.
Reimplemented in madness::MolecularEnergy, and madness::Nemo.
Referenced by madness::SteepestDescent::optimize(), test_gradient(), and value_and_gradient().
|
inlinevirtual |
Override this to return true if the derivative is implemented.
Reimplemented in madness::MolecularEnergy.
Referenced by madness::QuasiNewton::QuasiNewton(), and madness::SteepestDescent::SteepestDescent().
double OptimizationTargetInterface::test_gradient | ( | Tensor< double > & | x, |
double | value_precision, | ||
bool | doprint = true |
||
) |
Numerical test of the derivative ... optionally prints to stdout, returns max abs error.
References gradient(), max, and value().
Referenced by madness::QuasiNewton::optimize().
|
pure virtual |
Should return the value of the objective function.
Implemented in madness::MolecularEnergy, madness::MP2, and madness::Nemo.
Referenced by test_gradient(), and value_and_gradient().
|
inlinevirtual |
Reimplement if more efficient to evaluate both value and gradient in one call.
References gradient(), and value().
Referenced by madness::SteepestDescent::optimize(), and madness::QuasiNewton::optimize().