Public Member Functions | Private Types | Private Attributes | List of all members
PLMD::Minimise1DBrent< FCLASS > Class Template Reference

A class for doing parabolic interpolation and minimisation of 1D functions using Brent's method. More...

#include <Minimise1DBrent.h>

Public Member Functions

 Minimise1DBrent (const FCLASS &pf, const double &t=3.0E-8)
 
void bracket (const double &ax, const double &xx, eng_pointer eng)
 Bracket the minium. More...
 
double getMinimumValue () const
 Return the value of the function at the minimum. More...
 
double minimise (eng_pointer eng)
 Find the minimum between two brackets. More...
 

Private Types

typedef double(FCLASS::* eng_pointer) (const double &val)
 This is the type specifier for the function to minimise. More...
 

Private Attributes

double ax
 Three points bracketting the minimum and the corresponding function values. More...
 
bool bracketed
 Has the minimum been bracketed. More...
 
double bx
 
const double CGOLD
 The value of the golden ratio. More...
 
double cx
 
double fa
 
double fb
 
double fc
 
double fmin
 
const double GLIMIT
 The maximum magnification allowed for a parabolic fit step. More...
 
const double GOLD
 The default ration by which successive intervals are magnified. More...
 
const unsigned ITMAX
 Maximum number of interactions in line minimiser. More...
 
bool minimised
 Has the function been minimised. More...
 
FCLASS myclass_func
 The class containing the function we are trying to minimise. More...
 
const double TINY
 Use to prevent any possible division by zero. More...
 
double tol
 The tolerance for the line minimiser. More...
 
const double ZEPS
 A small number that protects against trying to achieve fractional accuracy for a minimum that happens to be exactly zero. More...
 

Detailed Description

template<class FCLASS>
class PLMD::Minimise1DBrent< FCLASS >

A class for doing parabolic interpolation and minimisation of 1D functions using Brent's method.

Member Typedef Documentation

◆ eng_pointer

template<class FCLASS >
typedef double(FCLASS::* PLMD::Minimise1DBrent< FCLASS >::eng_pointer) (const double &val)
private

This is the type specifier for the function to minimise.

Constructor & Destructor Documentation

◆ Minimise1DBrent()

template<class FCLASS >
PLMD::Minimise1DBrent< FCLASS >::Minimise1DBrent ( const FCLASS &  pf,
const double &  t = 3.0E-8 
)
explicit

Member Function Documentation

◆ bracket()

template<class FCLASS >
void PLMD::Minimise1DBrent< FCLASS >::bracket ( const double &  ax,
const double &  xx,
eng_pointer  eng 
)

Bracket the minium.

◆ getMinimumValue()

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::getMinimumValue

Return the value of the function at the minimum.

◆ minimise()

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::minimise ( eng_pointer  eng)

Find the minimum between two brackets.

Member Data Documentation

◆ ax

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::ax
private

Three points bracketting the minimum and the corresponding function values.

◆ bracketed

template<class FCLASS >
bool PLMD::Minimise1DBrent< FCLASS >::bracketed
private

Has the minimum been bracketed.

◆ bx

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::bx
private

◆ CGOLD

template<class FCLASS >
const double PLMD::Minimise1DBrent< FCLASS >::CGOLD
private

The value of the golden ratio.

◆ cx

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::cx
private

◆ fa

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::fa
private

◆ fb

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::fb
private

◆ fc

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::fc
private

◆ fmin

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::fmin
private

◆ GLIMIT

template<class FCLASS >
const double PLMD::Minimise1DBrent< FCLASS >::GLIMIT
private

The maximum magnification allowed for a parabolic fit step.

◆ GOLD

template<class FCLASS >
const double PLMD::Minimise1DBrent< FCLASS >::GOLD
private

The default ration by which successive intervals are magnified.

◆ ITMAX

template<class FCLASS >
const unsigned PLMD::Minimise1DBrent< FCLASS >::ITMAX
private

Maximum number of interactions in line minimiser.

◆ minimised

template<class FCLASS >
bool PLMD::Minimise1DBrent< FCLASS >::minimised
private

Has the function been minimised.

◆ myclass_func

template<class FCLASS >
FCLASS PLMD::Minimise1DBrent< FCLASS >::myclass_func
private

The class containing the function we are trying to minimise.

◆ TINY

template<class FCLASS >
const double PLMD::Minimise1DBrent< FCLASS >::TINY
private

Use to prevent any possible division by zero.

◆ tol

template<class FCLASS >
double PLMD::Minimise1DBrent< FCLASS >::tol
private

The tolerance for the line minimiser.

◆ ZEPS

template<class FCLASS >
const double PLMD::Minimise1DBrent< FCLASS >::ZEPS
private

A small number that protects against trying to achieve fractional accuracy for a minimum that happens to be exactly zero.


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