[PPL-devel] [GIT] ppl/ppl(master): Moved two methods in the right place.

Abramo Bagnara abramo.bagnara at gmail.com
Fri Jul 30 16:35:09 CEST 2010


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

Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date:   Fri Jul 30 16:35:04 2010 +0200

Moved two methods in the right place.

---

 src/Interval.defs.hh      |   46 +--------------------------------------
 src/Interval.templates.hh |   52 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 44 deletions(-)

diff --git a/src/Interval.defs.hh b/src/Interval.defs.hh
index ac6ce24..e751eb7 100644
--- a/src/Interval.defs.hh
+++ b/src/Interval.defs.hh
@@ -296,28 +296,7 @@ public:
 
   template <typename C>
   typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
-  lower_extend(const C& c) {
-    PPL_ASSERT(OK());
-    bool open;
-    switch (c.rel()) {
-    case V_LGE:
-      return lower_extend();
-    case V_NAN:
-      return I_NOT_EMPTY | I_EXACT | I_UNCHANGED;
-    case V_GT:
-      open = true;
-      break;
-    case V_GE:
-    case V_EQ:
-      open = false;
-      break;
-    default:
-      PPL_ASSERT(false);
-    }
-    min_assign(LOWER, lower(), info(), LOWER, c.value(), f_info(c.value(), open));
-    PPL_ASSERT(OK());
-    return I_ANY;
-  }
+  lower_extend(const C& c);
 
   I_Result upper_extend() {
     info().clear_boundary_properties(UPPER);
@@ -327,28 +306,7 @@ public:
 
   template <typename C>
   typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
-  upper_extend(const C& c) {
-    PPL_ASSERT(OK());
-    bool open;
-    switch (c.rel()) {
-    case V_LGE:
-      return lower_extend();
-    case V_NAN:
-      return I_NOT_EMPTY | I_EXACT | I_UNCHANGED;
-    case V_LT:
-      open = true;
-      break;
-    case V_LE:
-    case V_EQ:
-      open = false;
-      break;
-    default:
-      PPL_ASSERT(false);
-    }
-    max_assign(UPPER, upper(), info(), UPPER, c.value(), f_info(c.value(), open));
-    PPL_ASSERT(OK());
-    return I_ANY;
-  }
+  upper_extend(const C& c);
 
   I_Result build() {
     return assign(UNIVERSE);
diff --git a/src/Interval.templates.hh b/src/Interval.templates.hh
index 0c17b64..456458e 100644
--- a/src/Interval.templates.hh
+++ b/src/Interval.templates.hh
@@ -28,6 +28,58 @@ site: http://www.cs.unipr.it/ppl/ . */
 namespace Parma_Polyhedra_Library {
 
 template <typename Boundary, typename Info>
+template <typename C>
+typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
+Interval<Boundary, Info>::lower_extend(const C& c) {
+  PPL_ASSERT(OK());
+  bool open;
+  switch (c.rel()) {
+  case V_LGE:
+    return lower_extend();
+  case V_NAN:
+    return I_NOT_EMPTY | I_EXACT | I_UNCHANGED;
+  case V_GT:
+    open = true;
+    break;
+  case V_GE:
+  case V_EQ:
+    open = false;
+    break;
+  default:
+    PPL_ASSERT(false);
+  }
+  min_assign(LOWER, lower(), info(), LOWER, c.value(), f_info(c.value(), open));
+  PPL_ASSERT(OK());
+  return I_ANY;
+}
+
+template <typename Boundary, typename Info>
+template <typename C>
+typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
+Interval<Boundary, Info>::upper_extend(const C& c) {
+  PPL_ASSERT(OK());
+  bool open;
+  switch (c.rel()) {
+  case V_LGE:
+    return lower_extend();
+  case V_NAN:
+    return I_NOT_EMPTY | I_EXACT | I_UNCHANGED;
+  case V_LT:
+    open = true;
+    break;
+  case V_LE:
+  case V_EQ:
+    open = false;
+    break;
+  default:
+    PPL_ASSERT(false);
+  }
+  max_assign(UPPER, upper(), info(), UPPER, c.value(), f_info(c.value(), open));
+  PPL_ASSERT(OK());
+  return I_ANY;
+}
+
+template <typename Boundary, typename Info>
 template <typename From, typename Iterator>
 typename Enable_If<Is_Interval<From>::value, void>::type
 Interval<Boundary, Info>::CC76_widening_assign(const From& y,




More information about the PPL-devel mailing list