[PPL-devel] [GIT] ppl/ppl(floating_point): Made the refine_fp_interval_abstract_store methods inline.
Fabio Bossi
bossi at cs.unipr.it
Wed Sep 23 17:02:32 CEST 2009
Module: ppl/ppl
Branch: floating_point
Commit: 8128edd2954e9c4f63f9fea8bce387a2310c1183
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=8128edd2954e9c4f63f9fea8bce387a2310c1183
Author: Fabio Bossi <bossi at cs.unipr.it>
Date: Wed Sep 23 17:01:36 2009 +0200
Made the refine_fp_interval_abstract_store methods inline.
---
src/Octagonal_Shape.inlines.hh | 17 +++++++++++++++++
src/Octagonal_Shape.templates.hh | 21 ---------------------
src/Polyhedron.inlines.hh | 16 ++++++++++++++++
src/Polyhedron.templates.hh | 20 --------------------
4 files changed, 33 insertions(+), 41 deletions(-)
diff --git a/src/Octagonal_Shape.inlines.hh b/src/Octagonal_Shape.inlines.hh
index b76c327..cee791c 100644
--- a/src/Octagonal_Shape.inlines.hh
+++ b/src/Octagonal_Shape.inlines.hh
@@ -612,6 +612,23 @@ Octagonal_Shape<T>::strictly_contains(const Octagonal_Shape& y) const {
return x.contains(y) && !y.contains(x);
}
+template <typename T>
+template <typename Interval_Info>
+inline void
+Octagonal_Shape<T>::
+refine_fp_interval_abstract_store(
+ Box< Interval<T, Interval_Info> >& store) const {
+
+ // Check that T is a floating point type.
+ PPL_COMPILE_TIME_CHECK(!std::numeric_limits<T>::is_exact,
+ "Octagonal_Shape<T>::refine_fp_interval_abstract_store:"
+ " T not a floating point type.");
+
+ typedef Interval<T, Interval_Info> FP_Interval_Type;
+ store.intersection_assign(Box<FP_Interval_Type>(*this));
+
+}
+
/*! \relates Octagonal_Shape */
template <typename Temp, typename To, typename T>
inline bool
diff --git a/src/Octagonal_Shape.templates.hh b/src/Octagonal_Shape.templates.hh
index 628e791..92f93f6 100644
--- a/src/Octagonal_Shape.templates.hh
+++ b/src/Octagonal_Shape.templates.hh
@@ -30,7 +30,6 @@ site: http://www.cs.unipr.it/ppl/ . */
#include "Interval.defs.hh"
#include "Linear_Form.defs.hh"
#include "meta_programming.hh"
-#include "Box.defs.hh"
#include "assert.hh"
#include <vector>
#include <deque>
@@ -856,7 +855,6 @@ Octagonal_Shape<T>::refine_with_linear_form_inequality(
}
PPL_ASSERT(OK());
-
}
template <typename T>
@@ -5303,7 +5301,6 @@ Octagonal_Shape<T>::affine_image(const Variable var,
assign_r(matrix[n_var][n_var+1], minus_lf_ub, ROUND_NOT_NEEDED);
PPL_ASSERT(OK());
-
}
template <typename T>
@@ -5418,24 +5415,6 @@ interval_coefficient_upper_bound(const N& var_ub, const N& minus_var_ub,
assign_r(result, std::max(result, second_comparison_term), ROUND_NOT_NEEDED);
assign_r(result, std::max(result, third_comparison_term), ROUND_NOT_NEEDED);
assign_r(result, std::max(result, fourth_comparison_term), ROUND_NOT_NEEDED);
-
-}
-
-template <typename T>
-template <typename Interval_Info>
-void
-Octagonal_Shape<T>::
-refine_fp_interval_abstract_store(
- Box< Interval<T, Interval_Info> >& store) const {
-
- // Check that T is a floating point type.
- PPL_COMPILE_TIME_CHECK(!std::numeric_limits<T>::is_exact,
- "Octagonal_Shape<T>::refine_fp_interval_abstract_store:"
- " T not a floating point type.");
-
- typedef Interval<T, Interval_Info> FP_Interval_Type;
- store.intersection_assign(Box<FP_Interval_Type>(*this));
-
}
template <typename T>
diff --git a/src/Polyhedron.inlines.hh b/src/Polyhedron.inlines.hh
index d20eaf5..5de0af8 100644
--- a/src/Polyhedron.inlines.hh
+++ b/src/Polyhedron.inlines.hh
@@ -372,6 +372,22 @@ Polyhedron::add_recycled_congruences(Congruence_System& cgs) {
add_congruences(cgs);
}
+template <typename FP_Format, typename Interval_Info>
+inline void
+Polyhedron::
+refine_fp_interval_abstract_store(
+ Box< Interval<FP_Format, Interval_Info> >& store) const {
+
+ // Check that FP_Format is indeed a floating point type.
+ PPL_COMPILE_TIME_CHECK(!std::numeric_limits<FP_Format>::is_exact,
+ "Polyhedron::refine_fp_interval_abstract_store:"
+ " T not a floating point type.");
+
+ typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
+ store.intersection_assign(Box<FP_Interval_Type>(*this));
+
+}
+
/*! \relates Polyhedron */
inline bool
operator!=(const Polyhedron& x, const Polyhedron& y) {
diff --git a/src/Polyhedron.templates.hh b/src/Polyhedron.templates.hh
index ed58841..880d88b 100644
--- a/src/Polyhedron.templates.hh
+++ b/src/Polyhedron.templates.hh
@@ -339,7 +339,6 @@ Polyhedron::refine_with_linear_form_inequality(
// Finally, do the refinement.
refine_with_constraint(lf_approx_le <= 0);
-
}
template <typename FP_Format, typename Interval_Info>
@@ -383,7 +382,6 @@ const Box< Interval<FP_Format, Interval_Info> >& store) {
// Finally, do the assignment.
bounded_affine_image(var, lf_approx_le + lo_coeff, lf_approx_le + hi_coeff);
-
}
template <typename FP_Format, typename Interval_Info>
@@ -403,7 +401,6 @@ Polyhedron::overapproximate_linear_form(
typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
typedef Linear_Form<FP_Interval_Type> FP_Linear_Form;
- typedef Box<FP_Interval_Type> Interval_Abstract_Store;
result = FP_Linear_Form(lf.inhomogeneous_term());
// FIXME: this may not be policy-neutral.
@@ -429,7 +426,6 @@ Polyhedron::overapproximate_linear_form(
result += curr_addend_lf;
}
}
-
}
template <typename FP_Format, typename Interval_Info>
@@ -539,22 +535,6 @@ Polyhedron::convert_to_integer_expressions(
res_hi_coeff = Coefficient(0);
}
-template <typename FP_Format, typename Interval_Info>
-void
-Polyhedron::
-refine_fp_interval_abstract_store(
- Box< Interval<FP_Format, Interval_Info> >& store) const {
-
- // Check that FP_Format is indeed a floating point type.
- PPL_COMPILE_TIME_CHECK(!std::numeric_limits<FP_Format>::is_exact,
- "Polyhedron::refine_fp_interval_abstract_store:"
- " T not a floating point type.");
-
- typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
- store.intersection_assign(Box<FP_Interval_Type>(*this));
-
-}
-
template <typename C>
void
Polyhedron::throw_dimension_incompatible(const char* method,
More information about the PPL-devel
mailing list