1 #ifndef PhysicsTools_Utilities_Integral_h 2 #define PhysicsTools_Utilities_Integral_h 10 template <
typename F,
typename X = no_var>
34 template <
typename Integrator,
typename F,
typename X = no_var>
37 inline double operator()(
double min,
double max)
const {
return integrator_(f_, min, max); }
41 function(
const F&
f) : f_(
f) {}
54 template <
typename Integrator,
typename F>
64 template <
typename F,
typename X = no_var>
69 template <
typename X,
typename F>
74 template <
typename X,
typename F,
typename Integrator>
79 template <
typename F,
typename Integrator>
84 template <
typename X,
typename F>
86 return integral<X>(
f)(min, max);
89 template <
typename X,
typename F,
typename Integrator>
91 return integral<X>(
f, integrator)(min, max);
104 template <
typename F,
typename Integrator>
109 template <
typename F,
typename MIN,
typename MAX,
typename Integrator = no_var,
typename X = no_var>
112 : f_(f), min_(min), max_(max), integrator_(integrator) {}
113 double operator()()
const {
return integral<X>(f_, min_(), max_(), integrator_); }
122 template <
typename F,
typename MIN,
typename MAX,
typename X>
125 double operator()(
double x)
const {
return integral<X>(f_, min_(x), max_(x)); }
133 template <
typename F,
typename MIN,
typename MAX,
typename Integrator>
136 : f_(f), min_(min), max_(max), integrator_(integrator) {}
146 template <
typename F,
typename MIN,
typename MAX>
159 #define NUMERICAL_INTEGRAL(X, F, INTEGRATOR) \ 161 template <typename X> \ 162 struct Integral<F, X> { \ 163 typedef NumericalIntegral<INTEGRATOR, F, X> type; \ 166 struct __useless_ignoreme 168 #define NUMERICAL_FUNCT_INTEGRAL(F, INTEGRATOR) \ 171 struct Integral<F, no_var> { \ 172 typedef NumericalIntegral<INTEGRATOR, F> type; \ 175 struct __useless_ignoreme
DefIntegral(const F &f, const MIN &min, const MAX &max, const Integrator &integrator)
double operator()(double min, double max) const
IntegralStruct(const F &f)
double operator()(double x) const
double operator()(double x) const
double operator()(double min, double max) const
Integral< F >::type integral_f(const F &f, const Integrator &integrator)
DefIntegral(const F &f, const MIN &min, const MAX &max)
NumericalIntegral(const F &f, const Integrator &integrator)
IntegralStruct< F, X > type
Primitive< F, X >::type primitive(const F &f)
DefIntegral(const F &f, const MIN &min, const MAX &max, const Integrator &integrator)
Primitive< F, X >::type p
double operator()(double min, double max) const
static void set(const double &x)
double operator()(double min, double max) const
Integral< F, X >::type integral(const F &f)
IntegralStruct(const F &f)
double operator()(double x) const
DefIntegral(const F &f, const MIN &min, const MAX &max)
NumericalIntegral(const F &f, const Integrator &integrator)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
double operator()(double x) const
double operator()() const