diff --git a/Number_types/include/CGAL/Filtered_rational.h b/Number_types/include/CGAL/Filtered_rational.h index 50247efe9eff..c9fe935ca88c 100644 --- a/Number_types/include/CGAL/Filtered_rational.h +++ b/Number_types/include/CGAL/Filtered_rational.h @@ -1,14 +1,27 @@ #ifndef CGAL_FILTERED_RATIONAL_H +#define CGAL_FILTERED_RATIONAL_H #include #include +#include namespace CGAL { +struct Filtered_rational; + +template <> +class Algebraic_structure_traits + : public Algebraic_structure_traits_base +{ + public: + using Is_exact = Tag_true; + using Is_numerical_sensitive = Tag_false; +}; + struct Filtered_rational : boost::totally_ordered1 > //#endif > @@ -79,6 +92,14 @@ template <> class Real_embeddable_traits< Filtered_rational > return sign(x); } }; + + class To_double + : public CGAL::cpp98::unary_function< Type, double > { + public: + double operator()( const Type& x ) const { + return to_double(x.i); + } + }; }; @@ -156,12 +177,10 @@ bool operator<(const Filtered_rational& a, } } CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(Filtered_rational) -CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short ,Filtered_rational) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int ,Filtered_rational) -CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long ,Filtered_rational) -CGAL_DEFINE_COERCION_TRAITS_FROM_TO(float ,Filtered_rational) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(double ,Filtered_rational) + } // namespace CGAL #endif