CC Localization
Typedefs | Functions
nelder_mead.hh File Reference

Nelder–Mead method for function minimization. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef double() func_t(double const *)
 Function type with a number of parameters.
 

Functions

double nelder_mead (func_t f, int n, double *x, double const *steps, double mxrngy=0.00001, double mxrngx=0.00001, int mxiter=1000)
 Perform minimization with Nelder–Mead method. More...
 

Detailed Description

Nelder–Mead method for function minimization.

Author
Chun-Chung Chen <cjj@u.nosp@m..was.nosp@m.hingt.nosp@m.on.e.nosp@m.du>

This implementation follows roughly the details as described at Scholarpedia, with a small deviation in the condition to perform shrink of simplex.

Definition in file nelder_mead.hh.

Function Documentation

◆ nelder_mead()

double nelder_mead ( func_t  f,
int  n,
double *  x,
double const *  steps,
double  mxrngy = 0.00001,
double  mxrngx = 0.00001,
int  mxiter = 1000 
)

Perform minimization with Nelder–Mead method.

Returns
the minimum value of the function found

create initial simplex, initial x comes first

Parameters
[in]ffunction to be minimized
[in]nnumber of dimensions of parameter space
[in,out]xinitial guess, returns position of found minimum
[in]stepsstep sizes in all directions
[in]mxrngyrequired function value accuracy
[in]mxrngxrequired maximum position accuracy
[in]mxitermaximum number of iterations

Definition at line 12 of file nelder_mead.cc.