diff --git a/Number_types/include/CGAL/CORE_BigInt.h b/Number_types/include/CGAL/CORE_BigInt.h index 0e057bcc856..7f1041ea7fa 100644 --- a/Number_types/include/CGAL/CORE_BigInt.h +++ b/Number_types/include/CGAL/CORE_BigInt.h @@ -170,6 +170,25 @@ struct Needs_parens_as_product{ } }; +// Benchmark_rep specialization +template<> +class Benchmark_rep< CORE::BigInt > { + const CORE::BigInt& t; +public: + //! initialize with a const reference to \a t. + Benchmark_rep( const CORE::BigInt& tt) : t(tt) {} + //! perform the output, calls \c operator\<\< by default. + std::ostream& operator()( std::ostream& out) const { + out << t; + return out; + } + + static std::string get_benchmark_name() { + return "Integer"; + } +}; + + CGAL_END_NAMESPACE //since types are included by CORE_coercion_traits.h: diff --git a/Number_types/include/CGAL/CORE_BigRat.h b/Number_types/include/CGAL/CORE_BigRat.h index d1a9872ab8a..b9aa7b420c6 100644 --- a/Number_types/include/CGAL/CORE_BigRat.h +++ b/Number_types/include/CGAL/CORE_BigRat.h @@ -231,6 +231,24 @@ public: } }; +// Benchmark_rep specialization +template<> +class Benchmark_rep< CORE::BigRat > { + const CORE::BigRat& t; +public: + //! initialize with a const reference to \a t. + Benchmark_rep( const CORE::BigRat& tt) : t(tt) {} + //! perform the output, calls \c operator\<\< by default. + std::ostream& operator()( std::ostream& out) const { + out << "Rational(" << numerator(t) << "," << denominator(t) << ")"; + return out; + } + + static std::string get_benchmark_name() { + return "Rational"; + } +}; + CGAL_END_NAMESPACE //since types are included by CORE_coercion_traits.h: diff --git a/Number_types/include/CGAL/leda_rational.h b/Number_types/include/CGAL/leda_rational.h index 097482a0ff9..1ccc5120ad9 100644 --- a/Number_types/include/CGAL/leda_rational.h +++ b/Number_types/include/CGAL/leda_rational.h @@ -276,6 +276,26 @@ public: } }; +template < > +class Benchmark_rep< leda_rational > { + const leda_rational& t; +public: + //! initialize with a const reference to \a t. + Benchmark_rep( const leda_rational& tt) : t(tt) {} + //! perform the output, calls \c operator\<\< by default. + std::ostream& operator()( std::ostream& out) const { + return + out << "Rational(" << t.numerator() << "," + << t.denominator() << ")"; + } + + static std::string get_benchmark_name() { + return "Rational"; + } + +}; + + CGAL_END_NAMESPACE // Unary + is missing for leda::rational