[PPL-devel] [GIT] ppl/ppl(pip): Improved the deepest row selection cut strategy.
François Galea
francois.galea at uvsq.fr
Thu Nov 19 13:12:26 CET 2009
Module: ppl/ppl
Branch: pip
Commit: 249afaa3a7bf3dcb85f97b7e2850241b87c2e20c
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=249afaa3a7bf3dcb85f97b7e2850241b87c2e20c
Author: François Galea <francois.galea at uvsq.fr>
Date: Thu Nov 19 11:59:49 2009 +0100
Improved the deepest row selection cut strategy.
---
src/PIP_Tree.cc | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc
index 53b24a7..b4996cf 100644
--- a/src/PIP_Tree.cc
+++ b/src/PIP_Tree.cc
@@ -1711,30 +1711,28 @@ PIP_Solution_Node::solve(PIP_Tree_Node*& parent_ref,
} else /* PIP_CUTTING_STRATEGY_DEEPEST */ {
/* Look for the row which will generate the "deepest" cut */
PPL_DIRTY_TEMP_COEFFICIENT(score);
- PPL_DIRTY_TEMP_COEFFICIENT(score1);
PPL_DIRTY_TEMP_COEFFICIENT(score2);
Coefficient best = 0;
- dimension_type best_i = 0;
+ dimension_type best_i = n_a_d;
for (i_ = 0; i_ < num_vars; ++i_) {
if (basis[i_])
continue;
i = mapping[i_];
const Row& row_t = tableau.t[i];
const Row& row_s = tableau.s[i];
- score1 = 0;
+ score = 0;
for (j = 0; j < num_params; ++j) {
mod_assign(mod, row_t[j], d);
if (mod != 0)
- score1 += d - mod;
+ score += d - mod;
}
score2 = 0;
for (j = 0; j < num_vars; ++j) {
mod_assign(mod, row_s[j], d);
- if (mod != 0)
- score2 += d - mod;
+ score2 += d - mod;
}
- score = score1*score2;
- if (score > best) {
+ score *= score2;
+ if (best_i == n_a_d || score > best) {
best = score;
best_i = i;
}
More information about the PPL-devel
mailing list