CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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) { \
72  return RES; \
73 } \
74 struct __useless_ignoreme
75 
76 #define MINUS_RULE(TMPL, T, RES, COMB) \
77 template<TMPL> \
78 struct Minus<T> { \
79  typedef RES type; \
80  inline static type operate(const T& _) { return COMB; } \
81 }
82 
83 #define SUM_RULE(TMPL, T1, T2, RES, COMB) \
84 template<TMPL> \
85 struct Sum<T1, T2> { \
86  typedef RES type; \
87  inline static type combine(const T1& _1, const T2 & _2) { return COMB; } \
88 }
89 
90 #define DIFF_RULE(TMPL, T1, T2, RES, COMB) \
91 template<TMPL> \
92 struct Difference<T1, T2> { \
93  typedef RES type; \
94  inline static type combine(const T1& _1, const T2 & _2) { return COMB; } \
95 }
96 
97 #define PROD_RULE(TMPL, T1, T2, RES, COMB) \
98 template<TMPL> \
99 struct Product<T1, T2> { \
100  typedef RES type; \
101  inline static type combine(const T1& _1, const T2 & _2) { return COMB; } \
102 }
103 
104 #define RATIO_RULE(TMPL, T1, T2, RES, COMB) \
105 template<TMPL> \
106 struct Ratio<T1, T2> { \
107  typedef RES type; \
108  inline static type combine(const T1& _1, const T2 & _2) { return COMB; } \
109 }
110 
111 #define POWER_RULE(TMPL, T1, T2, RES, COMB) \
112 template<TMPL> \
113 struct Power<T1, T2> { \
114  typedef RES type; \
115  inline static type combine(const T1& _1, const T2 & _2) { return COMB; } \
116 }
117 
118 #define EXP_RULE(TMPL, T, RES, COMB) \
119 template< TMPL >\
120 struct Exp< T > { \
121  typedef RES type; \
122  inline static type compose(const T& _) { return COMB; } \
123 }
124 
125 #define LOG_RULE(TMPL, T, RES, COMB) \
126 template< TMPL > \
127 struct Log< T > { \
128  typedef RES type; \
129  inline static type compose(const T& _) { return COMB; } \
130 }
131 
132 #define SIN_RULE(TMPL, T, RES, COMB) \
133 template< TMPL > \
134 struct Sin< T > { \
135  typedef RES type; \
136  inline static type compose(const T& _) { return COMB; } \
137 }
138 
139 #define COS_RULE(TMPL, T, RES, COMB) \
140 template< TMPL > \
141 struct Cos< T > { \
142  typedef RES type; \
143  inline static type compose(const T& _) { return COMB; } \
144 }
145 
146 #define TAN_RULE(TMPL, T, RES, COMB) \
147 template< TMPL > \
148 struct Tan< T > { \
149  typedef RES type; \
150  inline static type compose(const T& _) { return COMB; } \
151 }
152 
153 #define GET(A, RES) \
154 inline static type get(const A& _) { return RES; } \
155  \
156 struct __useless_ignoreme
157 
158 #define DERIV(X, A) typename Derivative<X, A>::type
159 #define PRIMIT(X, A) typename Primitive<A, X>::type
160 
161 #define DERIV_RULE(TMPL, T, RES, COMB) \
162 template<TMPL> \
163 struct Derivative<X, T> \
164 { \
165  typedef RES type; \
166  inline static type get(const T& _) { return COMB; } \
167 }
168 
169 #define PRIMIT_RULE(TMPL, T, RES, COMB) \
170 template<TMPL> \
171 struct Primitive<T, X> \
172 { \
173  typedef RES type; \
174  inline static type get(const T& _) { return COMB; } \
175 }
176 
177 #endif