[PPL-devel] [GIT] ppl/ppl(master): MIP_Problem: don' t copy Coefficient objects to cache accesses, in steepest_edge_exact_entering_index().

Marco Poletti poletti.marco at gmail.com
Thu Sep 9 08:24:23 CEST 2010


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

Author: Marco Poletti <poletti.marco at gmail.com>
Date:   Thu Sep  9 08:25:24 2010 +0200

MIP_Problem: don't copy Coefficient objects to cache accesses, in steepest_edge_exact_entering_index().

---

 src/MIP_Problem.cc |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/MIP_Problem.cc b/src/MIP_Problem.cc
index c122db4..882af9e 100644
--- a/src/MIP_Problem.cc
+++ b/src/MIP_Problem.cc
@@ -1089,14 +1089,11 @@ PPL::MIP_Problem::steepest_edge_exact_entering_index() const {
     // Compute the lcm of all the coefficients of variables in base.
     PPL_DIRTY_TEMP_COEFFICIENT(lcm_basis);
     lcm_basis = 1;
-    std::vector<Coefficient> tableau_base(tableau_num_rows);
-    for (dimension_type i = tableau_num_rows; i-- > 0; ) {
-      tableau_base[i] = tableau[i].get(base[i]);
-      lcm_assign(lcm_basis, lcm_basis, tableau_base[i]);
-    }
+    for (dimension_type i = tableau_num_rows; i-- > 0; )
+      lcm_assign(lcm_basis, lcm_basis, tableau[i].get(base[i]));
     // Compute normalization factors.
     for (dimension_type i = tableau_num_rows; i-- > 0; )
-      exact_div_assign(norm_factor[i], lcm_basis, tableau_base[i]);
+      exact_div_assign(norm_factor[i], lcm_basis, tableau[i].get(base[i]));
     // Compute the square of `lcm_basis', exploiting the fact that
     // `lcm_basis' will no longer be needed.
     lcm_basis *= lcm_basis;




More information about the PPL-devel mailing list