[GIT] ppl/ppl(pip): Improved the heuristic for the choice of the deepest cut.

Module: ppl/ppl Branch: pip Commit: b748415bdb69719db9fc2ed07cc253d5c71759f9 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=b748415bdb697...
Author: François Galea francois.galea@uvsq.fr Date: Fri Oct 16 09:58:24 2009 +0200
Improved the heuristic for the choice of the deepest cut.
---
src/PIP_Tree.cc | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc index 9f09443..ff42e3b 100644 --- a/src/PIP_Tree.cc +++ b/src/PIP_Tree.cc @@ -1323,19 +1323,30 @@ PIP_Solution_Node::solve(PIP_Tree_Node*& parent_ref, const Matrix& ctx, } else { /* The solution is non-integer. We have to generate a cut. */ - Coefficient mod; + /* Look for row which will generate the "deepest" cut */ - Coefficient score; + PPL_DIRTY_TEMP_COEFFICIENT(score); + PPL_DIRTY_TEMP_COEFFICIENT(score1); + PPL_DIRTY_TEMP_COEFFICIENT(score2); + PPL_DIRTY_TEMP_COEFFICIENT(mod); Coefficient best = 0; dimension_type best_i = 0; for (i_ = 0; i_ < num_rows; ++i_) { - const Row& row = tableau.t[i_]; - score = 0; + const Row& row_t = tableau.t[i_]; + const Row& row_s = tableau.s[i_]; + score1 = 0; for (j = 0; j < num_params; ++j) { - mod_assign(mod, row[j], d); + mod_assign(mod, row_t[j], d); + if (mod != 0) + score1 += d - mod; + } + score2 = 0; + for (j = 0; j < num_vars; ++j) { + mod_assign(mod, row_s[j], d); if (mod != 0) - score += d - mod; + score2 += d - mod; } + score = score1*score2; if (score > best) { best = score; best_i = i_;
participants (1)
-
François Galea