|
|
Go to the documentation of this file. 1 #ifndef PhysicsTools_Utilities_Simplify_begin_h
2 #define PhysicsTools_Utilities_Simplify_begin_h
3 #undef PhysicsTools_Utilities_Simplify_end_h
6 #define TYPT1 typename A
7 #define TYPT2 typename A, typename B
8 #define TYPT3 typename A, typename B, typename C
9 #define TYPT4 typename A, typename B, typename C, typename D
12 #define TYPN2 int n, int m
13 #define TYPN3 int n, int m, int k
14 #define TYPN4 int n, int m, int k, int l
16 #define TYPN1T1 int n, typename A
17 #define TYPN1T2 int n, typename A, typename B
18 #define TYPN2T1 int n, int m, typename A
19 #define TYPN2T2 int n, int m, typename A, typename B
20 #define TYPN3T1 int n, int m, int k, typename A
22 #define TYPX typename X
24 #define TYPXT1 typename X, typename A
25 #define TYPXT2 typename X, typename A, typename B
27 #define TYPXN1 typename X, int n
28 #define TYPXN2 typename X, int n, int m
30 #define TYPXN1T1 typename X, int n, typename A
31 #define TYPXN2T1 typename X, int n, int m, typename A
33 #define TEMPL(X) template <TYP##X>
35 #define NUM(N) Numerical<N>
36 #define FRACT(N, M) typename Fraction<N, M>::type
37 #define SUM_S(A, B) SumStruct<A, B>
38 #define MINUS_S(A) MinusStruct<A>
39 #define PROD_S(A, B) ProductStruct<A, B>
40 #define RATIO_S(A, B) RatioStruct<A, B>
41 #define POWER_S(A, B) PowerStruct<A, B>
42 #define FRACT_S(N, M) FractionStruct<N, M>
43 #define SQRT_S(A) SqrtStruct<A>
44 #define EXP_S(A) ExpStruct<A>
45 #define LOG_S(A) LogStruct<A>
46 #define SIN_S(A) SinStruct<A>
47 #define COS_S(A) CosStruct<A>
48 #define TAN_S(A) TanStruct<A>
49 #define ABS_S(A) AbsStruct<A>
50 #define SGN_S(A) SgnStruct<A>
52 #define SUM(A, B) typename Sum<A, B>::type
53 #define DIFF(A, B) typename Difference<A, B>::type
54 #define MINUS(A) typename Minus<A>::type
55 #define PROD(A, B) typename Product<A, B>::type
56 #define RATIO(A, B) typename Ratio<A, B>::type
57 #define POWER(A, B) typename Power<A, B>::type
58 #define SQUARE(A) typename Square<A>::type
59 #define SQRT(A) typename Sqrt<A>::type
60 #define EXP(A) typename Exp<A>::type
61 #define LOG(A) typename Log<A>::type
62 #define SIN(A) typename Sin<A>::type
63 #define COS(A) typename Cos<A>::type
64 #define SIN2(A) typename Sin2<A>::type
65 #define COS2(A) typename Cos2<A>::type
66 #define TAN(A) typename Tan<A>::type
67 #define ABS(A) typename Abs<A>::type
68 #define SGN(A) typename Sgn<A>::type
70 #define COMBINE(A, B, RES) \
71 inline static type combine(const A& _1, const B& _2) { return RES; } \
72 struct __useless_ignoreme
74 #define MINUS_RULE(TMPL, T, RES, COMB) \
78 inline static type operate(const T& _) { return COMB; } \
81 #define SUM_RULE(TMPL, T1, T2, RES, COMB) \
83 struct Sum<T1, T2> { \
85 inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
88 #define DIFF_RULE(TMPL, T1, T2, RES, COMB) \
90 struct Difference<T1, T2> { \
92 inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
95 #define PROD_RULE(TMPL, T1, T2, RES, COMB) \
97 struct Product<T1, T2> { \
99 inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
102 #define RATIO_RULE(TMPL, T1, T2, RES, COMB) \
104 struct Ratio<T1, T2> { \
106 inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
109 #define POWER_RULE(TMPL, T1, T2, RES, COMB) \
111 struct Power<T1, T2> { \
113 inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
116 #define EXP_RULE(TMPL, T, RES, COMB) \
120 inline static type compose(const T& _) { return COMB; } \
123 #define LOG_RULE(TMPL, T, RES, COMB) \
127 inline static type compose(const T& _) { return COMB; } \
130 #define SIN_RULE(TMPL, T, RES, COMB) \
134 inline static type compose(const T& _) { return COMB; } \
137 #define COS_RULE(TMPL, T, RES, COMB) \
141 inline static type compose(const T& _) { return COMB; } \
144 #define TAN_RULE(TMPL, T, RES, COMB) \
148 inline static type compose(const T& _) { return COMB; } \
151 #define GET(A, RES) \
152 inline static type get(const A& _) { return RES; } \
154 struct __useless_ignoreme
156 #define DERIV(X, A) typename Derivative<X, A>::type
157 #define PRIMIT(X, A) typename Primitive<A, X>::type
159 #define DERIV_RULE(TMPL, T, RES, COMB) \
161 struct Derivative<X, T> { \
163 inline static type get(const T& _) { return COMB; } \
166 #define PRIMIT_RULE(TMPL, T, RES, COMB) \
168 struct Primitive<T, X> { \
170 inline static type get(const T& _) { return COMB; } \