herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
gsl.h
1// -*- C++ -*-
2
3// math/gsl.h is part of matchbox
4// (C) 2008 Simon Platzer -- sp@particle.uni-karlsruhe.de
5
6#ifndef matchbox_math_gsl_h
7#define matchbox_math_gsl_h
8
9#include "gsl/gsl_math.h"
10#include "gsl/gsl_roots.h"
11
12#include "ThePEG/Utilities/Exception.h"
13
14namespace matchbox {
15
16 namespace gsl {
17
19 struct gsl_exception : public ThePEG::Exception { };
20
22 template<class Function, unsigned long MaxIterations>
24
26 inline bisection_root_solver (const Function& thef) : f(thef) {
27 s = gsl_root_fsolver_alloc (gsl_root_fsolver_bisection);
28 }
29
32 gsl_root_fsolver_free (s);
33 }
34
36 double solve (std::pair<double,double> interval, double precision = .000001);
37
39 Function f;
40
42 gsl_root_fsolver * s;
43
44 };
45
46 }
47
48}
49
50#include "gsl.tcc"
51
52#endif // matchbox_math_gsl_h
wrapper araound the bisection root solver
Definition: gsl.h:23
Function f
function object representing the equation to be solved
Definition: gsl.h:39
bisection_root_solver(const Function &thef)
constructor – allocates the solver
Definition: gsl.h:26
gsl_root_fsolver * s
the gsl solver used
Definition: gsl.h:42
~bisection_root_solver()
destructor – frees the solver
Definition: gsl.h:31
double solve(std::pair< double, double > interval, double precision=.000001)
solve for root given initial interval
exception class for GSL problems
Definition: gsl.h:19