1 #ifndef PhysicsTools_Utilities_Primitive_h
2 #define PhysicsTools_Utilities_Primitive_h
28 template <
typename X,
typename F>
31 inline static type get(
const F&
f) {
return f *
X(); }
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>())));
167 typedef
DERIV(X, A) A1;
172 B1
b = primitive<X>(_._2);
173 return a * b - primitive<X>(derivative<X>(
a) * b);
179 typedef
DERIV(X, A) A1;
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> {};
225 typedef
DERIV(X, A) A1;
227 typedef
DIFF(
PROD(A, B1), AB1) type;
230 B1
b = primitive<X>(num<1>() / _._2);
231 return a * b - primitive<X>(derivative<X>(
a) * b);
235 TEMPL(XT2) struct PartIntegral2<X, B, A, false, true> {
237 typedef
DERIV(X, A) A1;
239 typedef
DIFF(
PROD(A, B1), AB1) type;
242 B1
b = primitive<X>(num<1>() / _._2);
243 return a * b - primitive<X>(derivative<X>(
a) * b);
248 TEMPL(XT2) struct PartIntegral2<X, A, B, true, true> : public PartIntegral2<X, A, B, true, false> {};
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
const Numerical< n > & num()
typedef POWER(A, NUM(n)) arg
Sin< T >::type sin(const T &t)
Primitive< F, X >::type primitive(const F &f)
GET(PROD_S(A, B), type())
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
typedef PRIMIT(X, PROD(A1, B1)) AB1
Product< Parameter, Identity >::type type
static type get(const F &f)
Log< T >::type log(const T &t)
TEMPL(T1) struct Divides0
typedef PROD(F, SUM(RATIO(A, F), RATIO(B, F))) type
PRIMIT_RULE(TYPXT2, POWER_S(A, B), UndefinedIntegral, type())
typedef DIFF(PROD(A, B1), PRIMIT(X, PROD(A1, B1))) type
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
static type get(const PROD_S(A, B)&_)
GET(RATIO_S(A, B), type())
Power< A, B >::type pow(const A &a, const B &b)