herwig is hosted by Hepforge, IPPP Durham
Herwig  7.1.5
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...
 

Public Member Functions

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. More...
 
Standard constructors and destructors.
 GSLBisection ()
 Default Constructor.
 
 GSLBisection (double abserr, double relerr, int max)
 Specify all the parameters. More...
 
- Public Member Functions inherited from ThePEG::Pointer::ReferenceCounted
CounterType referenceCount () const
 

Static Public Member Functions

static void GSLsubstHandler (const char *, const char *, int, int)
 Function to overwrite the default GSL error handling.
 

Private Member Functions

GSLBisectionoperator= (const GSLBisection &)=delete
 The assignment operator is private and must never be called. More...
 

Private Attributes

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.
 

Additional Inherited Members

- Public Types inherited from ThePEG::Pointer::ReferenceCounted
typedef unsigned int CounterType
 
- 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 &)
 
 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()

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

◆ 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.

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