1 #ifndef PhysicsTools_Utilities_Factorize_h
2 #define PhysicsTools_Utilities_Factorize_h
10 #include <type_traits>
16 static const bool value =
false;
22 TEMPL(T2) struct Divides : public Divides0<
A> {};
30 static const bool value =
true;
46 static const bool value =
true;
48 static const int p = []() {
61 TEMPL(N1T1) struct Divides<A,
POWER_S(A,
NUM(n))> : public ParametricDivN<1, n, A> {};
67 template <
int n,
bool positive = (n >= 0)>
73 struct abs<n, false> {
81 static const bool value = (gcd != 1);
88 static const bool value =
true;
99 typedef Divides<A, B>
Div;
107 typedef Divides<A, B>
Div;
115 typedef Divides<A, PROD_S(B, C)>
Div;
124 typedef Divides<arg, void>
D0;
125 typedef Divides<arg, B>
D1;
126 typedef Divides<arg, C>
D2;
135 typedef Divides<arg, void>
D0;
136 typedef Divides<A, C>
D1;
137 typedef Divides<B, C>
D2;
147 typedef Divides<arg, void>
D0;
148 typedef Divides<arg, C>
D1;
149 typedef Divides<arg, D>
D2;
176 inline static type
combine(
const A& _1,
const B& _2) {
178 return f * ((_1 /
f) + (_2 / f));
const Numerical< n > & num()
typedef POWER(A, NUM(n)) arg
std::conditional< D1::value, D1, typename std::conditional< D2::value, D2, D0 >::type >::type Div
static type combine(const A &_1, const B &_2)
DecomposeProduct< arg, typename Div::arg > D
TEMPL(T1) struct Divides0
typedef PROD(F, SUM(RATIO(A, F), RATIO(B, F))) type
COMBINE(A, B, type(_1, _2))
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)