vnl_nonlinear_minimizer is a base class for nonlinear optimization.
More...
#include <vnl_nonlinear_minimizer.h>
|
| enum | ReturnCodes {
ERROR_FAILURE =-1,
ERROR_DODGY_INPUT = 0,
CONVERGED_FTOL = 1,
CONVERGED_XTOL = 2,
CONVERGED_XFTOL = 3,
CONVERGED_GTOL = 4,
FAILED_TOO_MANY_ITERATIONS = 5,
TOO_MANY_ITERATIONS = FAILED_TOO_MANY_ITERATIONS,
FAILED_FTOL_TOO_SMALL = 6,
FAILED_XTOL_TOO_SMALL = 7,
FAILED_GTOL_TOO_SMALL = 8,
FAILED_USER_REQUEST = 9
} |
| | Some generic return codes that apply to all minimizers. More...
|
| |
vnl_nonlinear_minimizer is a base class for nonlinear optimization.
It defines a few common abilities such as get_num_evaluations. Known derived classes are:
Definition at line 31 of file vnl_nonlinear_minimizer.h.
◆ ReturnCodes
Some generic return codes that apply to all minimizers.
| Enumerator |
|---|
| ERROR_FAILURE | |
| ERROR_DODGY_INPUT | |
| CONVERGED_FTOL | |
| CONVERGED_XTOL | |
| CONVERGED_XFTOL | |
| CONVERGED_GTOL | |
| FAILED_TOO_MANY_ITERATIONS | |
| TOO_MANY_ITERATIONS | |
| FAILED_FTOL_TOO_SMALL | |
| FAILED_XTOL_TOO_SMALL | |
| FAILED_GTOL_TOO_SMALL | |
| FAILED_USER_REQUEST | |
Definition at line 102 of file vnl_nonlinear_minimizer.h.
◆ vnl_nonlinear_minimizer()
| vnl_nonlinear_minimizer::vnl_nonlinear_minimizer |
( |
| ) |
|
◆ ~vnl_nonlinear_minimizer()
| vnl_nonlinear_minimizer::~vnl_nonlinear_minimizer |
( |
| ) |
|
|
virtualdefault |
◆ get_check_derivatives()
| int vnl_nonlinear_minimizer::get_check_derivatives |
( |
| ) |
const |
|
inline |
◆ get_covariance()
| vnl_matrix< double > const & vnl_nonlinear_minimizer::get_covariance |
( |
| ) |
|
|
virtual |
◆ get_end_error()
| double vnl_nonlinear_minimizer::get_end_error |
( |
| ) |
const |
|
inline |
Return the best error that was achieved by the last minimization, corresponding to the returned x.
Definition at line 92 of file vnl_nonlinear_minimizer.h.
◆ get_epsilon_function()
| double vnl_nonlinear_minimizer::get_epsilon_function |
( |
| ) |
const |
|
inline |
◆ get_f_tolerance()
| double vnl_nonlinear_minimizer::get_f_tolerance |
( |
| ) |
const |
|
inline |
◆ get_failure_code()
| ReturnCodes vnl_nonlinear_minimizer::get_failure_code |
( |
| ) |
const |
|
inline |
◆ get_g_tolerance()
| double vnl_nonlinear_minimizer::get_g_tolerance |
( |
| ) |
const |
|
inline |
◆ get_max_function_evals()
| int vnl_nonlinear_minimizer::get_max_function_evals |
( |
| ) |
const |
|
inline |
◆ get_num_evaluations()
| int vnl_nonlinear_minimizer::get_num_evaluations |
( |
| ) |
const |
|
inline |
Return the total number of times the function was evaluated by the last minimization.
Definition at line 95 of file vnl_nonlinear_minimizer.h.
◆ get_num_iterations()
| int vnl_nonlinear_minimizer::get_num_iterations |
( |
| ) |
const |
|
inline |
Return the number of {iterations} in the last minimization.
Each iteration may have comprised several function evaluations.
Definition at line 99 of file vnl_nonlinear_minimizer.h.
◆ get_start_error()
| double vnl_nonlinear_minimizer::get_start_error |
( |
| ) |
const |
|
inline |
◆ get_trace()
| bool vnl_nonlinear_minimizer::get_trace |
( |
| ) |
const |
|
inline |
◆ get_verbose()
| bool vnl_nonlinear_minimizer::get_verbose |
( |
| ) |
const |
|
inline |
◆ get_x_tolerance()
| double vnl_nonlinear_minimizer::get_x_tolerance |
( |
| ) |
const |
|
inline |
◆ is_a()
| std::string vnl_nonlinear_minimizer::is_a |
( |
| ) |
const |
|
virtual |
◆ is_class()
| bool vnl_nonlinear_minimizer::is_class |
( |
std::string const & |
s | ) |
const |
|
virtual |
◆ obj_value_reduced()
| bool vnl_nonlinear_minimizer::obj_value_reduced |
( |
| ) |
|
|
inline |
◆ report_eval()
| void vnl_nonlinear_minimizer::report_eval |
( |
double |
f | ) |
|
|
protected |
◆ report_iter()
| bool vnl_nonlinear_minimizer::report_iter |
( |
| ) |
|
|
protectedvirtual |
Called by derived classes after each iteration.
When true is returned, minimizer should stop with code FAILED_USER_REQUEST. Derived classes can redefine this function to make the optimizer stop when a condition is satisfied.
Definition at line 58 of file vnl_nonlinear_minimizer.cxx.
◆ reset()
| void vnl_nonlinear_minimizer::reset |
( |
| ) |
|
|
protected |
◆ set_check_derivatives()
| void vnl_nonlinear_minimizer::set_check_derivatives |
( |
int |
cd | ) |
|
|
inline |
◆ set_epsilon_function()
| void vnl_nonlinear_minimizer::set_epsilon_function |
( |
double |
v | ) |
|
|
inline |
Set the step length for FD Jacobian.
Be aware that set_x_tolerance will reset this to xtol * 0.001. The default is 1e-11.
Definition at line 69 of file vnl_nonlinear_minimizer.h.
◆ set_f_tolerance()
| void vnl_nonlinear_minimizer::set_f_tolerance |
( |
double |
v | ) |
|
|
inline |
Set the convergence tolerance on F (sum of squared residuals).
When the differences in successive RMS errors is less than this, the routine terminates. So this is effectively the desired precision of your minimization. Setting it too low wastes time, too high might cause early convergence. The default of 1e-9 is on the safe side, but if speed is an issue, you can try raising it.
Definition at line 45 of file vnl_nonlinear_minimizer.h.
◆ set_g_tolerance()
| void vnl_nonlinear_minimizer::set_g_tolerance |
( |
double |
v | ) |
|
|
inline |
◆ set_max_function_evals()
| void vnl_nonlinear_minimizer::set_max_function_evals |
( |
int |
v | ) |
|
|
inline |
◆ set_trace()
| void vnl_nonlinear_minimizer::set_trace |
( |
bool |
on | ) |
|
|
inline |
◆ set_verbose()
| void vnl_nonlinear_minimizer::set_verbose |
( |
bool |
verb | ) |
|
|
inline |
◆ set_x_tolerance()
| void vnl_nonlinear_minimizer::set_x_tolerance |
( |
double |
v | ) |
|
|
inline |
Set the convergence tolerance on X.
When the length of the steps taken in X are about this long, the routine terminates. The default is 1e-8, which should work for many problems, but if you can get away with 1e-4, say, minimizations will be much quicker.
Definition at line 52 of file vnl_nonlinear_minimizer.h.
◆ check_derivatives_
| int vnl_nonlinear_minimizer::check_derivatives_ |
|
protected |
◆ end_error_
| double vnl_nonlinear_minimizer::end_error_ |
|
protected |
◆ epsfcn
| double vnl_nonlinear_minimizer::epsfcn |
|
protected |
◆ failure_code_
◆ ftol
| double vnl_nonlinear_minimizer::ftol |
|
protected |
◆ gtol
| double vnl_nonlinear_minimizer::gtol |
|
protected |
◆ maxfev
| long vnl_nonlinear_minimizer::maxfev |
|
protected |
◆ num_evaluations_
| long vnl_nonlinear_minimizer::num_evaluations_ |
|
protected |
◆ num_iterations_
| unsigned vnl_nonlinear_minimizer::num_iterations_ |
|
protected |
◆ start_error_
| double vnl_nonlinear_minimizer::start_error_ |
|
protected |
◆ trace
| bool vnl_nonlinear_minimizer::trace |
|
protected |
◆ verbose_
| bool vnl_nonlinear_minimizer::verbose_ |
|
protected |
◆ xtol
| double vnl_nonlinear_minimizer::xtol |
|
protected |
The documentation for this class was generated from the following files: