[PPL-devel] [GIT] ppl/ppl(floating_point): Do not ignore undefined variables while intervalizing: assert that they

Fabio Bossi bossi at cs.unipr.it
Mon Sep 7 14:57:42 CEST 2009


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

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Mon Sep  7 15:00:37 2009 +0200

Do not ignore undefined variables while intervalizing: assert that they
are defined instead.

---

 src/Floating_Point_Expression.templates.hh |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/Floating_Point_Expression.templates.hh b/src/Floating_Point_Expression.templates.hh
index 03654fb..52b71c7 100644
--- a/src/Floating_Point_Expression.templates.hh
+++ b/src/Floating_Point_Expression.templates.hh
@@ -73,11 +73,10 @@ Floating_Point_Expression<FP_Interval_Type, FP_Format>
   for (dimension_type i = 0; i < dimension; ++i) {
     typename FP_Interval_Abstract_Store::const_iterator
              next_variable_value = store.find(i);
-    if (next_variable_value != store.end()) {
-      FP_Interval_Type current_addend = lf.coefficient(Variable(i));
-      current_addend *= next_variable_value->second;
-      result += current_addend;
-    }
+    assert(next_variable_value != store.end());
+    FP_Interval_Type current_addend = lf.coefficient(Variable(i));
+    current_addend *= next_variable_value->second;
+    result += current_addend;
   }
 
   return;




More information about the PPL-devel mailing list