mirror of https://github.com/CGAL/cgal
user overload instead of specialization of simplify_quotient
This commit is contained in:
parent
ca17b38bf0
commit
a037ca12d9
|
|
@ -33,6 +33,9 @@
|
||||||
#include <CGAL/Kernel/mpl.h>
|
#include <CGAL/Kernel/mpl.h>
|
||||||
|
|
||||||
#include <boost/operators.hpp>
|
#include <boost/operators.hpp>
|
||||||
|
#ifdef CGAL_USE_BOOST_MP
|
||||||
|
#include <boost/multiprecision/cpp_int.hpp>
|
||||||
|
#endif // CGAL_USE_BOOST_MP
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
@ -46,6 +49,15 @@ template < typename NT >
|
||||||
inline void
|
inline void
|
||||||
simplify_quotient(NT &, NT &) {}
|
simplify_quotient(NT &, NT &) {}
|
||||||
|
|
||||||
|
#ifdef CGAL_USE_BOOST_MP
|
||||||
|
inline void
|
||||||
|
simplify_quotient(boost::multiprecision::cpp_int & a, boost::multiprecision::cpp_int & b) {
|
||||||
|
const boost::multiprecision::cpp_int r = boost::multiprecision::gcd(a, b);
|
||||||
|
a /= r;
|
||||||
|
b /= r;
|
||||||
|
}
|
||||||
|
#endif // CGAL_USE_BOOST_MP
|
||||||
|
|
||||||
// This one should be replaced by some functor or tag.
|
// This one should be replaced by some functor or tag.
|
||||||
// Meanwhile, the class is specialized for Gmpz, mpz_class, leda_integer.
|
// Meanwhile, the class is specialized for Gmpz, mpz_class, leda_integer.
|
||||||
template < typename NT >
|
template < typename NT >
|
||||||
|
|
|
||||||
|
|
@ -794,14 +794,6 @@ namespace internal {
|
||||||
|
|
||||||
#ifdef CGAL_USE_BOOST_MP
|
#ifdef CGAL_USE_BOOST_MP
|
||||||
|
|
||||||
template < >
|
|
||||||
inline void
|
|
||||||
simplify_quotient(boost::multiprecision::cpp_int & a, boost::multiprecision::cpp_int & b) {
|
|
||||||
const boost::multiprecision::cpp_int r = boost::multiprecision::gcd(a, b);
|
|
||||||
a /= r;
|
|
||||||
b /= r;
|
|
||||||
}
|
|
||||||
|
|
||||||
template< > class Real_embeddable_traits< Quotient<boost::multiprecision::cpp_int> >
|
template< > class Real_embeddable_traits< Quotient<boost::multiprecision::cpp_int> >
|
||||||
: public INTERN_QUOTIENT::Real_embeddable_traits_quotient_base< Quotient<boost::multiprecision::cpp_int> > {
|
: public INTERN_QUOTIENT::Real_embeddable_traits_quotient_base< Quotient<boost::multiprecision::cpp_int> > {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue