Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

vnl_nonlinear_minimizer Class Reference

#include <vnl_nonlinear_minimizer.h>

Inheritance diagram for vnl_nonlinear_minimizer:

Inheritance graph
[legend]
List of all members.

Public Types

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, FAILED_FTOL_TOO_SMALL = 6,
  FAILED_XTOL_TOO_SMALL = 7, FAILED_GTOL_TOO_SMALL = 8
}

Public Methods

 vnl_nonlinear_minimizer ()
virtual ~vnl_nonlinear_minimizer ()
void set_f_tolerance (double v)
double get_f_tolerance () const
void set_x_tolerance (double v)
double get_x_tolerance () const
void set_g_tolerance (double v)
double get_g_tolerance () const
void set_max_function_evals (int v)
int get_max_function_evals () const
void set_epsilon_function (double v)
double get_epsilon_function () const
void set_trace (bool on)
bool get_trace () const
void set_verbose (bool verb)
bool get_verbose () const
void set_check_derivatives (int cd)
int get_check_derivatives () const
double get_start_error () const
double get_end_error () const
int get_num_evaluations () const
int get_num_iterations () const
virtual vnl_matrix< double
> const & 
get_covariance ()
virtual const vcl_string is_a () const
virtual bool is_a (vcl_string const &s) const
ReturnCodes get_failure_code () const

Protected Methods

void reset ()
void report_eval (double f)
void report_iter ()

Protected Attributes

double xtol
int maxfev
double ftol
double gtol
double epsfcn
unsigned num_iterations_
int num_evaluations_
double start_error_
double end_error_
bool trace
bool verbose_
int check_derivatives_
ReturnCodes failure_code_

Detailed Description

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: vnl_levenberg_marquardt vnl_lbfgs vnl_conjugate_gradient vnl_brent vnl_powell

Definition at line 26 of file vnl_nonlinear_minimizer.h.


Member Enumeration Documentation

enum vnl_nonlinear_minimizer::ReturnCodes
 

Some generic return codes that apply to all minimizers.

Enumeration values:
ERROR_FAILURE 
ERROR_DODGY_INPUT 
CONVERGED_FTOL 
CONVERGED_XTOL 
CONVERGED_XFTOL 
CONVERGED_GTOL 
FAILED_TOO_MANY_ITERATIONS 
FAILED_FTOL_TOO_SMALL 
FAILED_XTOL_TOO_SMALL 
FAILED_GTOL_TOO_SMALL 

Definition at line 124 of file vnl_nonlinear_minimizer.h.

Referenced by get_failure_code(), get_num_iterations(), and is_a().


Constructor & Destructor Documentation

vnl_nonlinear_minimizer::vnl_nonlinear_minimizer  
 

virtual vnl_nonlinear_minimizer::~vnl_nonlinear_minimizer   [virtual]
 


Member Function Documentation

int vnl_nonlinear_minimizer::get_check_derivatives   const [inline]
 

Definition at line 83 of file vnl_nonlinear_minimizer.h.

References end_error_.

virtual vnl_matrix<double> const& vnl_nonlinear_minimizer::get_covariance   [virtual]
 

Return the covariance of the estimate at the end.

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 96 of file vnl_nonlinear_minimizer.h.

double vnl_nonlinear_minimizer::get_epsilon_function   const [inline]
 

Definition at line 68 of file vnl_nonlinear_minimizer.h.

References verbose_.

double vnl_nonlinear_minimizer::get_f_tolerance   const [inline]
 

Definition at line 41 of file vnl_nonlinear_minimizer.h.

References epsfcn, and xtol.

ReturnCodes vnl_nonlinear_minimizer::get_failure_code   const [inline]
 

Return the failure code of the last minimization.

Definition at line 139 of file vnl_nonlinear_minimizer.h.

References check_derivatives_, failure_code_, ReturnCodes, and verbose_.

double vnl_nonlinear_minimizer::get_g_tolerance   const [inline]
 

Definition at line 57 of file vnl_nonlinear_minimizer.h.

References epsfcn.

int vnl_nonlinear_minimizer::get_max_function_evals   const [inline]
 

Definition at line 62 of file vnl_nonlinear_minimizer.h.

References trace.

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 101 of file vnl_nonlinear_minimizer.h.

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 106 of file vnl_nonlinear_minimizer.h.

References CONVERGED_FTOL, CONVERGED_GTOL, CONVERGED_XFTOL, CONVERGED_XTOL, ERROR_DODGY_INPUT, ERROR_FAILURE, FAILED_FTOL_TOO_SMALL, FAILED_GTOL_TOO_SMALL, FAILED_TOO_MANY_ITERATIONS, FAILED_XTOL_TOO_SMALL, and ReturnCodes.

double vnl_nonlinear_minimizer::get_start_error   const [inline]
 

Return the error of the function when it was evaluated at the start. point of the last minimization. For minimizers driven by a vnl_least_squares_function (Levenberg-Marquardt) this is usually the RMS error. For those driven by a vnl_cost_function (CG, LBFGS, Amoeba) it is simply the value of the vnl_cost_function at the start (usually the sum of squared residuals).

