[PPL-devel] [GIT] ppl/ppl(floating_point): Written a preliminary, non working first part of our variant of

Fabio Bossi bossi at cs.unipr.it
Thu Sep 10 18:02:56 CEST 2009


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

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Thu Sep 10 18:04:36 2009 +0200

Written a preliminary, non working first part of our variant of
affine_image.

---

 src/Octagonal_Shape.templates.hh |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/src/Octagonal_Shape.templates.hh b/src/Octagonal_Shape.templates.hh
index 69cf0eb..645bd04 100644
--- a/src/Octagonal_Shape.templates.hh
+++ b/src/Octagonal_Shape.templates.hh
@@ -4715,6 +4715,42 @@ Octagonal_Shape<T>::affine_image(Variable var,
         w_id = i;
     }
 
+  typedef typename OR_Matrix<N>::row_iterator Row_Iterator;
+  typedef typename OR_Matrix<N>::row_reference_type Row_Reference;
+  typedef typename OR_Matrix<N>::const_row_iterator Row_iterator;
+  typedef typename OR_Matrix<N>::const_row_reference_type Row_reference;
+  typedef Interval<T, Interval_Info> FP_Interval_Type;
+
+  const dimension_type n_var = 2*var_id;
+  const FP_Interval_Type& b = lf.inhomogeneous_term();
+
+  // `w' is the variable with index `w_id'.
+  // Now we know the form of `lf':
+  // - If t == 0, then lf == [lb;ub];
+  // - If t == 1, then lf == a*w + [lb;ub], where `w' can be `v' or another
+  //   variable;
+  // - If t == 2, the `lf' is of the general form.
+
+  if (t == 0) {
+    // Case 1: lf = [lb;ub];
+    forget_all_octagonal_constraints(var_id);
+    FP_Interval_Type two_b(b);
+    two_b *= 2;
+    // Add the constraint `var >= lb && var <= ub'.
+    add_octagonal_constraint(n_var+1, n_var, two_b.upper());
+    add_octagonal_constraint(n_var, n_var+1, -two_b.lower());
+    PPL_ASSERT(OK());
+    return;
+  }
+
+  T lb = b.lower();
+  T ub = b.upper();
+  bool is_b_zero = (lb == 0 && ub == 0);
+
+  if (t == 1) {
+
+  }
+
   // FIXME: complete the implementation.
 
 }




More information about the PPL-devel mailing list