- Add missing operators in Lazy_exact_nt.

This commit is contained in:
Sylvain Pion 2001-08-01 08:42:15 +00:00
parent 3025798778
commit f99d00b180
2 changed files with 27 additions and 1 deletions

View File

@ -1,5 +1,8 @@
Changes done to the Interval Arithmetic package.
Version 4.114 on 1 August 2001
- Add missing operators in Lazy_exact_nt.
Version 4.113 on 25 July 2001
- Use Filtered_kernel instead of Filtered_exact in test/Kernel_checker.C .

View File

@ -180,6 +180,7 @@ struct NAME : public Lazy_exact_unary<ET> \
void update_exact() { et = new ET(OP(op1.exact())); } \
};
CGAL_LAZY_UNARY_OP(CGAL::opposite, Lazy_exact_Opp)
CGAL_LAZY_UNARY_OP(CGAL_NTS abs, Lazy_exact_Abs)
CGAL_LAZY_UNARY_OP(CGAL_NTS square, Lazy_exact_Square)
CGAL_LAZY_UNARY_OP(CGAL::sqrt, Lazy_exact_Sqrt)
@ -247,6 +248,9 @@ public :
Lazy_exact_nt (const ET & e)
{ PTR = new Lazy_exact_Ex_Cst<ET>(e); }
Self operator- () const
{ return new Lazy_exact_Opp<ET>(*this); }
Self operator+ (const Self & a) const
{ return new Lazy_exact_Add<ET>(*this, a); }
@ -268,7 +272,6 @@ public :
ET exact() const
{ return ptr()->exact(); }
// The other comparison operators are currently provided by the STL.
bool operator< (const Self & a) const
{
try
@ -282,6 +285,21 @@ public :
}
}
bool operator> (const Self & a) const
{
return a<*this;
}
bool operator>= (const Self & a) const
{
return !(*this<a);
}
bool operator<= (const Self & a) const
{
return !(a<*this);
}
bool operator== (const Self & a) const
{
try
@ -295,6 +313,11 @@ public :
}
}
bool operator!= (const Self & a) const
{
return ! (*this == a);
}
private:
Self_rep * ptr() const { return (Self_rep*) PTR; }
};