[DRE-commits] [ruby-dep-selector] 01/17: Revert "Port to libgecode >= 4.0 (Closes: #710104)"

Hleb Valoshka tsfgnu-guest at moszumanska.debian.org
Thu Jun 25 21:36:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

tsfgnu-guest pushed a commit to branch master
in repository ruby-dep-selector.

commit 5e1ec77aec412f92b91f913414e9df9d12e3eeac
Author: Hleb Valoshka <375gnu at gmail.com>
Date:   Thu Jun 25 11:07:30 2015 +0300

    Revert "Port to libgecode >= 4.0 (Closes: #710104)"
    
    This reverts commit bb4958abd664da0b45d06b88238e36e90703ab7e.
---
 debian/changelog                          |  5 ----
 ext/dep_gecode/dep_selector_to_gecode.cpp | 43 +++++++++++++++----------------
 ext/dep_gecode/dep_selector_to_gecode.h   |  2 +-
 3 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index e887fba..62a1caf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,11 +9,6 @@ ruby-dep-selector (0.0.8-2) unstable; urgency=low
     + build for all versions supported by gem2deb (currently 1.9.1 and 2.0)
     + improve a little bit the description
   * debian/copyright: use DEP5 copyright-format/1.0 official URL
-  * Port to libgecode >= 4.0 (Closes: #710104)
-    - Restart class has been renamed to RBS which needs an Engine (chose DFS)
-    - instances of RBS need a Search::Cutoff (arbitraly chose Geometric)
-    - variable selection are now functions and need brackets
-    - statistics about memory are not available in gecode (by default)
 
  -- Cédric Boutillier <boutil at debian.org>  Tue, 26 Nov 2013 15:26:33 +0100
 
diff --git a/ext/dep_gecode/dep_selector_to_gecode.cpp b/ext/dep_gecode/dep_selector_to_gecode.cpp
index 895d9b4..6992d79 100644
--- a/ext/dep_gecode/dep_selector_to_gecode.cpp
+++ b/ext/dep_gecode/dep_selector_to_gecode.cpp
@@ -340,30 +340,30 @@ void VersionProblem::Finalize()
   DEBUG_STREAM.flush();
   }
   // This branching starts as far as possible from the solution, in order to exercise the optimization functions.
-  branch(*this, disabled_package_variables, INT_VAR_SIZE_MIN(), INT_VAL_MAX());
-  branch(*this, package_versions, INT_VAR_SIZE_MIN(), INT_VAL_MIN());
-  branch(*this, total_required_disabled, INT_VAL_MAX());
-  branch(*this, total_induced_disabled, INT_VAL_MAX());
-  branch(*this, total_suspicious_disabled, INT_VAL_MAX());
-  branch(*this, total_disabled, INT_VAL_MAX());
-  branch(*this, at_latest, INT_VAR_SIZE_MIN(), INT_VAL_MIN());
-  branch(*this, total_preferred_at_latest, INT_VAL_MIN());
-  branch(*this, total_not_preferred_at_latest, INT_VAL_MIN());
+  branch(*this, disabled_package_variables, INT_VAR_SIZE_MIN, INT_VAL_MAX);
+  branch(*this, package_versions, INT_VAR_SIZE_MIN, INT_VAL_MIN);
+  branch(*this, total_required_disabled, INT_VAL_MAX);
+  branch(*this, total_induced_disabled, INT_VAL_MAX);
+  branch(*this, total_suspicious_disabled, INT_VAL_MAX);
+  branch(*this, total_disabled, INT_VAL_MAX);
+  branch(*this, at_latest, INT_VAR_SIZE_MIN, INT_VAL_MIN);
+  branch(*this, total_preferred_at_latest, INT_VAL_MIN);
+  branch(*this, total_not_preferred_at_latest, INT_VAL_MIN);
 #else // USE_DUMB_BRANCHING
   if (debug_logging) {
   DEBUG_STREAM << "Adding branching (BEST)" << std::endl;
   DEBUG_STREAM.flush();
   }
   // This branching is meant to start with most probable solution
