#include <lineSearch.h>
Public Member Functions | |
Constructors and Destructors | |
LineSearch () | |
Default constructor. | |
LineSearch (EnergyMinimizer &minimizer) | |
Detailed constructor. | |
LineSearch (const LineSearch &line_search) | |
Copy constructor. | |
virtual | ~LineSearch () throw () |
Destructor. | |
Assignments | |
const LineSearch & | operator= (const LineSearch &LineSearch) |
Assignment operator. | |
Accessors | |
void | setAlpha (double alpha) |
Set the parameter alpha (convergence criterion for the line search). | |
void | setBeta (double beta) |
Set the parameter beta (convergence criterion for the line search). | |
double | getAlpha () const |
Get the parameter alpha (convergence criterion for the line search). | |
double | getBeta () const |
Get the parameter beta (convergence criterion for the line search). | |
Size | getMaxSteps () const |
Get the parameter max_steps. | |
void | setMaxSteps (Size steps) |
Set the parameter max_steps. | |
void | setLowerBound (double lbound) |
Set the lower bound on energy values. | |
double | getLowerBound () const |
Get the lower bound on energy values. | |
void | setXTol (double xtol) |
Set the nonnegative relative tolerance for an acceptable step length. | |
double | getXTol () const |
Get the nonnegative relative tolerance for an acceptable step length. | |
void | setBracketedFlag (bool bracktd) |
Set the flag is_bracketed_ . | |
bool | isBracketed () const |
Return whether a minimizer has already been bracketed. | |
void | setMinimizer (EnergyMinimizer &minimizer) |
Set the minimizer class which provides the search direction and the force field among other things. | |
virtual void | takeStep (double &st_a, double &f_a, double &g_a, double &st_b, double &f_b, double &g_b, double &stp, double f, double g, double minstp, double maxstp) |
Computes a safeguarded step for a search procedure by case differentiation dependend on whether a minimum could already be bracketed or not. | |
Minimization | |
virtual bool | minimize (double &stp, bool keep_gradient=false) |
Perform a line search. | |
Protected Attributes | |
double | alpha_ |
double | beta_ |
Size | max_steps_ |
double | lower_energy_bound_ |
double | stptol_ |
bool | is_bracketed_ |
EnergyMinimizer * | minimizer_ |
This method minimizes the energy of a system along a given direction using a two stage algorithm. It is based on cubic and quadratic interpolation methods of Jorge J. More and David J. Thuente. See
[1] J. More and D. Thuente, "Line search algorithms with guaranteed sufficient decrease," ACM Transactions on Mathematical Software 20 (1994), no. 3, pp. 286-307.
|
Default constructor.
|
|
Detailed constructor.
|
|
Destructor.
|
|
Get the parameter alpha (convergence criterion for the line search).
|
|
Get the parameter beta (convergence criterion for the line search).
|
|
Get the lower bound on energy values.
|
|
Get the parameter max_steps.
|
|
Get the nonnegative relative tolerance for an acceptable step length.
|
|
Return whether a minimizer has already been bracketed.
Warning: this returns only the flag |
|
Perform a line search. Find the minimum position for all atoms along the direction provided by the minimization algorithm. A two stage algorithm is used proposed by Jorge J. More and David J. Thuente. If necessary (the convergence criterion is not fulfilled) a minimizer along the given direction is bracketed in the first stage. In the second stage this function looks for a minimizer whithin the bracketed interval. The routine exits (1) if the strong Wolfe conditions are satisfied (convergence criterion for the line search), that are
and
where and are the initial and the current gradient and is the search direction, is the current and the initial energy (stp = 0), and are two parameters (usually 0.9 and 0.0001). (2) if the relative tolerance for an acceptable step is reached (length of the bracketing interval). (3) if there has been some numerical problems. In this case the best step length which could be found is returned.
|
|
Set the parameter alpha (convergence criterion for the line search).
|
|
Set the parameter beta (convergence criterion for the line search).
|
|
Set the flag The algorithm will act as if a minimizer has already been bracketed (true) or not (false). Warning: this can be useful if a user exactly knows what they are doing. Usually, this flag should not be touched! The algorithm sets this flag automatically if a minimizer could be bracketed. |
|
Set the lower bound on energy values. An estimation for the maximum step length is computed based on this value. |
|
Set the parameter max_steps.
|
|
Set the minimizer class which provides the search direction and the force field among other things.
|
|
Set the nonnegative relative tolerance for an acceptable step length.
|
|
Computes a safeguarded step for a search procedure by case differentiation dependend on whether a minimum could already be bracketed or not. All computations are done by safeguarded quadratic and cubic interpolation. The interval that contains a step that satisfies a sufficient decrease and the curvature condition is updated. This function is based on the proposed step computation of Jorge J. More and David J. Thuente. Don't worry if interval bounds are changed after this routine exits.
|