mirror of https://github.com/CGAL/cgal
Min and Max only construct a new node in the DAG, if the intervals overlap
This commit is contained in:
parent
8fbfa4bae1
commit
dee65b63f5
|
|
@ -1226,8 +1226,15 @@ struct Min <Lazy_exact_nt<ET> >
|
|||
|
||||
Lazy_exact_nt<ET> operator()( const Lazy_exact_nt<ET>& x, const Lazy_exact_nt<ET>& y) const
|
||||
{
|
||||
CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||
return new Lazy_exact_Min<ET>(x, y);
|
||||
if (x.identical(y)){
|
||||
return x;
|
||||
}
|
||||
Uncertain<bool> res = x.approx() < y.approx();
|
||||
if(is_certain(res)){
|
||||
return res.make_certain() ? x : y; ;
|
||||
}
|
||||
CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||
return new Lazy_exact_Min<ET>(x, y);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1237,6 +1244,13 @@ struct Max <Lazy_exact_nt<ET> >
|
|||
|
||||
Lazy_exact_nt<ET> operator()( const Lazy_exact_nt<ET>& x, const Lazy_exact_nt<ET>& y) const
|
||||
{
|
||||
if (x.identical(y)){
|
||||
return x;
|
||||
}
|
||||
Uncertain<bool> res = x.approx() > y.approx();
|
||||
if(is_certain(res)){
|
||||
return res.make_certain() ? x : y;
|
||||
}
|
||||
CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||
return new Lazy_exact_Max<ET>(x, y);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue