1 #ifndef PhysicsTools_Utilities_SimplifySum_h
2 #define PhysicsTools_Utilities_SimplifySum_h
10 #include <boost/type_traits.hpp>
11 #include <boost/mpl/if.hpp>
79 struct ParametricSimplifiedSum<1, 1, A, false> {
86 public ParametricSimplifiedSum<n, m, A> { };
90 public ParametricSimplifiedSum<1, n, A> { };
94 public ParametricSimplifiedSum<n, 1, A> { };
98 public ParametricSimplifiedSum<1, 1, A> { };
102 public ParametricSimplifiedSum<1, 1,
MINUS_S(A) > { };
107 public ParametricSimplifiedSum< 1, 1,
MINUS_S(
PROD_S(A, B)) > { };
111 public ParametricSimplifiedSum< 1, 1,
NUM(n) > { };
115 public ParametricSimplifiedSum< 1, 1,
PROD_S(A, B) > { };
120 public ParametricSimplifiedSum< 1, 1,
PROD_S(
NUM(n), A) > { };
123 template <
typename Prod,
bool simplify = Prod::value>
129 template<
typename Prod>
135 template<
typename F,
typename G,
typename H>
138 typedef F A;
typedef G
B;
typedef H
C;
141 inline static const B&
b(
const F&
f,
const G&
g,
const H&
h) {
return g; }
142 inline static const C&
c(
const F&
f,
const G&
g,
const H&
h) {
return h; }
146 typedef F A;
typedef H
B;
typedef G
C;
148 typedef
SUM(A,
B) AB;
150 inline static const B&
b(
const F&
f,
const G&
g,
const H&
h) {
return h; }
151 inline static const C&
c(
const F&
f,
const G&
g,
const H&
h) {
return g; }
152 enum {
value = ::boost::type_traits::ice_not<
156 typedef G
A;
typedef H
B;
typedef F C;
158 typedef
SUM(A,
B) AB;
160 inline static const B&
b(
const F&
f,
const G&
g,
const H&
h) {
return h; }
161 inline static const C&
c(
const F&
f,
const G&
g,
const H&
h) {
return f; }
162 enum {
value = ::boost::type_traits::ice_not<
167 ::boost::mpl::if_ <prod1,
169 typename ::boost::mpl::if_ <prod2,
::boost::mpl::if_< prod1, prod1, typename::boost::mpl::if_< prod2, prod2, prod0 >::type >::type prod
AuxSum< prod >::type type
COMBINE(arg1, arg2, type(_1, _2))
static const B & b(const F &f, const G &g, const H &h)
static const B & b(const F &f, const G &g, const H &h)
static const C & c(const F &f, const G &g, const H &h)
COMBINE(A, NUM(n), num< 1 >()/pow(_1, num<-n >()))
static const A & a(const F &f, const G &g, const H &h)
static const A & a(const F &f, const G &g, const H &h)
static const C & c(const F &f, const G &g, const H &h)
typedef SUM(SUM(PROD(NUM(n-p), SIN2(A)), PROD(NUM(m-p), COS2(A))), NUM(p)) type
SUM_RULE(TYPT3, A, SUM_S(B, C), SUM(SUM(A, B), C),(_1+_2._1)+_2._2)
static const A & a(const F &f, const G &g, const H &h)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
static type combine(const SUM_S(F, G)&fg, const H &h)
typedef PROD(NUM(n), A) arg1
COMBINE(typename Prod::AB, typename Prod::C, _1+_2)
static type combine(const A &_1, const B &_2)
static const B & b(const F &f, const G &g, const H &h)
static const C & c(const F &f, const G &g, const H &h)
DecomposeProduct< PROD(NUM(n), A), A > Dec
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
DIFF_RULE(TYPT2, A, MINUS_S(B), SUM(A, B), _1+_2._)
typedef PROD(F, SUM(RATIO(A, F), RATIO(B, F))) type
typedef SUM(typename Prod::AB, typename Prod::C) type
typedef SUM_S(arg1, arg2) type
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
DecomposeProduct< arg, typename Div::arg > D
T get(const Candidate &c)