MADNESS
0.10.1
|
The interface to be provided by functions to be optimized. More...
#include <solvers.h>
Public Member Functions | |
virtual | ~OptimizationTargetInterface () |
virtual Tensor< double > | gradient (const Tensor< double > &x) |
Should return the derivative of the function. More... | |
virtual bool | provides_gradient () const |
Override this to return true if the derivative 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... | |
The interface to be provided by functions to be optimized.
|
inlinevirtual |
|
inlinevirtual |
Should return the derivative of the function.
Reimplemented in CoreFittingTarget, madness::Znemo, Test2, Test, Test2, Test, madness::MolecularEnergy, madness::Nemo, and Fred.
Referenced by test_gradient(), and value_and_gradient().
|
inlinevirtual |
Override this to return true if the derivative is implemented.
Reimplemented in Test2, Test, Test2, Test, Fred, madness::MolecularEnergy, madness::Nemo, and CoreFittingTarget.
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 std::abs(), madness::BaseTensor::dim(), gradient(), max, pow(), and value().
|
pure virtual |
Should return the value of the objective function.
Implemented in CoreFittingTarget, madness::Znemo, Test2, Test, Test2, Test, madness::MolecularEnergy, madness::OEP, madness::Nemo, madness::MP2, madness::CC2, and Fred.
Referenced by test_gradient(), and value_and_gradient().
|
inlinevirtual |
Reimplement if more efficient to evaluate both value and gradient in one call.
Reimplemented in Fred.
References gradient(), and value().