[GIT] ppl/ppl(master): Cut exponential execution paths by calls to maybe_abandon().

Module: ppl/ppl Branch: master Commit: cf4849fd4290f04510c33c0a0582dc537e808500 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=cf4849fd4290f...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Mon Mar 22 13:54:43 2010 +0100
Cut exponential execution paths by calls to maybe_abandon().
---
src/PIP_Tree.cc | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc index 2dd7c79..9a6f489 100644 --- a/src/PIP_Tree.cc +++ b/src/PIP_Tree.cc @@ -1368,6 +1368,11 @@ PIP_Tree_Node::compatibility_check(Matrix& s) { // Perform simplex pivots on the context // until we find an empty solution or an optimum. while (true) { + // Check if the client has requested abandoning all expensive + // computations. If so, the exception specified by the client + // is thrown now. + maybe_abandon(); + dimension_type pi = num_rows; // pi is the pivot's row index. dimension_type pj = 0; // pj is the pivot's column index.
@@ -1724,6 +1729,11 @@ PIP_Solution_Node::solve(const PIP_Problem& pip,
// Main loop of the simplex algorithm. while (true) { + // Check if the client has requested abandoning all expensive + // computations. If so, the exception specified by the client + // is thrown now. + maybe_abandon(); + PPL_ASSERT(OK());
const dimension_type num_rows = tableau.t.num_rows();
participants (1)
-
Enea Zaffanella