herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Herwig::GSLBisection Class Reference

This class is designed to find the root of a given function between 2 limits using bisection methods. More...

#include <GSLBisection.h>

Inheritance diagram for Herwig::GSLBisection:

Classes

struct  GSLerror
 Struct that is used to throw and catch GSL errors. More...
 
struct  IntervalError
 Struct that is used to throw and catch GSL errors. More...
 

Standard constructors and destructors.

double abserr_
 The parameters controlling the absolute error.
 
double relerr_
 The parameters controlling the relatve error.
 
int maxPoints_
 The maximum number of evaluations to use.
 
 GSLBisection ()
 Default Constructor.
 
 GSLBisection (double abserr, double relerr, int max)
 Specify all the parameters.
 
template<class T >
T::ArgType value (const T &function, const typename T::ArgType lower, const typename T::ArgType upper) const
 The result of the root finding.
 
static void GSLsubstHandler (const char *, const char *, int, int)
 Function to overwrite the default GSL error handling.
 
GSLBisectionoperator= (const GSLBisection &)=delete
 The assignment operator is private and must never be called.
 

Additional Inherited Members

- Public Types inherited from ThePEG::Pointer::ReferenceCounted
typedef unsigned int CounterType
 
- Public Member Functions inherited from ThePEG::Pointer::ReferenceCounted
CounterType referenceCount () const
 
- Public Attributes inherited from ThePEG::Pointer::ReferenceCounted
const unsigned long uniqueId
 
- Protected Member Functions inherited from ThePEG::Pointer::ReferenceCounted
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 

Detailed Description

This class is designed to find the root of a given function between 2 limits using bisection methods.

Author
Manuel B"ahr

The function is supplied using a templated class that must define operator(argument). The units of the argument ArgType and return type ValType must be supplied in the integrand class using a typedef. In addition the baseunit should be supplied by static methods vUnit() and aUnit() to avoid numerical problems that arise when the centrally defined baseunit is several orders of magnitude off the one you need. As an example see:
struct integrand {
...
Energy operator(CrossSection arg) const;
typedef CrossSection ArgType
typedef Energy ValType
static ArgType aUnit(){return 1.*millibarn;}
static ValType vUnit(){return 1.*MeV;}
...
}
This can be facilitated by deriving from the GSLHelper struct. Which implents the vUnit() and aUnit() methods using the baseunit static method. Also the typedefs are written there.

Definition at line 51 of file GSLBisection.h.

Constructor & Destructor Documentation

◆ GSLBisection() [1/2]

Herwig::GSLBisection::GSLBisection ( )
inline

Default Constructor.

Definition at line 70 of file GSLBisection.h.

◆ GSLBisection() [2/2]

Herwig::GSLBisection::GSLBisection ( double  abserr,
double  relerr,
int  max 
)
inline

Specify all the parameters.

Parameters
abserrAbsolute error.
relerrRelative error.
maxMaximum number of intervals

Definition at line 78 of file GSLBisection.h.

Member Function Documentation

◆ GSLsubstHandler()

static void Herwig::GSLBisection::GSLsubstHandler ( const char *  ,
const char *  ,
int  ,
int   
)
inlinestatic

Function to overwrite the default GSL error handling.

Definition at line 86 of file GSLBisection.h.

◆ operator=()

GSLBisection & Herwig::GSLBisection::operator= ( const GSLBisection )
privatedelete

The assignment operator is private and must never be called.

In fact, it should not even be implemented.

◆ value()

template<class T >
T::ArgType Herwig::GSLBisection::value ( const T &  function,
const typename T::ArgType  lower,
const typename T::ArgType  upper 
) const
inline

The result of the root finding.

Parameters
functionThe integrand class that defines operator()
lowerThe lower limit of integration.
upperThe upper limit of integration.

Member Data Documentation

◆ abserr_

double Herwig::GSLBisection::abserr_
private

The parameters controlling the absolute error.

Definition at line 115 of file GSLBisection.h.

◆ maxPoints_

int Herwig::GSLBisection::maxPoints_
private

The maximum number of evaluations to use.

Definition at line 125 of file GSLBisection.h.

◆ relerr_

double Herwig::GSLBisection::relerr_
private

The parameters controlling the relatve error.

Definition at line 120 of file GSLBisection.h.


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