[PPL-devel] [GIT] ppl/ppl(floating_point): Fixed many errors.

Fabio Bossi bossi at cs.unipr.it
Thu Sep 3 16:35:06 CEST 2009


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

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Thu Sep  3 16:37:23 2009 +0200

Fixed many errors.

---

 ...Difference_Floating_Point_Expression.inlines.hh |    4 ++--
 ...fference_Floating_Point_Expression.templates.hh |    6 ++----
 ...Division_Floating_Point_Expression.templates.hh |    8 +++-----
 src/Floating_Point_Expression.templates.hh         |    1 -
 ...iplication_Floating_Point_Expression.inlines.hh |    4 ++--
 ...lication_Floating_Point_Expression.templates.hh |    8 +++-----
 src/Sum_Floating_Point_Expression.inlines.hh       |    4 ++--
 src/Sum_Floating_Point_Expression.templates.hh     |    6 ++----
 8 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/src/Difference_Floating_Point_Expression.inlines.hh b/src/Difference_Floating_Point_Expression.inlines.hh
index 596b21e..898c005 100644
--- a/src/Difference_Floating_Point_Expression.inlines.hh
+++ b/src/Difference_Floating_Point_Expression.inlines.hh
@@ -35,8 +35,8 @@ Difference_Floating_Point_Expression<FP_Interval_Type, FP_Format>
          Floating_Point_Expression<FP_Interval_Type, FP_Format>* const x,
          Floating_Point_Expression<FP_Interval_Type, FP_Format>* const y)
   : first_operand(x), second_operand(y){
-  assert(num != NULL);
-  assert(den != NULL);
+  assert(x != NULL);
+  assert(y != NULL);
 }
 
 template <typename FP_Interval_Type, typename FP_Format>
diff --git a/src/Difference_Floating_Point_Expression.templates.hh b/src/Difference_Floating_Point_Expression.templates.hh
index 3508767..6892ee7 100644
--- a/src/Difference_Floating_Point_Expression.templates.hh
+++ b/src/Difference_Floating_Point_Expression.templates.hh
@@ -24,8 +24,6 @@ site: http://www.cs.unipr.it/ppl/ . */
 #ifndef PPL_Difference_Floating_Point_Expression_templates_hh
 #define PPL_Difference_Floating_Point_Expression_templates_hh 1
 
