1 #ifndef PhysicsTools_Utilities_Integral_h
2 #define PhysicsTools_Utilities_Integral_h
10 template<
typename F,
typename X = no_var>
26 return p(max) -
p(min);
32 template<
typename Integrator,
typename F,
typename X = no_var>
41 function(
const F &
f) :
f_(
f) { }
52 template<
typename Integrator,
typename F>
64 template<
typename F,
typename X = no_var>
struct Integral {
68 template<
typename X,
typename F>
73 template<
typename X,
typename F,
typename Integrator>
78 template<
typename F,
typename Integrator>
83 template<
typename X,
typename F>
85 return integral<X>(
f)(min, max);
88 template<
typename X,
typename F,
typename Integrator>
90 return integral<X>(
f, integrator)(min, max);
103 template<
typename F,
typename Integrator>
108 template<
typename F,
typename MIN,
typename MAX,
typename Integrator = no_var,
typename X = no_var>
122 template<
typename F,
typename MIN,
typename MAX,
typename X>
135 template<
typename F,
typename MIN,
typename MAX,
typename Integrator>
149 template<
typename F,
typename MIN,
typename MAX>
163 #define NUMERICAL_INTEGRAL(X, F, INTEGRATOR) \
165 template<typename X> struct Integral<F, X> { \
166 typedef NumericalIntegral<INTEGRATOR, F, X> type; \
169 struct __useless_ignoreme
171 #define NUMERICAL_FUNCT_INTEGRAL(F, INTEGRATOR) \
173 template<> struct Integral<F, no_var> { \
174 typedef NumericalIntegral<INTEGRATOR, F> type; \
177 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)
const T & max(const T &a, const T &b)
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