Definition at line 91 of file vnl_nonlinear_minimizer.h.

References num_iterations_.

bool vnl_nonlinear_minimizer::get_trace   const [inline]
 

Definition at line 73 of file vnl_nonlinear_minimizer.h.

References check_derivatives_.

bool vnl_nonlinear_minimizer::get_verbose   const [inline]
 

Definition at line 78 of file vnl_nonlinear_minimizer.h.

References start_error_.

double vnl_nonlinear_minimizer::get_x_tolerance   const [inline]
 

Definition at line 52 of file vnl_nonlinear_minimizer.h.

References gtol.

virtual bool vnl_nonlinear_minimizer::is_a vcl_string const &    s const [inline, virtual]
 

Return true if the name of the class matches the argument. Used by polymorphic IO

Definition at line 120 of file vnl_nonlinear_minimizer.h.

References failure_code_, and ReturnCodes.

virtual const vcl_string vnl_nonlinear_minimizer::is_a   const [virtual]
 

Return the name of the class. Used by polymorphic IO

void vnl_nonlinear_minimizer::report_eval double    f [protected]
 

void vnl_nonlinear_minimizer::report_iter   [protected]
 

void vnl_nonlinear_minimizer::reset   [protected]
 

void vnl_nonlinear_minimizer::set_check_derivatives int    cd [inline]
 

Set check_derivatives flag.\ Negative values may mean fewer checks.

Definition at line 82 of file vnl_nonlinear_minimizer.h.

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 67 of file vnl_nonlinear_minimizer.h.

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 40 of file vnl_nonlinear_minimizer.h.

void vnl_nonlinear_minimizer::set_g_tolerance double    v [inline]
 

Set the convergence tolerance on Grad(F)' * F.

Definition at line 56 of file vnl_nonlinear_minimizer.h.

References maxfev.

void vnl_nonlinear_minimizer::set_max_function_evals int    v [inline]
 

Set the termination maximum number of iterations.

Definition at line 61 of file vnl_nonlinear_minimizer.h.

References epsfcn.

void vnl_nonlinear_minimizer::set_trace bool    on [inline]
 

Turn on per-iteration printouts.

Definition at line 72 of file vnl_nonlinear_minimizer.h.

References check_derivatives_.

void vnl_nonlinear_minimizer::set_verbose bool    verb [inline]
 

Set verbose flag.

Definition at line 77 of file vnl_nonlinear_minimizer.h.

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 48 of file vnl_nonlinear_minimizer.h.

References xtol.


Member Data Documentation

int vnl_nonlinear_minimizer::check_derivatives_ [protected]
 

Definition at line 160 of file vnl_nonlinear_minimizer.h.

Referenced by get_failure_code(), get_trace(), and set_trace().

double vnl_nonlinear_minimizer::end_error_ [protected]
 

Definition at line 154 of file vnl_nonlinear_minimizer.h.

Referenced by get_check_derivatives().

double vnl_nonlinear_minimizer::epsfcn [protected]
 

Definition at line 148 of file vnl_nonlinear_minimizer.h.

Referenced by get_f_tolerance(), get_g_tolerance(), and set_max_function_evals().

ReturnCodes vnl_nonlinear_minimizer::failure_code_ [protected]
 

Definition at line 161 of file vnl_nonlinear_minimizer.h.

Referenced by get_failure_code(), and is_a().

double vnl_nonlinear_minimizer::ftol [protected]
 

Definition at line 146 of file vnl_nonlinear_minimizer.h.

double vnl_nonlinear_minimizer::gtol [protected]
 

Definition at line 147 of file vnl_nonlinear_minimizer.h.

Referenced by get_x_tolerance().

int vnl_nonlinear_minimizer::maxfev [protected]
 

Definition at line 145 of file vnl_nonlinear_minimizer.h.

Referenced by set_g_tolerance().

int vnl_nonlinear_minimizer::num_evaluations_ [protected]
 

Definition at line 152 of file vnl_nonlinear_minimizer.h.

unsigned vnl_nonlinear_minimizer::num_iterations_ [protected]
 

Definition at line 151 of file vnl_nonlinear_minimizer.h.

Referenced by get_start_error().

double vnl_nonlinear_minimizer::start_error_ [protected]
 

Definition at line 153 of file vnl_nonlinear_minimizer.h.

Referenced by get_verbose().

bool vnl_nonlinear_minimizer::trace [protected]
 

Definition at line 156 of file vnl_nonlinear_minimizer.h.

Referenced by get_max_function_evals().

bool vnl_nonlinear_minimizer::verbose_ [protected]
 

Definition at line 159 of file vnl_nonlinear_minimizer.h.

Referenced by get_epsilon_function(), and get_failure_code().

double vnl_nonlinear_minimizer::xtol [protected]
 

Definition at line 144 of file vnl_nonlinear_minimizer.h.

Referenced by get_f_tolerance(), and set_x_tolerance().


The documentation for this class was generated from the following file:
Generated at Wed Mar 12 01:13:36 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000