-#include "Difference_Floating_Point_Expression.defs.hh"
-
 namespace Parma_Polyhedra_Library {
 
 template <typename FP_Interval_Type, typename FP_Format>
@@ -35,9 +33,9 @@ typename Difference_Floating_Point_Expression<FP_Interval_Type, FP_Format>
 ::linearize(const FP_Interval_Abstract_Store& store) const {
   FP_Linear_Form linearized_first_operand = first_operand->linearize(store);
   FP_Linear_Form linearized_second_operand = second_operand->linearize(store);
-  FP_Interval_Type abs_error = FP_Interval_Type(-absolute_error);
+  FP_Interval_Type abs_error = FP_Interval_Type(-this->absolute_error);
   // FIXME: this may be incorrect for some policies.
-  abs_error.join_assign(absolute_error);
+  abs_error.join_assign(this->absolute_error);
   FP_Linear_Form result = linearized_first_operand - linearized_second_operand +
                           relative_error(linearized_first_operand) +
                           relative_error(linearized_second_operand) +
diff --git a/src/Division_Floating_Point_Expression.templates.hh b/src/Division_Floating_Point_Expression.templates.hh
index 08eb2c9..8d35a79 100644
--- a/src/Division_Floating_Point_Expression.templates.hh
+++ b/src/Division_Floating_Point_Expression.templates.hh
@@ -24,8 +24,6 @@ site: http://www.cs.unipr.it/ppl/ . */
 #ifndef PPL_Division_Floating_Point_Expression_templates_hh
 #define PPL_Division_Floating_Point_Expression_templates_hh 1
 
-#include "Division_Floating_Point_Expression.defs.hh"
-
 namespace Parma_Polyhedra_Library {
 
 template <typename FP_Interval_Type, typename FP_Format>
@@ -42,12 +40,12 @@ typename Division_Floating_Point_Expression<FP_Interval_Type, FP_Format>
     throw Linearization_Failed();
 
   FP_Linear_Form linearized_first_operand = first_operand->linearize(store);
-  FP_Interval_Type abs_error = FP_Interval_Type(-absolute_error);
+  FP_Interval_Type abs_error = FP_Interval_Type(-this->absolute_error);
   // FIXME: this may be incorrect for some policies.
-  abs_error.join_assign(absolute_error);
+  abs_error.join_assign(this->absolute_error);
   FP_Linear_Form result = linearized_first_operand / intervalized_second_operand
     + relative_error(linearized_first_operand) / intervalized_second_operand
-    + abs_eror;
+    + abs_error;
 
   return result;
 }
diff --git a/src/Floating_Point_Expression.templates.hh b/src/Floating_Point_Expression.templates.hh
index 8972849..6f23294 100644
--- a/src/Floating_Point_Expression.templates.hh
+++ b/src/Floating_Point_Expression.templates.hh
@@ -24,7 +24,6 @@ site: http://www.cs.unipr.it/ppl/ . */
 #ifndef PPL_Floating_Point_Expression_templates_hh
 #define PPL_Floating_Point_Expression_templates_hh 1
 
-#include "Floating_Point_Expression.defs.hh"
 #include <cmath>
 
 namespace Parma_Polyhedra_Library {
diff --git a/src/Multiplication_Floating_Point_Expression.inlines.hh b/src/Multiplication_Floating_Point_Expression.inlines.hh
index f0206bd..d3c35ce 100644
--- a/src/Multiplication_Floating_Point_Expression.inlines.hh
+++ b/src/Multiplication_Floating_Point_Expression.inlines.hh
@@ -35,8 +35,8 @@ Multiplication_Floating_Point_Expression<FP_Interval_Type, FP_Format>
          Floating_Point_Expression<FP_Interval_Type, FP_Format>* const x,
          Floating_Point_Expression<FP_Interval_Type, FP_Format>* const y)
   : first_operand(x), second_operand(y) {
-  assert(num != NULL);
-  assert(den != NULL);
+  assert(x != NULL);
+  assert(y != NULL);
 }
 
 template <typename FP_Interval_Type, typename FP_Format>
diff --git a/src/Multiplication_Floating_Point_Expression.templates.hh b/src/Multiplication_Floating_Point_Expression.templates.hh
index 317ede2..ca522e5 100644
--- a/src/Multiplication_Floating_Point_Expression.templates.hh
+++ b/src/Multiplication_Floating_Point_Expression.templates.hh
@@ -24,8 +24,6 @@ site: http://www.cs.unipr.it/ppl/ . */
 #ifndef PPL_Multiplication_Floating_Point_Expression_templates_hh
 #define PPL_Multiplication_Floating_Point_Expression_templates_hh 1
 
-#include "Multiplication_Floating_Point_Expression.defs.hh"
-
 namespace Parma_Polyhedra_Library {
 
 template <typename FP_Interval_Type, typename FP_Format>
@@ -47,7 +45,7 @@ typename Multiplication_Floating_Point_Expression<FP_Interval_Type, FP_Format>
   FP_Linear_Form linearized_first_operand = first_operand->linearize(store);
   FP_Interval_Type intervalized_first_operand = intervalize(
 				                linearized_first_operand);
-  FP_Linear_Form linearized_second_operant = second_operand->linearize(store);
+  FP_Linear_Form linearized_second_operand = second_operand->linearize(store);
   FP_Interval_Type intervalized_second_operand = intervalize(
                                                  linearized_second_operand);
   boundary_type first_interval_size, second_interval_size;
@@ -75,9 +73,9 @@ typename Multiplication_Floating_Point_Expression<FP_Interval_Type, FP_Format>
 
   // Here we do the actual computation.
   FP_Linear_Form result;
-  FP_Interval_Type abs_error = FP_Interval_Type(-absolute_error);
+  FP_Interval_Type abs_error = FP_Interval_Type(-this->absolute_error);
   // FIXME: this may be incorrect for some policies.
-  abs_error.join_assign(absolute_error);
+  abs_error.join_assign(this->absolute_error);
   if (intervalize_first) {
     result = intervalized_first_operand * linearized_second_operand +
       intervalized_first_operand * relative_error(linearized_second_operand) +
diff --git a/src/Sum_Floating_Point_Expression.inlines.hh b/src/Sum_Floating_Point_Expression.inlines.hh
index aa73ba9..39cfbd7 100644
--- a/src/Sum_Floating_Point_Expression.inlines.hh
+++ b/src/Sum_Floating_Point_Expression.inlines.hh
@@ -35,8 +35,8 @@ Sum_Floating_Point_Expression<FP_Interval_Type, FP_Format>
          Floating_Point_Expression<FP_Interval_Type, FP_Format>* const x,
          Floating_Point_Expression<FP_Interval_Type, FP_Format>* const y)
   : first_operand(x), second_operand(y) {
-  assert(num != NULL);
-  assert(den != NULL);
+  assert(x != NULL);
+  assert(y != NULL);
 }
 
 template <typename FP_Interval_Type, typename FP_Format>
diff --git a/src/Sum_Floating_Point_Expression.templates.hh b/src/Sum_Floating_Point_Expression.templates.hh
index afc30d3..dfc43c0 100644
--- a/src/Sum_Floating_Point_Expression.templates.hh
+++ b/src/Sum_Floating_Point_Expression.templates.hh
@@ -24,8 +24,6 @@ site: http://www.cs.unipr.it/ppl/ . */
 #ifndef PPL_Sum_Floating_Point_Expression_templates_hh
 #define PPL_Sum_Floating_Point_Expression_templates_hh 1
 
-#include "Sum_Floating_Point_Expression.defs.hh"
-
 namespace Parma_Polyhedra_Library {
 
 template <typename FP_Interval_Type, typename FP_Format>
@@ -34,9 +32,9 @@ typename Sum_Floating_Point_Expression<FP_Interval_Type, FP_Format>
 ::linearize(const FP_Interval_Abstract_Store& store) const {
   FP_Linear_Form linearized_first_operand = first_operand->linearize(store);
   FP_Linear_Form linearized_second_operand = second_operand->linearize(store);
-  FP_Interval_Type abs_error = FP_Interval_Type(-absolute_error);
+  FP_Interval_Type abs_error = FP_Interval_Type(-this->absolute_error);
   // FIXME: this may be incorrect for some policies.
-  abs_error.join_assign(absolute_error);
+  abs_error.join_assign(this->absolute_error);
   FP_Linear_Form result = linearized_first_operand + linearized_second_operand +
                           relative_error(linearized_first_operand) +
                           relative_error(linearized_second_operand) +




More information about the PPL-devel mailing list