1 #ifndef PhysicsTools_Utilities_Primitive_h
2 #define PhysicsTools_Utilities_Primitive_h
28 template <
typename X,
typename F>
34 template <
typename F,
typename X = no_var>
40 template <
typename X,
typename F>
66 pow(
_._1, num<n + 1>()) / num<n + 1>());
74 num<-1>() / (num<n - 1>() *
pow(
_._2._1, num<n - 1>())));
79 num<-1>() / (num<n - 1>() *
pow(
_._1._2, num<n - 1>())));
87 (fract<m, n + m>() *
pow(
_._1, fract<n + m, m>())));
158 bool bint = not ::std::is_same<
PRIMIT(
X,
B), UndefinedIntegral>
::value,
159 bool aint = not ::std::is_same<
PRIMIT(
X,
A), UndefinedIntegral>
::value>
172 B1
b = primitive<X>(
_._2);
173 return a *
b - primitive<X>(derivative<X>(
a) *
b);
184 B1
b = primitive<X>(
_._1);
185 return a *
b - primitive<X>(derivative<X>(
a) *
b);
189 TEMPL(XT2)
struct PartIntegral<
X,
A,
B,
true,
true> :
public PartIntegral<X, A, B, true, false> {};
209 TEMPL(XT2)
struct Primitive<
PROD_S(
A,
B),
X> :
public ProductPrimitive<X, A, B> {};
217 bool aint = not ::std::is_same<
PRIMIT(
X,
A), UndefinedIntegral>
::value>
230 B1
b = primitive<X>(num<1>() /
_._2);
231 return a *
b - primitive<X>(derivative<X>(
a) *
b);
242 B1
b = primitive<X>(num<1>() /
_._2);
243 return a *
b - primitive<X>(derivative<X>(
a) *
b);
283 #define DECLARE_PRIMITIVE(X, F, P) \
285 template <typename X> \
286 struct Primitive<F, X> { \
288 inline static type get(const F& _) { return type(_._); } \
291 struct __useless_ignoreme
293 #define DECLARE_FUNCT_PRIMITIVE(F, P) \
296 struct Primitive<F> { \
298 inline static type get(const F& _) { return type(); } \
301 struct __useless_ignoreme