[sdpb] 102/233: Added detectPrimalFeasibleJump and findPrimalFeasible options

Tobias Hansen thansen at moszumanska.debian.org
Thu Mar 9 04:06:25 UTC 2017


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

thansen pushed a commit to branch master
in repository sdpb.

commit 7b91c3fbbb7c9dba1172fbab49744f30d2bbd90f
Author: David Simmons-Duffin <dsd at ssh1.sns.ias.edu>
Date:   Mon Nov 17 12:06:07 2014 -0500

    Added detectPrimalFeasibleJump and findPrimalFeasible options
---
 src/SDPSolver.cpp   | 4 ++++
 src/SDPSolver.h     | 4 ++++
 src/SDPSolverIO.cpp | 8 ++++++++
 src/main.cpp        | 9 +++++++++
 4 files changed, 25 insertions(+)

diff --git a/src/SDPSolver.cpp b/src/SDPSolver.cpp
index e29ad4e..311f596 100644
--- a/src/SDPSolver.cpp
+++ b/src/SDPSolver.cpp
@@ -633,8 +633,12 @@ SDPSolverTerminateReason SDPSolver::run(const SDPSolverParameters &parameters,
 
     if (isPrimalFeasible && isDualFeasible && isOptimal)
       return PrimalDualOptimal;
+    else if (isPrimalFeasible && parameters.findPrimalFeasible)
+      return PrimalFeasible;
     else if (isDualFeasible && parameters.findDualFeasible)
       return DualFeasible;
+    else if (primalStepLength == 1 && parameters.detectPrimalFeasibleJump)
+      return PrimalFeasibleJumpDetected;
     else if (dualStepLength == 1 && parameters.detectDualFeasibleJump)
       return DualFeasibleJumpDetected;
     // Detect max iterations after computing errors and objective
diff --git a/src/SDPSolver.h b/src/SDPSolver.h
index b81af6c..c0f0ae1 100644
--- a/src/SDPSolver.h
+++ b/src/SDPSolver.h
@@ -22,7 +22,9 @@ public:
   int maxRuntime;
   int checkpointInterval;
   bool noFinalCheckpoint;
+  bool findPrimalFeasible;
   bool findDualFeasible;
+  bool detectPrimalFeasibleJump;
   bool detectDualFeasibleJump;
   int precision;
   int maxThreads;
@@ -55,7 +57,9 @@ public:
 
 enum SDPSolverTerminateReason {
   PrimalDualOptimal,
+  PrimalFeasible,
   DualFeasible,
+  PrimalFeasibleJumpDetected,
   DualFeasibleJumpDetected,
   MaxComplementarityExceeded,
   MaxIterationsExceeded,
diff --git a/src/SDPSolverIO.cpp b/src/SDPSolverIO.cpp
index 0a0fee0..9193ea9 100644
--- a/src/SDPSolverIO.cpp
+++ b/src/SDPSolverIO.cpp
@@ -57,7 +57,9 @@ ostream& operator<<(ostream& os, const SDPSolverParameters& p) {
   os << "maxRuntime                   = " << p.maxRuntime                   << endl;
   os << "checkpointInterval           = " << p.checkpointInterval           << endl;
   os << "noFinalCheckpoint            = " << p.noFinalCheckpoint            << endl;
+  os << "findPrimalFeasible           = " << p.findPrimalFeasible           << endl;
   os << "findDualFeasible             = " << p.findDualFeasible             << endl;
+  os << "detectPrimalFeasibleJump     = " << p.detectPrimalFeasibleJump     << endl;
   os << "detectDualFeasibleJump       = " << p.detectDualFeasibleJump       << endl;
   os << "precision(actual)            = " << p.precision << "(" << mpf_get_default_prec() << ")" << endl;
   os << "maxThreads(using)            = " << p.maxThreads << "(" << omp_get_max_threads() << ")" << endl;
@@ -79,9 +81,15 @@ ostream &operator<<(ostream& os, const SDPSolverTerminateReason& r) {
   case PrimalDualOptimal:
     os << "found primal-dual optimal solution";
     break;
+  case PrimalFeasible:
+    os << "found primal feasible solution";
+    break;
   case DualFeasible:
     os << "found dual feasible solution";
     break;
+  case PrimalFeasibleJumpDetected:
+    os << "primal feasible jump detected";
+    break;
   case DualFeasibleJumpDetected:
     os << "dual feasible jump detected";
     break;
diff --git a/src/main.cpp b/src/main.cpp
index 4275bf0..b949a9c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -117,9 +117,18 @@ int main(int argc, char** argv) {
     ("noFinalCheckpoint",
      po::bool_switch(&parameters.noFinalCheckpoint)->default_value(false),
      "Don't save a final checkpoint after terminating (useful when debugging).")
+    ("findPrimalFeasible",
+     po::bool_switch(&parameters.findPrimalFeasible)->default_value(false),
+     "Terminate once a primal feasible solution is found.")
     ("findDualFeasible",
      po::bool_switch(&parameters.findDualFeasible)->default_value(false),
      "Terminate once a dual feasible solution is found.")
+    ("detectPrimalFeasibleJump",
+     po::bool_switch(&parameters.detectPrimalFeasibleJump)->default_value(false),
+     "Terminate if a primal-step of 1 is taken. This often indicates that a "
+     "primal feasible solution would be found if the precision were high "
+     "enough. Try increasing either primalErrorThreshold or precision "
+     "and run from the latest checkpoint.")
     ("detectDualFeasibleJump",
      po::bool_switch(&parameters.detectDualFeasibleJump)->default_value(false),
      "Terminate if a dual-step of 1 is taken. This often indicates that a "

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sdpb.git



More information about the debian-science-commits mailing list