#include <NlCg.hpp>
Public Types | |
enum | methods { FLETCHER_REEVES, POLAK_RIBIERE, POSITIVE_POLAK_RIBIERE } |
Public Member Functions | |
NlCg (DifferentiableEnergyInterface &energy, float_t convergence_constant, size_t method=FLETCHER_REEVES) | |
bool | minimize (size_t n_max_steps, size_t &n_steps) |
Minimizes a given energy by means of the nonlinear conjugated gradients algorithm. This class is based on CG+, a Software for Large-scale Unconstrained Optimization by Guanghui Liu, Jorge Nocedal and Richard Waltz.
imaging::NlCg::NlCg | ( | DifferentiableEnergyInterface & | energy, | |
float_t | convergence_constant, | |||
size_t | method = FLETCHER_REEVES | |||
) |
Construct a NlCg object to minimize energy. The algorithm stops if the L2-norm of the solution falls below convergence_constant. To actually start the minimization the user must call minimize().
References FLETCHER_REEVES, POLAK_RIBIERE, and POSITIVE_POLAK_RIBIERE.
Start the minimization process. At most n_max_steps will be performed. If the convergence criterion (as set in the constructor) is met before the number of maximal steps is reached the function returns true. Otherwise it returns false. The actual number of performed stops is stored in n_steps. Upon return, the energy (as set in the constructor) will have the solution as its current argument.
Implements imaging::MinimizerInterface.
References imaging::EnergyInterface::current_argument(), imaging::EnergyInterface::current_energy(), imaging::DifferentiableEnergyInterface::current_gradient(), imaging::MessageInterface::DEBUG_ONLY, imaging::EnergyInterface::dimension(), imaging::MessageInterface::out, and imaging::DifferentiableEnergyInterface::set_argument_with_gradient().