[PPL-devel] [GIT] ppl/ppl(floating_point): Various corrections.
Fabio Bossi
bossi at cs.unipr.it
Mon Sep 21 11:34:46 CEST 2009
Module: ppl/ppl
Branch: floating_point
Commit: 4bdd87fc436454719f7d982942fe6615dc00b2e9
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=4bdd87fc436454719f7d982942fe6615dc00b2e9
Author: Fabio Bossi <bossi at cs.unipr.it>
Date: Mon Sep 21 11:08:33 2009 +0200
Various corrections.
---
src/Polyhedron.templates.hh | 28 +++++++++++++++++-----------
src/Polyhedron_nonpublic.cc | 2 +-
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/src/Polyhedron.templates.hh b/src/Polyhedron.templates.hh
index 8ac2f9d..469672a 100644
--- a/src/Polyhedron.templates.hh
+++ b/src/Polyhedron.templates.hh
@@ -332,14 +332,16 @@ const std::map< dimension_type, Interval<FP_Format, Interval_Info> >& store) {
Linear_Expression lf_approx_le;
PPL_DIRTY_TEMP_COEFFICIENT(lo_coeff);
PPL_DIRTY_TEMP_COEFFICIENT(hi_coeff);
- convert_to_integer_expressions(lf_approx, lf_space_dim, lo_coeff, hi_coeff);
+ convert_to_integer_expressions(lf_approx, lf_space_dim, lf_approx_le,
+ lo_coeff, hi_coeff);
// Finally, do the assignment.
PPL_DIRTY_TEMP_COEFFICIENT(one_coeff);
one_coeff = 1;
- generalized_affine_image(var, GREATER_OR_EQUAL, lf_approx + lo_coeff,
+ generalized_affine_image(var, GREATER_OR_EQUAL, lf_approx_le + lo_coeff,
+ one_coeff);
+ generalized_affine_image(var, LESS_OR_EQUAL, lf_approx_le + hi_coeff,
one_coeff);
- generalized_affine_image(var, LESS_OR_EQUAL, lf_approx + hi_coeff, one_coeff);
}
@@ -371,23 +373,26 @@ Polyhedron::overapproximate_linear_form(
FP_Format curr_lb = curr_coeff.lower();
FP_Format curr_ub = curr_coeff.upper();
if (curr_lb != 0 || curr_ub != 0) {
- PPL_ASSERT(store.find(i) != store.end());
+ typename Interval_Abstract_Store::const_iterator i_ite = store.find(i);
+ PPL_ASSERT(i_ite != store.end());
FP_Interval_Type curr_addend(curr_ub - curr_lb);
curr_addend *= aux_divisor2;
- curr_addend *= store[i];
+ curr_addend *= i_ite->second;
result += curr_addend;
curr_addend = FP_Interval_Type(curr_lb + curr_ub);
curr_addend *= aux_divisor1;
- curr_addend *= curr_var;
- result += curr_addend;
+ FP_Linear_Form curr_addend_lf(curr_var);
+ curr_addend_lf *= curr_addend;
+ result += curr_addend_lf;
}
}
}
template <typename FP_Format, typename Interval_Info>
-void convert_to_integer_expression(
- const Linear_Form<Interval <FP_Format, Interval_Info> >& lf,
+void
+Polyhedron::convert_to_integer_expression(
+ const Linear_Form<Interval <FP_Format, Interval_Info> >& lf,
const dimension_type lf_dimension,
Linear_Expression& result) {
result = Linear_Expression();
@@ -432,14 +437,15 @@ void convert_to_integer_expression(
}
template <typename FP_Format, typename Interval_Info>
-void convert_to_integer_expressions(
+void
+Polyhedron::convert_to_integer_expressions(
const Linear_Form<Interval <FP_Format, Interval_Info> >& lf,
const dimension_type lf_dimension, Linear_Expression& res,
Coefficient& res_low_coeff, Coefficient& res_hi_coeff) {
res = Linear_Expression();
typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
- typedef typename FP_Interval_Type::coefficient_type FP_Coeff_Type;
+ typedef typename FP_Interval_Type::boundary_type FP_Coeff_Type;
std::vector<Coefficient> numerators(lf_dimension+2);
std::vector<Coefficient> denominators(lf_dimension+2);
diff --git a/src/Polyhedron_nonpublic.cc b/src/Polyhedron_nonpublic.cc
index 9dce752..63ceb2a 100644
--- a/src/Polyhedron_nonpublic.cc
+++ b/src/Polyhedron_nonpublic.cc
@@ -25,7 +25,7 @@ site: http://www.cs.unipr.it/ppl/ . */
#include "Polyhedron.defs.hh"
#include "Scalar_Products.defs.hh"
-#include "Linear_Form.types.hh"
+#include "Linear_Form.defs.hh"
#include "assert.hh"
#include <string>
#include <iostream>
More information about the PPL-devel
mailing list