File indexing completed on 2026-08-06 09:24:23
0001
0002
0003
0004
0005
0006 #ifndef matchbox_math_gsl_h
0007 #define matchbox_math_gsl_h
0008
0009 #include "gsl/gsl_math.h"
0010 #include "gsl/gsl_roots.h"
0011
0012 #include "ThePEG/Utilities/Exception.h"
0013
0014 namespace matchbox {
0015
0016 namespace gsl {
0017
0018
0019 struct gsl_exception : public ThePEG::Exception { };
0020
0021
0022 template<class Function, unsigned long MaxIterations>
0023 struct bisection_root_solver {
0024
0025
0026 inline bisection_root_solver (const Function& thef) : f(thef) {
0027 s = gsl_root_fsolver_alloc (gsl_root_fsolver_bisection);
0028 }
0029
0030
0031 ~bisection_root_solver () {
0032 gsl_root_fsolver_free (s);
0033 }
0034
0035
0036 double solve (std::pair<double,double> interval, double precision = .000001);
0037
0038
0039 Function f;
0040
0041
0042 gsl_root_fsolver * s;
0043
0044 };
0045
0046 }
0047
0048 }
0049
0050 #include "gsl.tcc"
0051
0052 #endif