From ee54db404be731fa4c6aa65adf7960d001a039f4 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Mon, 12 Jun 2000 15:46:27 +0000 Subject: [PATCH] - Bug fixes update. --- Packages/Interval_arithmetic/changes.txt | 2 +- .../include/CGAL/Lazy_exact_nt.h | 46 ++++--------------- .../test/Interval_arithmetic/Lazy_exact_nt.C | 2 - 3 files changed, 10 insertions(+), 40 deletions(-) diff --git a/Packages/Interval_arithmetic/changes.txt b/Packages/Interval_arithmetic/changes.txt index f9d4145caf5..04134a6ebd5 100644 --- a/Packages/Interval_arithmetic/changes.txt +++ b/Packages/Interval_arithmetic/changes.txt @@ -1,6 +1,6 @@ Changes done to the Interval Arithmetic package. -Version 4.46 on ?? June 2000 +Version 4.46 on 12 June 2000 - Debuggued Lazy_exact_nt<>. Version 4.45 on 11 June 2000 diff --git a/Packages/Interval_arithmetic/include/CGAL/Lazy_exact_nt.h b/Packages/Interval_arithmetic/include/CGAL/Lazy_exact_nt.h index 792b726bdb3..0cf735ee703 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Lazy_exact_nt.h +++ b/Packages/Interval_arithmetic/include/CGAL/Lazy_exact_nt.h @@ -121,19 +121,17 @@ struct Lazy_exact_rep : public Ref_counted // - Invalid interval [1;0]. Drawback is it's slower to test, and conflicts // with assertions in the generic IA code. // - A enum value ? waste of space... - // - A particular value (1) for et. + // - A particular value for et: // et==NULL => interval, and a fortiori exact, are not computed // et==1 => exact is not computed, but interval is Lazy_exact_rep () : in(), et(NULL) {} - // : in(1,0), et(NULL) {} Lazy_exact_rep (const double d) : in(d), et((ET*)1) {} bool valid_approx() const { return et!=NULL; - // return et!=(ET *)1; // return is_valid(in); } @@ -244,9 +242,8 @@ CGAL_LAZY_UNARY_OP(CGAL_NTS square, Lazy_exact_Square) CGAL_LAZY_UNARY_OP(sqrt, Lazy_exact_Sqrt) #if 0 -// Template binary operator (might be merged with the above ?) +// Template binary operator (might be merged with the base ?) // Note : G++ 2.95 produces an ICE on this :( Will try again later... -// Second solution is a macro. template class Op> struct Lazy_exact_binary_op : public Lazy_exact_binary { @@ -338,7 +335,7 @@ struct Lazy_exact_nt : public Handle_for > typedef Lazy_exact_nt Self; typedef Lazy_exact_rep Self_rep; - Lazy_exact_nt () {} // Note : this allocates 1 element... + Lazy_exact_nt () {} // Note : this allocates 1 element Lazy_exact_nt (Self_rep *r) : PTR(r) {} @@ -346,19 +343,10 @@ struct Lazy_exact_nt : public Handle_for > Lazy_exact_nt (const Self & s) : PTR(s) {} -#if 0 // provided by Handle_for, normaly... - Self & operator= (const Self & s) - { - Self_rep::inc_count(s.ptr); - Self_rep::dec_count(ptr); - ptr = s.ptr; - return *this; - } -#endif - // Operations Lazy_exact_nt (const double d) : PTR (new Lazy_exact_Cst(d)) {} + Lazy_exact_nt (const int i) : PTR (new Lazy_exact_Cst(double(i))) {} @@ -503,38 +491,22 @@ Number_tag number_type_tag (const Lazy_exact_nt&) { return Number_tag(); } -// Temporary hack -inline -int -convert_from_to (const int&, const Lazy_exact_nt &) -{ - return int(); -} - #if !defined(CGAL_CFG_NO_EXPLICIT_TEMPLATE_FUNCTION_ARGUMENT_SPECIFICATION) \ && !defined(CGAL_CFG_NO_PARTIAL_CLASS_TEMPLATE_SPECIALISATION) -struct converter > +template +struct converter > { - static inline int do_it (const Lazy_exact_nt & z) - { - return convert_from_to(int(), z); - } -}; - -struct converter > -{ - static inline leda_real do_it (const Lazy_exact_nt & z) + static inline ET do_it (const Lazy_exact_nt & z) { return z.exact(); } }; -#endif // CGAL_CFG_NO_EXPLICIT_TEMPLATE_FUNCTION_ARGUMENT_SPECIFICATION - +#endif CGAL_END_NAMESPACE #ifdef CGAL_INTERVAL_ARITHMETIC_H #include -#endif // CGAL_INTERVAL_ARITHMETIC_H +#endif #endif // CGAL_LAZY_EXACT_NT_H diff --git a/Packages/Interval_arithmetic/test/Interval_arithmetic/Lazy_exact_nt.C b/Packages/Interval_arithmetic/test/Interval_arithmetic/Lazy_exact_nt.C index a29df9c5f13..5c71ac0c8b2 100644 --- a/Packages/Interval_arithmetic/test/Interval_arithmetic/Lazy_exact_nt.C +++ b/Packages/Interval_arithmetic/test/Interval_arithmetic/Lazy_exact_nt.C @@ -1,7 +1,5 @@ // Test program for Lazy_exact_nt<>. -// #define CGAL_NO_ASSERTIONS - #include #include #include