Find the minimum of a function along the line between two points. More...
Public Member Functions | |
| LineSearch (const size_t maxIterations=100000, const double tolerance=1e-5) | |
| size_t | MaxIterations () const |
| Get the maximum number of iterations (0 indicates no limit). More... | |
| size_t & | MaxIterations () |
| Modify the maximum number of iterations (0 indicates no limit). More... | |
template < typename FunctionType > | |
| double | Optimize (FunctionType &function, const arma::mat &x1, arma::mat &x2) |
| Line search to minimize function between two points with Secant method, that is, to find the zero of Derivative(gamma), where gamma is in [0,1]. More... | |
| double | Tolerance () const |
| Get the tolerance for termination. More... | |
| double & | Tolerance () |
| Modify the tolerance for termination. More... | |
Find the minimum of a function along the line between two points.
The solver uses the secant method to find the zero of the derivative of the function along the search line.
If the function is convex, the derivative of the function along the search line will be nondecreasing, so the minimum always exists. If the function is strongly convex, the derivative of the function along the search line will be strictly increasing, so the minimum is unique.
Definition at line 30 of file line_search.hpp.
|
inline |
Definition at line 33 of file line_search.hpp.
References LineSearch::Optimize().
|
inline |
Get the maximum number of iterations (0 indicates no limit).
Definition at line 54 of file line_search.hpp.
|
inline |
Modify the maximum number of iterations (0 indicates no limit).
Definition at line 56 of file line_search.hpp.
| double Optimize | ( | FunctionType & | function, |
| const arma::mat & | x1, | ||
| arma::mat & | x2 | ||
| ) |
Line search to minimize function between two points with Secant method, that is, to find the zero of Derivative(gamma), where gamma is in [0,1].
The function is assumed to be convex here, otherwise might not converge.
| function | function to be minimized. |
| x1 | Input one end point. |
| x2 | Input the other end point, also used as output, to store the coordinate of the optimal solution. |
Referenced by LineSearch::LineSearch(), and UpdateLineSearch::Update().
|
inline |
Get the tolerance for termination.
Definition at line 59 of file line_search.hpp.
|
inline |
Modify the tolerance for termination.
Definition at line 61 of file line_search.hpp.