[opengm] 272/386: RebindGm added to LPCplex2
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Aug 31 08:38:09 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/master
in repository opengm.
commit df112955a5055f71d85f01db024a4d382f39f3df
Author: Janez Ales <janez.ales at iwr.uni-heidelberg.de>
Date: Tue Sep 15 15:11:00 2015 +0200
RebindGm added to LPCplex2
---
include/opengm/inference/lpcplex.hxx | 15 ++++++++-------
include/opengm/inference/lpcplex2.hxx | 9 +++++++++
include/opengm/learning/bundle-optimizer.hxx | 2 +-
include/opengm/learning/solver/CplexBackend.h | 1 -
src/unittest/test_gm_learning_functions.cxx | 4 ++--
5 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/include/opengm/inference/lpcplex.hxx b/include/opengm/inference/lpcplex.hxx
index 52712c8..07c77f4 100644
--- a/include/opengm/inference/lpcplex.hxx
+++ b/include/opengm/inference/lpcplex.hxx
@@ -482,7 +482,7 @@ LPCplex<GM, ACC>::infer
break;
}
- // MIP EMPHASIS
+ // MIP EMPHASIS
switch(parameter_.mipEmphasis_) {
case MIP_EMPHASIS_BALANCED:
cplex_.setParam(IloCplex::MIPEmphasis, 0);
@@ -503,11 +503,11 @@ LPCplex<GM, ACC>::infer
// verbose options
if(parameter_.verbose_ == false) {
- cplex_.setParam(IloCplex::MIPDisplay, 0);
- cplex_.setParam(IloCplex::BarDisplay, 0);
- cplex_.setParam(IloCplex::SimDisplay, 0);
- cplex_.setParam(IloCplex::NetDisplay, 0);
- cplex_.setParam(IloCplex::SiftDisplay, 0);
+ cplex_.setParam(IloCplex::MIPDisplay, 0);
+ cplex_.setParam(IloCplex::BarDisplay, 0);
+ cplex_.setParam(IloCplex::SimDisplay, 0);
+ cplex_.setParam(IloCplex::NetDisplay, 0);
+ cplex_.setParam(IloCplex::SiftDisplay, 0);
}
// tolarance settings
@@ -555,11 +555,12 @@ LPCplex<GM, ACC>::infer
//cplex_.setParam(IloCplex::MIRCuts, parameter_.MIRCutLevel_);
// solve problem
+
if(!cplex_.solve()) {
std::cout << "failed to optimize. " <<cplex_.getStatus() << std::endl;
return UNKNOWN;
}
- cplex_.getValues(sol_, x_);
+ cplex_.getValues(sol_, x_);
}
catch(IloCplex::Exception e) {
std::cout << "caught CPLEX exception: " << e << std::endl;
diff --git a/include/opengm/inference/lpcplex2.hxx b/include/opengm/inference/lpcplex2.hxx
index 8769055..6ed2d88 100644
--- a/include/opengm/inference/lpcplex2.hxx
+++ b/include/opengm/inference/lpcplex2.hxx
@@ -25,6 +25,15 @@ public:
// public member functions
virtual std::string name() const;
+ template<class _GM>
+ struct RebindGm{
+ typedef LPCplex2<_GM, ACC_TYPE> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef LPCplex2<_GM, _ACC > type;
+ };
};
template<class GM_TYPE, class ACC_TYPE>
diff --git a/include/opengm/learning/bundle-optimizer.hxx b/include/opengm/learning/bundle-optimizer.hxx
index 7b020c6..aebe248 100644
--- a/include/opengm/learning/bundle-optimizer.hxx
+++ b/include/opengm/learning/bundle-optimizer.hxx
@@ -161,7 +161,7 @@ BundleOptimizer<T>::optimize(Oracle& oracle, Weights& w) {
Weights w_tm1 = w;
- //std::cout << "current w is " << w_tm1 << std::endl;
+ //std::cout << "current w is " << w_tm1 << std::endl;
// value of L at current w
T L_w_tm1 = 0.0;
diff --git a/include/opengm/learning/solver/CplexBackend.h b/include/opengm/learning/solver/CplexBackend.h
index d330917..b4819e5 100644
--- a/include/opengm/learning/solver/CplexBackend.h
+++ b/include/opengm/learning/solver/CplexBackend.h
@@ -330,7 +330,6 @@ CplexBackend::solve(Solution& x, double& value, std::string& msg) {
std::cerr << "Invalid value for MIP focus!" << std::endl;
setNumThreads(_parameter.numThreads);
-
if(!cplex_.solve()) {
std::cout << "failed to optimize. " << cplex_.getStatus() << std::endl;
msg = "Optimal solution *NOT* found";
diff --git a/src/unittest/test_gm_learning_functions.cxx b/src/unittest/test_gm_learning_functions.cxx
index 653e0d6..b797175 100644
--- a/src/unittest/test_gm_learning_functions.cxx
+++ b/src/unittest/test_gm_learning_functions.cxx
@@ -40,8 +40,8 @@ struct GraphicalModelTest {
ValueType, //value type (should be float double or long double)
opengm::Multiplier, //operator (something like Adder or Multiplier)
typename opengm::meta::TypeListGenerator<
- opengm::ExplicitFunction<ValueType,I,L>,
- opengm::PottsNFunction<ValueType,I,L>
+ opengm::ExplicitFunction<ValueType,I,L>,
+ opengm::PottsNFunction<ValueType,I,L>
>::type, //implicit function functor
opengm::DiscreteSpace<I, L>
> GraphicalModelType;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opengm.git
More information about the debian-science-commits
mailing list