Loading...
Searching...
No Matches
PLMD::Brent1DRootSearch< FCLASS > Class Template Reference

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

#include <Brent1DRootSearch.h>

Public Member Functions

 Brent1DRootSearch (const FCLASS &pf, double t=3.0E-8)
 
void bracket (double ax, double xx, eng_pointer eng)
 Bracket the minium.
 
double search (eng_pointer eng)
 Find the minimum between two brackets.
 

Private Types

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

Private Attributes

double ax =0.0
 Three points bracketting the minimum and the corresponding function values.
 
bool bracketed =false
 Has the minimum been bracketed.
 
double bx =0.0
 
double fa =0.0
 
double fb =0.0
 
FCLASS myclass_func
 The class containing the function we are trying to minimise.
 
double tol
 The tolerance for the line minimiser.
 

Static Private Attributes

static constexpr double EPS =3.0e-8
 A small number that protects against trying to achieve fractional accuracy for a minimum that happens to be exactly zero.
 
static constexpr double EXPAND =1.6
 The factor by which to expand the range when bracketing.
 
static constexpr unsigned ITMAX =100
 Maximum number of interactions in line minimiser.
 

Detailed Description

template<class FCLASS>
class PLMD::Brent1DRootSearch< 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::Brent1DRootSearch< FCLASS >::eng_pointer) (const double &val)
private

This is the type specifier for the function to minimise.

Constructor & Destructor Documentation

◆ Brent1DRootSearch()

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

Member Function Documentation

◆ bracket()

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

Bracket the minium.

◆ search()

template<class FCLASS>
double PLMD::Brent1DRootSearch< FCLASS >::search ( eng_pointer eng)

Find the minimum between two brackets.

Member Data Documentation

◆ ax

template<class FCLASS>
double PLMD::Brent1DRootSearch< FCLASS >::ax =0.0
private

Three points bracketting the minimum and the corresponding function values.

◆ bracketed

template<class FCLASS>
bool PLMD::Brent1DRootSearch< FCLASS >::bracketed =false
private

Has the minimum been bracketed.

◆ bx

template<class FCLASS>
double PLMD::Brent1DRootSearch< FCLASS >::bx =0.0
private

◆ EPS

template<class FCLASS>
double PLMD::Brent1DRootSearch< FCLASS >::EPS =3.0e-8
staticconstexprprivate

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

◆ EXPAND

template<class FCLASS>
double PLMD::Brent1DRootSearch< FCLASS >::EXPAND =1.6
staticconstexprprivate

The factor by which to expand the range when bracketing.

◆ fa

template<class FCLASS>
double PLMD::Brent1DRootSearch< FCLASS >::fa =0.0
private

◆ fb

template<class FCLASS>
double PLMD::Brent1DRootSearch< FCLASS >::fb =0.0
private

◆ ITMAX

template<class FCLASS>
unsigned PLMD::Brent1DRootSearch< FCLASS >::ITMAX =100
staticconstexprprivate

Maximum number of interactions in line minimiser.

◆ myclass_func

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

The class containing the function we are trying to minimise.

◆ tol

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

The tolerance for the line minimiser.


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