1 #ifndef PhysicsTools_Utilities_Primitive_h 2 #define PhysicsTools_Utilities_Primitive_h 9 #include <boost/type_traits.hpp> 22 inline static type
get(
const F&
f) {
return type(); }
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));
168 typedef
DERIV(X, A) A1;
173 B1
b = primitive<X>(_._2);
174 return a * b - primitive<X>(derivative<X>(
a) * b);
180 typedef DERIV(X, A) A1;
183 inline static type
get(
const PROD_S(B, A)&
_) {
185 B1
b = primitive<X>(
_._1);
186 return a * b - primitive<X>(derivative<X>(
a) * b);
229 typedef
DERIV(X, A) A1;
231 typedef
DIFF(
PROD(A, B1), AB1) type;
234 B1
b = primitive<X>(num<1>() / _._2);
235 return a * b - primitive<X>(derivative<X>(
a) * b);
241 typedef DERIV(X, A) A1;
246 B1
b = primitive<X>(num<1>() /
_._2);
247 return a * b - primitive<X>(derivative<X>(
a) * b);
292 #define DECLARE_PRIMITIVE(X, F, P) \ 294 template<typename X> struct Primitive<F, X> { \ 296 inline static type get(const F& _) \ 297 { return type(_._); } \ 300 struct __useless_ignoreme 302 #define DECLARE_FUNCT_PRIMITIVE(F, P) \ 304 template<> struct Primitive<F> { \ 306 inline static type get(const F& _) \ 310 struct __useless_ignoreme
typedef POWER(A, NUM(n)) arg
Sin< T >::type sin(const T &t)
Primitive< F, X >::type primitive(const F &f)
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)&_)
Power< A, B >::type pow(const A &a, const B &b)