Herwig
7.2.1
|
This class is designed to find the root of a given function between 2 limits using bisection methods. More...
#include <GSLBisection.h>
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 | |
GSLBisection & | operator= (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 &) | |
ReferenceCounted & | operator= (const ReferenceCounted &) |
ReferenceCounted (const ReferenceCounted &) | |
ReferenceCounted & | operator= (const ReferenceCounted &) |
This class is designed to find the root of a given function between 2 limits using bisection methods.
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.
|
inline |
Specify all the parameters.
abserr | Absolute error. |
relerr | Relative error. |
max | Maximum number of intervals |
Definition at line 78 of file GSLBisection.h.
|
privatedelete |
The assignment operator is private and must never be called.
In fact, it should not even be implemented.
|
inline |
The result of the root finding.
function | The integrand class that defines operator() |
lower | The lower limit of integration. |
upper | The upper limit of integration. |