Herwig 7.3.0
|
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... | |
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. | |
GSLBisection & | operator= (const GSLBisection &)=delete |
The assignment operator is private and must never be called. | |
Additional Inherited Members | |
![]() | |
typedef unsigned int | CounterType |
![]() | |
CounterType | referenceCount () const |
![]() | |
const unsigned long | uniqueId |
![]() | |
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 |
Default Constructor.
Definition at line 70 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.
|
inlinestatic |
Function to overwrite the default GSL error handling.
Definition at line 86 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. |
|
private |
The parameters controlling the absolute error.
Definition at line 115 of file GSLBisection.h.
|
private |
The maximum number of evaluations to use.
Definition at line 125 of file GSLBisection.h.
|
private |
The parameters controlling the relatve error.
Definition at line 120 of file GSLBisection.h.