-  branch(*this, disabled_package_variables, INT_VAR_SIZE_MIN(), INT_VAL_MIN());
-  branch(*this, package_versions, INT_VAR_SIZE_MIN(), INT_VAL_MAX());
-  branch(*this, total_required_disabled, INT_VAL_MIN());
-  branch(*this, total_induced_disabled, INT_VAL_MIN());
-  branch(*this, total_suspicious_disabled, INT_VAL_MIN());
-  branch(*this, total_disabled, INT_VAL_MIN());
-  branch(*this, at_latest, INT_VAR_SIZE_MIN(), INT_VAL_MAX());
-  branch(*this, total_preferred_at_latest, INT_VAL_MAX());
-  branch(*this, total_not_preferred_at_latest, INT_VAL_MAX());
+  branch(*this, disabled_package_variables, INT_VAR_SIZE_MIN, INT_VAL_MIN);
+  branch(*this, package_versions, INT_VAR_SIZE_MIN, INT_VAL_MAX);
+  branch(*this, total_required_disabled, INT_VAL_MIN);
+  branch(*this, total_induced_disabled, INT_VAL_MIN);
+  branch(*this, total_suspicious_disabled, INT_VAL_MIN);
+  branch(*this, total_disabled, INT_VAL_MIN);
+  branch(*this, at_latest, INT_VAR_SIZE_MIN, INT_VAL_MAX);
+  branch(*this, total_preferred_at_latest, INT_VAL_MAX);
+  branch(*this, total_not_preferred_at_latest, INT_VAL_MAX);
 #endif // USE_DUMB_BRANCHING
 
   if (debug_logging) {
@@ -570,9 +570,7 @@ VersionProblem * VersionProblem::InnerSolve(VersionProblem * problem, int &iterc
     DEBUG_STREAM << "Creating solver" << std::endl << std::flush;
 #endif
     VersionProblem *best_solution = NULL;
-    Search::Options o;
-    o.cutoff = Search::Cutoff::geometric();
-    RBS<DFS,VersionProblem> solver(problem, o);
+    Restart<VersionProblem> solver(problem);
     
 #ifdef MEMORY_DEBUG
     DEBUG_STREAM << "Starting Solve" << std::endl << std::flush;
@@ -593,7 +591,7 @@ VersionProblem * VersionProblem::InnerSolve(VersionProblem * problem, int &iterc
             DEBUG_STREAM << "Trial Solution #" << itercount << "===============================" << std::endl;
             const Search::Statistics & stats = solver.statistics();
             DEBUG_STREAM << "Solver stats: Prop:" << stats.propagate << " Fail:" << stats.fail << " Node:" << stats.node;
-            DEBUG_STREAM << " Depth:" << stats.depth << std::endl;
+            DEBUG_STREAM << " Depth:" << stats.depth << " memory:" << stats.memory << std::endl;
             solution->Print(DEBUG_STREAM);
         }
     }
@@ -607,6 +605,7 @@ VersionProblem * VersionProblem::InnerSolve(VersionProblem * problem, int &iterc
         std::cerr << "Time: " << elapsed_time << "ms ";
         const Search::Statistics & final_stats = solver.statistics();
         std::cerr << "Stats: " << itercount << " steps, ";
+        std::cerr << final_stats.memory << " bytes, ";
         std::cerr << final_stats.propagate << " props, " << final_stats.node << " nodes, " << final_stats.depth << " depth ";
         std::cerr << std::endl << std::flush;
     }
diff --git a/ext/dep_gecode/dep_selector_to_gecode.h b/ext/dep_gecode/dep_selector_to_gecode.h
index 1cac754..c92ff48 100644
--- a/ext/dep_gecode/dep_selector_to_gecode.h
+++ b/ext/dep_gecode/dep_selector_to_gecode.h
@@ -151,7 +151,7 @@ class Solver {
   Solver(VersionProblem *s);
   VersionProblem GetNextSolution();
  private:
-  RBS<DFS,VersionProblem> solver;
+  Restart<VersionProblem> solver;
 };
 
 #endif // dep_selector_to_gecode_h

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-dep-selector.git



More information about the Pkg-ruby-extras-commits mailing list