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

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

#include <solvers.h>

Inheritance diagram for madness::OptimizationTargetInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~OptimizationTargetInterface ()
 
virtual Tensor< double > gradient (const Tensor< double > &x)
 Should return the derivative of the function.
 
virtual bool provides_gradient () const
 Override this to return true if the derivative 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.

Constructor & Destructor Documentation

◆ ~OptimizationTargetInterface()

virtual madness::OptimizationTargetInterface::~OptimizationTargetInterface ( )
inlinevirtual

Member Function Documentation

◆ gradient()

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

Should return the derivative of the function.

Reimplemented in Fred, madness::Nemo, madness::MolecularEnergy, Test, Test2, Test, Test2, madness::Znemo, and CoreFittingTarget.

Referenced by test_gradient(), and value_and_gradient().

◆ provides_gradient()

virtual bool madness::OptimizationTargetInterface::provides_gradient ( ) const
inlinevirtual

Override this to return true if the derivative is implemented.

Reimplemented in CoreFittingTarget, madness::Nemo, madness::MolecularEnergy, Fred, Test, Test2, Test, and Test2.

◆ test_gradient()

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

◆ value()

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

Should return the value of the objective function.

Implemented in Fred, madness::CC2, madness::MP2, madness::Nemo, madness::OEP, madness::MolecularEnergy, Test, Test2, Test, Test2, madness::Znemo, and CoreFittingTarget.

Referenced by test_gradient(), and value_and_gradient().

◆ value_and_gradient()

virtual void madness::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.

Reimplemented in Fred.

References gradient(), and value().


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