[PPL-devel] [GIT] ppl/ppl(master): Fixed a bug in Box<ITV>::upper_bound_assign( _if_exact).

Enea Zaffanella zaffanella at cs.unipr.it
Tue Feb 14 12:00:35 CET 2012


Module: ppl/ppl
Branch: master
Commit: 50bf9eb645f7db8db9157788112b41d88cf18f08
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=50bf9eb645f7db8db9157788112b41d88cf18f08

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Tue Feb 14 11:53:23 2012 +0100

Fixed a bug in Box<ITV>::upper_bound_assign(_if_exact).
Calling the method with an empty argument that, due to computational laziness,
is not yet flagged as being empty was producing wrong results.
(Note: here `wrong' means unnecessarily imprecise; from the point of view
of approximation, the results were still correct).
See test08 in tests/Box/upperbound1.cc.

---

 src/Box.templates.hh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Box.templates.hh b/src/Box.templates.hh
index 341c111..13e51f5 100644
--- a/src/Box.templates.hh
+++ b/src/Box.templates.hh
@@ -1205,9 +1205,9 @@ Box<ITV>::upper_bound_assign_if_exact(const Box& y) {
     x.throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y);
 
   // The lub of a box with an empty box is equal to the first box.
-  if (y.marked_empty())
+  if (y.is_empty())
     return true;
-  if (x.marked_empty()) {
+  if (x.is_empty()) {
     x = y;
     return true;
   }
@@ -1753,9 +1753,9 @@ Box<ITV>::upper_bound_assign(const Box& y) {
     x.throw_dimension_incompatible("upper_bound_assign(y)", y);
 
   // The lub of a box with an empty box is equal to the first box.
-  if (y.marked_empty())
+  if (y.is_empty())
     return;
-  if (x.marked_empty()) {
+  if (x.is_empty()) {
     x = y;
     return;
   }




More information about the PPL-devel mailing list