1 #ifndef PhysicsTools_Utilities_Primitive_h
2 #define PhysicsTools_Utilities_Primitive_h
9 #include <boost/type_traits.hpp>
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>
65 pow(_._1, num<n + 1>()) / num<n + 1>());
72 num<-1>()/(num<n - 1>() *
pow(_._2._1, num<n - 1>())));
76 num<-1>()/(num<n - 1>() *
pow(_._1._2, num<n - 1>())));
83 (fract<m, n + m>() *
pow(_._1, fract<n + m, m>())));
89 (fract<2, 3>() *
pow(_._, fract<3, 2>())));
100 _._ * (_ - num<1>()));
147 primitive<X>(_._1) + primitive<X>(_._2));
159 bool bint = ::boost::type_traits::ice_not<
161 bool aint = ::boost::type_traits::ice_not<
170 typedef
DERIV(X, A) A1;
175 B1
b = primitive<X>(_._2);
176 return a * b - primitive<X>(derivative<X>(
a) * b);
182 typedef
DERIV(X, A) A1;
187 B1
b = primitive<X>(_._1);
188 return a * b - primitive<X>(derivative<X>(
a) * b);
193 public PartIntegral<X, A, B, true,
false> { };
222 bool bint = ::boost::type_traits::ice_not<
225 bool aint = ::boost::type_traits::ice_not<
226 ::boost::is_same<
PRIMIT(X, A),
227 UndefinedIntegral>::value>::value>
235 typedef
DERIV(X, A) A1;
237 typedef
DIFF(
PROD(A, B1), AB1) type;
240 B1
b = primitive<X>(num<1>() / _._2);
241 return a * b - primitive<X>(derivative<X>(
a) * b);
245 TEMPL(XT2) struct PartIntegral2<X, B, A, false, true> {
247 typedef
DERIV(X, A) A1;
249 typedef
DIFF(
PROD(A, B1), AB1) type;
252 B1
b = primitive<X>(num<1>() / _._2);
253 return a * b - primitive<X>(derivative<X>(
a) * b);
258 TEMPL(XT2) struct PartIntegral2<X, A, B, true, true> :
259 public PartIntegral2<X, A, B, true, false> { };
298 #define DECLARE_PRIMITIVE(X, F, P) \
300 template<typename X> struct Primitive<F, X> { \
302 inline static type get(const F& _) \
303 { return type(_._); } \
306 struct __useless_ignoreme
308 #define DECLARE_FUNCT_PRIMITIVE(F, P) \
310 template<> struct Primitive<F> { \
312 inline static type get(const F& _) \
316 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)