Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | Static Public Attributes | List of all members
honey::MinimizeN< Real, Dim > Class Template Reference

Find a local minimum of an n-dimensional function using "Powell's conjugate gradient descent method". More...

#include <MinimizeN.h>

Public Types

typedef Vec< Dim, RealVec
 
typedef function< Real(Vec)> Func
 

Public Member Functions

 MinimizeN (Real tol=Real_::zeroTol, int iterMax=30, int levelMax=30, int bracketMax=30)
 
tuple< Vec, Realcalc (const Func &func, const Vec &min, const Vec &max, const Vec &init)
 Find the minimum of a function within bounds [min,max] using init as an initial guess. More...
 

Static Public Attributes

static const int dim = Dim
 

Detailed Description

template<class Real, int Dim>
class honey::MinimizeN< Real, Dim >

Find a local minimum of an n-dimensional function using "Powell's conjugate gradient descent method".

Member Typedef Documentation

template<class Real , int Dim>
typedef function<Real (Vec)> honey::MinimizeN< Real, Dim >::Func
template<class Real , int Dim>
typedef Vec<Dim, Real> honey::MinimizeN< Real, Dim >::Vec

Constructor & Destructor Documentation

template<class Real , int Dim>
honey::MinimizeN< Real, Dim >::MinimizeN ( Real  tol = Real_::zeroTol,
int  iterMax = 30,
int  levelMax = 30,
int  bracketMax = 30 
)
inline
Parameters
tolfind minimum to within tolerance
iterMaxmax number of iterations for gradient descent method
levelMaxsee Minimize
bracketMaxsee Minimize

Member Function Documentation

template<class Real , int Dim>
auto honey::MinimizeN< Real, Dim >::calc ( const Func func,
const Vec min,
const Vec max,
const Vec init 
)

Find the minimum of a function within bounds [min,max] using init as an initial guess.

The algorithm starts at point init and searches for a minimum along each coordinate axis using the Minimize class. A "conjugate" vector is then created by adding the deltas along each axis. A new starting point is then found by taking the minimum along the conjugate vector. The most successful axis is then replaced with the conjugate to minimize linear dependency. The direction set is cycled and the algorithm repeats to iterMax.

Parameters
func
minminimum lower bound
maxminimum upper bound
initinitial guess of minimum
Return values
argMinthe function arg that results in the minimum
valMinthe minimum

Member Data Documentation

template<class Real , int Dim>
const int honey::MinimizeN< Real, Dim >::dim = Dim
static

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