CMS 3D CMS Logo

Simplify_begin.h
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
4 #define TYP0
5 
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
10 
11 #define TYPN1 int n
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
15 
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
21 
22 #define TYPX typename X
23 
24 #define TYPXT1 typename X, typename A
25 #define TYPXT2 typename X, typename A, typename B
26 
27 #define TYPXN1 typename X, int n
28 #define TYPXN2 typename X, int n, int m
29 
30 #define TYPXN1T1 typename X, int n, typename A
31 #define TYPXN2T1 typename X, int n, int m, typename A
32 
33 #define TEMPL(X) template <TYP##X>
34 
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>
51 
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
69 
70 #define COMBINE(A, B, RES) \
71  inline static type combine(const A& _1, const B& _2) { return RES; } \
72  struct __useless_ignoreme
73 
74 #define MINUS_RULE(TMPL, T, RES, COMB) \
75  template <TMPL> \
76  struct Minus<T> { \
77  typedef RES type; \
78  inline static type operate(const T& _) { return COMB; } \
79  }
80 
81 #define SUM_RULE(TMPL, T1, T2, RES, COMB) \
82  template <TMPL> \
83  struct Sum<T1, T2> { \
84  typedef RES type; \
85  inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
86  }
87 
88 #define DIFF_RULE(TMPL, T1, T2, RES, COMB) \
89  template <TMPL> \
90  struct Difference<T1, T2> { \
91  typedef RES type; \
92  inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
93  }
94 
95 #define PROD_RULE(TMPL, T1, T2, RES, COMB) \
96  template <TMPL> \
97  struct Product<T1, T2> { \
98  typedef RES type; \
99  inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
100  }
101 
102 #define RATIO_RULE(TMPL, T1, T2, RES, COMB) \
103  template <TMPL> \
104  struct Ratio<T1, T2> { \
105  typedef RES type; \
106  inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
107  }
108 
109 #define POWER_RULE(TMPL, T1, T2, RES, COMB) \
110  template <TMPL> \
111  struct Power<T1, T2> { \
112  typedef RES type; \
113  inline static type combine(const T1& _1, const T2& _2) { return COMB; } \
114  }
115 
116 #define EXP_RULE(TMPL, T, RES, COMB) \
117  template <TMPL> \
118  struct Exp<T> { \
119  typedef RES type; \
120  inline static type compose(const T& _) { return COMB; } \
121  }
122 
123 #define LOG_RULE(TMPL, T, RES, COMB) \
124  template <TMPL> \
125  struct Log<T> { \
126  typedef RES type; \
127  inline static type compose(const T& _) { return COMB; } \
128  }
129 
130 #define SIN_RULE(TMPL, T, RES, COMB) \
131  template <TMPL> \
132  struct Sin<T> { \
133  typedef RES type; \
134  inline static type compose(const T& _) { return COMB; } \
135  }
136 
137 #define COS_RULE(TMPL, T, RES, COMB) \
138  template <TMPL> \
139  struct Cos<T> { \
140  typedef RES type; \
141  inline static type compose(const T& _) { return COMB; } \
142  }
143 
144 #define TAN_RULE(TMPL, T, RES, COMB) \
145  template <TMPL> \
146  struct Tan<T> { \
147  typedef RES type; \
148  inline static type compose(const T& _) { return COMB; } \
149  }
150 
151 #define GET(A, RES) \
152  inline static type get(const A& _) { return RES; } \
153  \
154  struct __useless_ignoreme
155 
156 #define DERIV(X, A) typename Derivative<X, A>::type
157 #define PRIMIT(X, A) typename Primitive<A, X>::type
158 
159 #define DERIV_RULE(TMPL, T, RES, COMB) \
160  template <TMPL> \
161  struct Derivative<X, T> { \
162  typedef RES type; \
163  inline static type get(const T& _) { return COMB; } \
164  }
165 
166 #define PRIMIT_RULE(TMPL, T, RES, COMB) \
167  template <TMPL> \
168  struct Primitive<T, X> { \
169  typedef RES type; \
170  inline static type get(const T& _) { return COMB; } \
171  }
172 
173 #endif