10 #ifndef ApproxMVBB_GreatestCommonDivisor_hpp 11 #define ApproxMVBB_GreatestCommonDivisor_hpp 13 namespace MathFunctions {
16 template<
bool argsPositive =
false,
18 typename std::enable_if<std::is_integral<T>::value,T >::type
26 if( a == 0 || a == b ) {
33 return gcd2<true,T>( a % b, b );
35 return gcd2<true,T>( a, b % a );
40 template<
bool argsPositive =
false,
42 typename std::enable_if<std::is_integral<T>::value,T>::type
52 return gcd2<true,T>( b, c );
54 return gcd2<true,T>( a, c );
56 return gcd2<true,T>( a, b );
58 return gcd2<true,T>( a, gcd2<true,T>( b, c ) );
std::enable_if< std::is_integral< T >::value, T >::type gcd3(T a, T b, T c)
These are some container definitions.
std::enable_if< std::is_integral< T >::value, T >::type gcd2(T a, T b)