[PPL-devel] [GIT] ppl/ppl(pip): Implemented Bland' s anti-cycling rule in compatibility_check.

François Galea francois.galea at uvsq.fr
Mon Nov 2 17:44:59 CET 2009


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

Author: François Galea <francois.galea at uvsq.fr>
Date:   Mon Nov  2 17:41:11 2009 +0100

Implemented Bland's anti-cycling rule in compatibility_check.

---

 src/PIP_Tree.cc |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc
index 3f703e7..4c47ff5 100644
--- a/src/PIP_Tree.cc
+++ b/src/PIP_Tree.cc
@@ -720,16 +720,16 @@ PIP_Solution_Node::compatibility_check(const Matrix &ctx, const Row &cnst) {
         if (i == num_rows)
           i = i_;
         for (j_=1; j_<num_cols; ++j_) {
-          if (rs[j_] > 0) {
-            if(j == 0)
-              j = j_;
-            break;
-          }
+          // Search for first least nonnegative pivot candidate
+          const Coefficient& c = rs[j_];
+          if (c > 0 && (j == 0 || c < rs[j]))
+            j = j_;
         }
-        if (j_==num_cols) {
+        if (j == 0) {
           // No positive pivot candidate: empty problem
           return false;
         }
+        break;
       }
     }
 




More information about the PPL-devel mailing list