Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
vnl_amoeba Class Reference

Nelder-Meade downhill simplex. More...

#include <vnl_amoeba.h>

Inheritance diagram for vnl_amoeba:
Inheritance graph
[legend]

Public Member Functions

void set_max_iterations (int n)
 Define maximum number of iterations to use. More...
 
void set_x_tolerance (double tol)
 Define tolerance on elements of x. More...
 
void set_f_tolerance (double tol)
 Define tolerance on function evaluation. More...
 
void set_relative_diameter (double r)
 Define scaling used to select starting vertices relative to initial x0. More...
 
void set_zero_term_delta (double d)
 
 vnl_amoeba (vnl_cost_function &f)
 Construct and supply function to be minimized. More...
 
void minimize (vnl_vector< double > &x)
 Modify x to minimise function supplied in constructor. More...
 
void minimize (vnl_vector< double > &x, const vnl_vector< double > &dx)
 Perform optimisation. More...
 
double get_end_error () const
 
int get_num_evaluations () const
 Number of evaluations used in last call to minimize. More...
 

Static Public Member Functions

static void minimize (vnl_cost_function &f, vnl_vector< double > &x)
 Modify x so as to minimise f(x). More...
 
static void minimize (vnl_cost_function &f, vnl_vector< double > &x, const vnl_vector< double > &dx)
 Modify x so as to minimise f(x). More...
 
static void minimize (vnl_cost_function &f, vnl_vector< double > &x, double delta)
 Modify x so as to minimise f(x). More...
 
static void minimize (vnl_least_squares_function &f, vnl_vector< double > &x)
 Modify x so as to minimise f(x). More...
 

Public Attributes

int verbose
 
int maxiter
 
double X_tolerance
 
double F_tolerance
 
double relative_diameter
 Scaling used to select starting vertices relative to initial x0. More...
 
double zero_term_delta
 

Static Public Attributes

static bool default_verbose = false
 

Protected Attributes

vnl_cost_functionfptr
 
double end_error_
 
int num_evaluations_
 

Detailed Description

Nelder-Meade downhill simplex.

vnl_amoeba is an implementation of the Nelder-Meade downhill simplex algorithm. For most problems, it's a few times slower than vnl_levenberg_marquardt, but it can perform much better on noisy error functions.

It works by creating a simplex (n+1 points in n-D space) which then crawls about the space searching for the solution.

By default the set of (n+1) starting points are generated by applying a scaling (relative_diameter) to each element of the supplied starting vector, with a small offset used instead if the value is zero.

Alternatively, if one uses minimize(x,dx), then the starting points are obtained by adding each dx[i] to the elements of x, one at a time. This is useful if you know roughly the scale of your space.

Definition at line 43 of file vnl_amoeba.h.

Constructor & Destructor Documentation

◆ vnl_amoeba()

vnl_amoeba::vnl_amoeba ( vnl_cost_function f)

Construct and supply function to be minimized.

Definition at line 19 of file vnl_amoeba.cxx.

Member Function Documentation

◆ get_end_error()

double vnl_amoeba::get_end_error ( ) const
inline

Definition at line 80 of file vnl_amoeba.h.

◆ get_num_evaluations()

int vnl_amoeba::get_num_evaluations ( ) const
inline

Number of evaluations used in last call to minimize.

Definition at line 83 of file vnl_amoeba.h.

◆ minimize() [1/6]

void vnl_amoeba::minimize ( vnl_vector< double > &  x)

Modify x to minimise function supplied in constructor.

Start simplex defined by scaling elements of x

Definition at line 347 of file vnl_amoeba.cxx.

◆ minimize() [2/6]

void vnl_amoeba::minimize ( vnl_vector< double > &  x,
const vnl_vector< double > &  dx 
)

Perform optimisation.

Perform optimisation. Start simplex defined by adding dx[i] to each x[i].

Start simplex defined by adding dx[i] to each x[i]

Definition at line 356 of file vnl_amoeba.cxx.

◆ minimize() [3/6]

void vnl_amoeba::minimize ( vnl_cost_function f,
vnl_vector< double > &  x 
)
static

Modify x so as to minimise f(x).

Static method.

Definition at line 366 of file vnl_amoeba.cxx.

◆ minimize() [4/6]

void vnl_amoeba::minimize ( vnl_cost_function f,
vnl_vector< double > &  x,
const vnl_vector< double > &  dx 
)
static

Modify x so as to minimise f(x).

Static method.

Start simplex defined by adding dx[i] to each x[i]

Definition at line 383 of file vnl_amoeba.cxx.

◆ minimize() [5/6]

void vnl_amoeba::minimize ( vnl_cost_function f,
vnl_vector< double > &  x,
double  delta 
)
static

Modify x so as to minimise f(x).

Static method.

delta defines relative size of initial simplex ie the i'th vertex has xi[i] = x[i]*(1+delta)

Definition at line 372 of file vnl_amoeba.cxx.

◆ minimize() [6/6]

void vnl_amoeba::minimize ( vnl_least_squares_function f,
vnl_vector< double > &  x 
)
static

Modify x so as to minimise f(x).

Definition at line 410 of file vnl_amoeba.cxx.

◆ set_f_tolerance()

void vnl_amoeba::set_f_tolerance ( double  tol)
inline

Define tolerance on function evaluation.

Definition at line 58 of file vnl_amoeba.h.

◆ set_max_iterations()

void vnl_amoeba::set_max_iterations ( int  n)
inline

Define maximum number of iterations to use.

Definition at line 52 of file vnl_amoeba.h.

◆ set_relative_diameter()

void vnl_amoeba::set_relative_diameter ( double  r)
inline

Define scaling used to select starting vertices relative to initial x0.

I.e. the i'th vertex has x[i] = x0[i]*(1+relative_diameter)

Definition at line 62 of file vnl_amoeba.h.

◆ set_x_tolerance()

void vnl_amoeba::set_x_tolerance ( double  tol)
inline

Define tolerance on elements of x.

Definition at line 55 of file vnl_amoeba.h.

◆ set_zero_term_delta()

void vnl_amoeba::set_zero_term_delta ( double  d)
inline

Definition at line 64 of file vnl_amoeba.h.

Member Data Documentation

◆ default_verbose

bool vnl_amoeba::default_verbose = false
static

Definition at line 103 of file vnl_amoeba.h.

◆ end_error_

double vnl_amoeba::end_error_
protected

Definition at line 107 of file vnl_amoeba.h.

◆ F_tolerance

double vnl_amoeba::F_tolerance

Definition at line 49 of file vnl_amoeba.h.

◆ fptr

vnl_cost_function* vnl_amoeba::fptr
protected

Definition at line 106 of file vnl_amoeba.h.

◆ maxiter

int vnl_amoeba::maxiter

Definition at line 47 of file vnl_amoeba.h.

◆ num_evaluations_

int vnl_amoeba::num_evaluations_
protected

Definition at line 108 of file vnl_amoeba.h.

◆ relative_diameter

double vnl_amoeba::relative_diameter

Scaling used to select starting vertices relative to initial x0.

I.e. the i'th vertex has x[i] = x0[i]*(1+relative_diameter)

Definition at line 67 of file vnl_amoeba.h.

◆ verbose

int vnl_amoeba::verbose

Definition at line 46 of file vnl_amoeba.h.

◆ X_tolerance

double vnl_amoeba::X_tolerance

Definition at line 48 of file vnl_amoeba.h.

◆ zero_term_delta

double vnl_amoeba::zero_term_delta

Definition at line 68 of file vnl_amoeba.h.


The documentation for this class was generated from the following files: