#include <EnergyInterface.hpp>
Public Member Functions | |
virtual ublas::vector< float_t > & | current_argument ()=0 |
virtual void | set_argument ()=0 |
virtual float_t | current_energy () const =0 |
virtual std::size_t | dimension () const =0 |
Classes implementing EnergyInterface always have a current argument which can be directly accessed from the outside. It is only when set_argument() is called that the energy value for the current argument is computed. In other words, instead of passing an argument to a member of the energy class the clients edit the argument inside the energy class and manually trigger its evaluation. This has the advantage that the argument has only to be stored once and is still always accesible from the outside. Minor modifications of the argument can be made without resetting it completely. Accessing the argument is expected to be cheap, only calls to set_argument() might be expensive.
virtual ublas::vector<float_t>& imaging::EnergyInterface::current_argument | ( | ) | [pure virtual] |
Access the current argument of the energy. In general the user should not resize the current argument!
Implemented in imaging::DifferentiableFunctionalAdaptor< functional_t >, imaging::FunctionalAdaptor< functional_t >, imaging::MumfordShahEnergy< shape_t >, imaging::SnakesEnergy< shape_t >, and imaging::StatisticalRegularization< shape_t >.
Referenced by imaging::SteepestDescent::minimize(), imaging::NlCg::minimize(), imaging::Lbfgs::minimize(), and imaging::CovarianceMatrixAdaptation::minimize().
virtual void imaging::EnergyInterface::set_argument | ( | ) | [pure virtual] |
Compute the energy value corresponding to the current argument. This is where the main work of the energy evaluation should be done.
Implemented in imaging::DifferentiableFunctionalAdaptor< functional_t >, imaging::FunctionalAdaptor< functional_t >, imaging::MumfordShahEnergy< shape_t >, imaging::SnakesEnergy< shape_t >, and imaging::StatisticalRegularization< shape_t >.
Referenced by imaging::CovarianceMatrixAdaptation::minimize().
virtual float_t imaging::EnergyInterface::current_energy | ( | ) | const [pure virtual] |
Returns the current energy. This function should not actually compute the current energy but return the cached result of the last call to set_argument()!
Implemented in imaging::DifferentiableFunctionalAdaptor< functional_t >, imaging::FunctionalAdaptor< functional_t >, imaging::MumfordShahEnergy< shape_t >, imaging::SnakesEnergy< shape_t >, and imaging::StatisticalRegularization< shape_t >.
Referenced by imaging::SteepestDescent::minimize(), imaging::NlCg::minimize(), and imaging::CovarianceMatrixAdaptation::minimize().
virtual std::size_t imaging::EnergyInterface::dimension | ( | ) | const [pure virtual] |
Returns the dimension the class expects as input data. The function current_argument() will return a vector of this dimension and the user should not change the size of this vector!
Implemented in imaging::DifferentiableFunctionalAdaptor< functional_t >, imaging::FunctionalAdaptor< functional_t >, imaging::MumfordShahEnergy< shape_t >, imaging::SnakesEnergy< shape_t >, and imaging::StatisticalRegularization< shape_t >.
Referenced by imaging::CovarianceMatrixAdaptation::CovarianceMatrixAdaptation(), imaging::NlCg::minimize(), and imaging::Lbfgs::minimize().