[opengm] 195/386: implemnted rebind for for almost all inference methods
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Aug 31 08:37:39 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 6aa04157b9c25004be53bd1ed272aaee6b03123b
Author: DerThorsten <thorsten.beier at iwr.uni-heidelberg.de>
Date: Wed Dec 24 00:41:10 2014 +0100
implemnted rebind for for almost all inference methods
---
include/opengm/inference/alphabetaswap.hxx | 2 +-
include/opengm/inference/alphaexpansion.hxx | 2 +-
.../auxiliary/fusion_move/fusion_mover.hxx | 27 +++
include/opengm/inference/fusion_based_inf.hxx | 219 ++++++++++++++++++++-
include/opengm/inference/graphcut.hxx | 29 ++-
include/opengm/inference/greedygremlin.hxx | 19 +-
include/opengm/inference/hqpbo.hxx | 23 ++-
include/opengm/inference/infandflip.hxx | 23 +++
include/opengm/inference/lazyflipper.hxx | 34 ++--
include/opengm/inference/loc.hxx | 29 +++
include/opengm/inference/lpcplex.hxx | 81 ++++++--
include/opengm/inference/lpgurobi.hxx | 80 ++++++--
include/opengm/inference/lsatr.hxx | 26 ++-
include/opengm/inference/movemaker.hxx | 8 +
include/opengm/inference/mqpbo.hxx | 25 +++
include/opengm/inference/multicut.hxx | 25 ++-
include/opengm/inference/partition-move.hxx | 15 +-
include/opengm/inference/qpbo.hxx | 17 +-
include/opengm/inference/reducedinference.hxx | 24 +++
include/opengm/inference/sat.hxx | 18 +-
include/opengm/inference/self_fusion.hxx | 33 +++-
.../python/opengm/inference/pyFusionMoves.cxx | 4 +-
src/unittest/inference/test_graphcut.cxx | 6 +-
src/unittest/inference/test_lazyflipper.cxx | 2 +-
24 files changed, 700 insertions(+), 71 deletions(-)
diff --git a/include/opengm/inference/alphabetaswap.hxx b/include/opengm/inference/alphabetaswap.hxx
index 55c3eb0..9a21537 100644
--- a/include/opengm/inference/alphabetaswap.hxx
+++ b/include/opengm/inference/alphabetaswap.hxx
@@ -31,7 +31,7 @@ public:
template<class _GM,class _ACC>
struct RebindGmAndAcc{
- typedef typename INF:: template RebindGm<_GM,_ACC>::type RebindedInf;
+ typedef typename INF:: template RebindGmAndAcc<_GM,_ACC>::type RebindedInf;
typedef AlphaBetaSwap<_GM, RebindedInf> type;
};
diff --git a/include/opengm/inference/alphaexpansion.hxx b/include/opengm/inference/alphaexpansion.hxx
index 6866ad9..d5b21e3 100644
--- a/include/opengm/inference/alphaexpansion.hxx
+++ b/include/opengm/inference/alphaexpansion.hxx
@@ -30,7 +30,7 @@ public:
template<class _GM,class _ACC>
struct RebindGmAndAcc{
- typedef typename INF:: template RebindGm<_GM,_ACC>::type RebindedInf;
+ typedef typename INF:: template RebindGmAndAcc<_GM,_ACC>::type RebindedInf;
typedef AlphaExpansion<_GM, RebindedInf> type;
};
diff --git a/include/opengm/inference/auxiliary/fusion_move/fusion_mover.hxx b/include/opengm/inference/auxiliary/fusion_move/fusion_mover.hxx
index ad46fd6..0d0f10d 100644
--- a/include/opengm/inference/auxiliary/fusion_move/fusion_mover.hxx
+++ b/include/opengm/inference/auxiliary/fusion_move/fusion_mover.hxx
@@ -405,6 +405,18 @@ template<class GM, class ACC>
class HlFusionMover{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef HlFusionMover<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef HlFusionMover<_GM, _ACC> type;
+ };
+
+
typedef GM GraphicalModelType;
typedef ACC AccumulationType;
OPENGM_GM_TYPE_TYPEDEFS;
@@ -455,6 +467,21 @@ public:
{
}
+
+ template<class P>
+ Parameter(const P & p)
+ :
+ fusionSolver_(p.fusionSolver_),
+ maxSubgraphSize_(p.maxSubgraphSize_),
+ reducedInf_(p.reducedInf_),
+ connectedComponents_(p.connectedComponents_),
+ tentacles_(p.tentacles_),
+ fusionTimeLimit_(p.fusionTimeLimit_)
+ {
+
+ }
+
+
FusionSolver fusionSolver_;
size_t maxSubgraphSize_;
bool reducedInf_;
diff --git a/include/opengm/inference/fusion_based_inf.hxx b/include/opengm/inference/fusion_based_inf.hxx
index 5883b9f..5d94024 100644
--- a/include/opengm/inference/fusion_based_inf.hxx
+++ b/include/opengm/inference/fusion_based_inf.hxx
@@ -58,12 +58,29 @@ namespace proposal_gen
template<class GM, class ACC>
class AutoTunedSmoothing{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef AutoTunedSmoothing<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef AutoTunedSmoothing<_GM, _ACC > type;
+ };
+
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
struct Parameter
{
Parameter(){}
+
+ template<class P>
+ Parameter(const P & p){
+
+ }
};
AutoTunedSmoothing(const GM & gm, const Parameter & param)
@@ -102,12 +119,27 @@ template<class GM, class ACC>
class AlphaExpansionGen
{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef AlphaExpansionGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef AlphaExpansionGen<_GM, _ACC > type;
+ };
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
struct Parameter
{
Parameter(){}
+ template<class P>
+ Parameter(const P & p){
+
+ }
};
AlphaExpansionGen(const GM &gm, const Parameter ¶m)
: gm_(gm),
@@ -163,6 +195,17 @@ public:
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
+
+ template<class _GM>
+ struct RebindGm{
+ typedef MJumpUpDownGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef MJumpUpDownGen<_GM, _ACC > type;
+ };
+
struct Parameter
{
Parameter(
@@ -172,6 +215,11 @@ public:
{
}
+ template<class P>
+ Parameter(const P & p)
+ : startDirection_(p.startDirection_){
+
+ }
std::string startDirection_;
};
MJumpUpDownGen(const GM &gm, const Parameter ¶m)
@@ -267,6 +315,16 @@ template<class GM, class ACC>
class JumpUpDownGen
{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef JumpUpDownGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef JumpUpDownGen<_GM, _ACC > type;
+ };
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
@@ -279,6 +337,13 @@ public:
{
}
+
+ template<class P>
+ Parameter(const P & p)
+ : startDirection_(p.startDirection_){
+
+ }
+
std::string startDirection_;
};
JumpUpDownGen(const GM &gm, const Parameter ¶m)
@@ -374,6 +439,17 @@ template<class GM, class ACC>
class UpDownGen
{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef UpDownGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef UpDownGen<_GM, _ACC > type;
+ };
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
@@ -386,6 +462,11 @@ public:
{
}
+ template<class P>
+ Parameter(const P & p)
+ : startDirection_(p.startDirection_){
+
+ }
std::string startDirection_;
};
UpDownGen(const GM &gm, const Parameter ¶m)
@@ -470,12 +551,27 @@ template<class GM, class ACC>
class AlphaBetaSwapGen
{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef AlphaBetaSwapGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef AlphaBetaSwapGen<_GM, _ACC > type;
+ };
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
struct Parameter
{
Parameter(){}
+ template<class P>
+ Parameter(const P & p){
+
+ }
};
private:
static size_t getMaxLabel(const GM &gm){
@@ -562,12 +658,26 @@ template<class GM, class ACC>
class RandomGen
{
public:
+ template<class _GM>
+ struct RebindGm{
+ typedef RandomGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef RandomGen<_GM, _ACC > type;
+ };
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
struct Parameter
{
Parameter(){}
+ template<class P>
+ Parameter(const P & p){
+
+ }
};
RandomGen(const GM &gm, const Parameter ¶m)
: gm_(gm),
@@ -601,12 +711,27 @@ template<class GM, class ACC>
class RandomLFGen
{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef RandomLFGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef RandomLFGen<_GM, _ACC > type;
+ };
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
struct Parameter
{
Parameter(){}
+ template<class P>
+ Parameter(const P & p){
+
+ }
};
RandomLFGen(const GM &gm, const Parameter ¶m)
: gm_(gm),
@@ -626,8 +751,9 @@ public:
opengm::RandomUniform<size_t> randomLabel(0, gm_.numberOfLabels(vi),currentStep_+vi);
proposal[vi] = randomLabel();
}
- typename opengm::LazyFlipper<GM,ACC>::Parameter para(1,proposal.begin(),proposal.end());
+ typename opengm::LazyFlipper<GM,ACC>::Parameter para(size_t(1));
opengm::LazyFlipper<GM,ACC> lf(gm_,para);
+ lf.setStartingPoint(proposal.begin());
lf.infer();
lf.arg(proposal);
++currentStep_;
@@ -643,6 +769,17 @@ template<class GM, class ACC>
class NonUniformRandomGen
{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef NonUniformRandomGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef NonUniformRandomGen<_GM, _ACC > type;
+ };
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
@@ -651,6 +788,11 @@ public:
Parameter(const float temp=1.0)
: temp_(temp){
}
+ template<class P>
+ Parameter(const P & p)
+ : temp_(p.temp_){
+
+ }
float temp_;
};
@@ -722,6 +864,17 @@ template<class GM, class ACC>
class BlurGen
{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef BlurGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef BlurGen<_GM, _ACC > type;
+ };
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
@@ -730,6 +883,11 @@ public:
Parameter(double sigma = 20.0) : sigma_(sigma)
{
}
+ template<class P>
+ Parameter(const P & p)
+ : sigma_(p.sigma_){
+
+ }
double sigma_;
};
BlurGen(const GM &gm, const Parameter ¶m)
@@ -848,6 +1006,16 @@ template<class GM, class ACC>
class EnergyBlurGen
{
public:
+ template<class _GM>
+ struct RebindGm{
+ typedef EnergyBlurGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef EnergyBlurGen<_GM, _ACC > type;
+ };
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
@@ -860,6 +1028,14 @@ public:
bool useLocalMargs_;
double temp_;
+ template<class P>
+ Parameter(const P & p)
+ : sigma_(p.sigma_),
+ useLocalMargs_(p.useLocalMargs_),
+ temp_(p.temp_){
+
+ }
+
};
EnergyBlurGen(const GM &gm, const Parameter ¶m)
: gm_(gm),
@@ -1028,6 +1204,18 @@ private:
template<class GM, class ACC>
class DynamincGen{
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef DynamincGen<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef DynamincGen<_GM, _ACC > type;
+ };
+
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
@@ -1043,6 +1231,14 @@ public:
};
struct Parameter{
+ Parameter(){
+
+ }
+ template<class P>
+ Parameter(const P & p)
+ : gen_(p.gen_){
+ }
+
GeneratorType gen_;
};
@@ -1156,6 +1352,17 @@ public:
typedef typename ProposalGen::Parameter ProposalParameter;
typedef typename FusionMoverType::Parameter FusionParameter;
+ template<class _GM>
+ struct RebindGm{
+ typedef typename PROPOSAL_GEN:: template RebindGm<_GM>::type _P;
+ typedef FusionBasedInf<_GM, _P> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef typename PROPOSAL_GEN:: template RebindGmAndAcc<_GM, _ACC>::type _P;
+ typedef FusionBasedInf<_GM, _P> type;
+ };
class Parameter
@@ -1174,6 +1381,16 @@ public:
{
}
+
+ template<class P>
+ Parameter(const P & p)
+ : proposalParam_(p.proposalParam_),
+ fusionParam_(p.fusionParam_),
+ numIt_(p.numIt_),
+ numStopIt_(p.numStopIt_){
+ }
+
+
ProposalParameter proposalParam_;
FusionParameter fusionParam_;
size_t numIt_;
diff --git a/include/opengm/inference/graphcut.hxx b/include/opengm/inference/graphcut.hxx
index 1a65656..314babd 100644
--- a/include/opengm/inference/graphcut.hxx
+++ b/include/opengm/inference/graphcut.hxx
@@ -17,6 +17,17 @@ namespace opengm {
template<class GM, class ACC, class MINSTCUT>
class GraphCut : public Inference<GM, ACC> {
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef GraphCut<_GM, ACC, MINSTCUT> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef GraphCut<_GM, _ACC, MINSTCUT> type;
+ };
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
@@ -24,12 +35,18 @@ public:
typedef visitors::VerboseVisitor<GraphCut<GM, ACC, MINSTCUT> > VerboseVisitorType;
typedef visitors::EmptyVisitor<GraphCut<GM, ACC, MINSTCUT> > EmptyVisitorType;
typedef visitors::TimingVisitor<GraphCut<GM, ACC, MINSTCUT> > TimingVisitorType;
- struct Parameter {
- Parameter(const ValueType scale = 1)
- : scale_(scale)
- {}
- ValueType scale_;
- };
+ struct Parameter {
+ Parameter(const ValueType scale = 1)
+ : scale_(scale) {
+ }
+
+ template<class P>
+ Parameter(const P & p)
+ : scale_(p.scale_){
+ }
+
+ ValueType scale_;
+ };
GraphCut(const GraphicalModelType&, const Parameter& = Parameter(), ValueType = static_cast<ValueType>(0.0));
GraphCut(size_t numVar, std::vector<size_t> numFacDim, const Parameter& = Parameter(), ValueType = static_cast<ValueType>(0.0));
diff --git a/include/opengm/inference/greedygremlin.hxx b/include/opengm/inference/greedygremlin.hxx
index ae679b3..a282bcd 100644
--- a/include/opengm/inference/greedygremlin.hxx
+++ b/include/opengm/inference/greedygremlin.hxx
@@ -44,8 +44,25 @@ namespace opengm {
typedef visitors::EmptyVisitor<GreedyGremlin<GM, ACC> > EmptyVisitorType;
typedef visitors::TimingVisitor<GreedyGremlin<GM, ACC> > TimingVisitorType;
+ template<class _GM>
+ struct RebindGm{
+ typedef GreedyGremlin<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef GreedyGremlin<_GM, _ACC > type;
+ };
+
+
struct Parameter {
-
+ Parameter(){
+
+ }
+ template<class P>
+ Parameter(const P & p){
+
+ }
};
GreedyGremlin(const GM& gm, Parameter para = Parameter());
virtual std::string name() const {return "GreedyGremlin";}
diff --git a/include/opengm/inference/hqpbo.hxx b/include/opengm/inference/hqpbo.hxx
index 0b41d57..b67fc80 100644
--- a/include/opengm/inference/hqpbo.hxx
+++ b/include/opengm/inference/hqpbo.hxx
@@ -29,7 +29,28 @@ public:
typedef visitors::TimingVisitor<HQPBO<GM,ACC> > TimingVisitorType;
typedef visitors::EmptyVisitor<HQPBO<GM,ACC> > EmptyVisitorType;
- struct Parameter {};
+
+ template<class _GM>
+ struct RebindGm{
+ typedef HQPBO<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef HQPBO<_GM, _ACC > type;
+ };
+
+
+
+ struct Parameter {
+ Parameter(){
+
+ }
+ template<class P>
+ Parameter(const P & p){
+
+ }
+ };
HQPBO(const GraphicalModelType&, Parameter = Parameter());
std::string name() const;
diff --git a/include/opengm/inference/infandflip.hxx b/include/opengm/inference/infandflip.hxx
index dede301..09820c6 100644
--- a/include/opengm/inference/infandflip.hxx
+++ b/include/opengm/inference/infandflip.hxx
@@ -33,6 +33,22 @@ public:
typedef visitors::EmptyVisitor<InfAndFlip<GM, ACC, INF> > EmptyVisitorType;
typedef visitors::TimingVisitor<InfAndFlip<GM, ACC, INF> > TimingVisitorType;
+
+
+ template<class _GM>
+ struct RebindGm{
+ typedef typename INF::template RebindGm<_GM>::type _I;
+ typedef InfAndFlip<_GM, ACC, _I> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef typename INF::template RebindGmAndAcc<_GM,_ACC>::type _I;
+ typedef InfAndFlip<_GM, _ACC, _I> type;
+ };
+
+
+
struct Parameter
{
Parameter(const size_t maxSubgraphSize=2)
@@ -41,6 +57,13 @@ public:
subPara_(),
warmStartableInf_(false){
}
+ template<class P>
+ Parameter(const P & p)
+ :
+ maxSubgraphSize_(p.maxSubgraphSize_),
+ subPara_(p.subPara_),
+ warmStartableInf_(p.warmStartableInf_){
+ }
size_t maxSubgraphSize_;
typename INF::Parameter subPara_;
diff --git a/include/opengm/inference/lazyflipper.hxx b/include/opengm/inference/lazyflipper.hxx
index c7929f6..c3d5e08 100644
--- a/include/opengm/inference/lazyflipper.hxx
+++ b/include/opengm/inference/lazyflipper.hxx
@@ -117,6 +117,18 @@ private:
template<class GM, class ACC = Minimizer>
class LazyFlipper : public Inference<GM, ACC> {
public:
+
+ template<class _GM>
+ struct RebindGm{
+ typedef LazyFlipper<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef LazyFlipper<_GM, _ACC> type;
+ };
+
+
typedef ACC AccumulationType;
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
@@ -129,29 +141,25 @@ public:
struct Parameter
{
- template<class StateIterator>
+
+
Parameter(
- const size_t maxSubgraphSize,
- StateIterator stateBegin,
- StateIterator stateEnd,
+ const size_t maxSubgraphSize = 2,
const Tribool inferMultilabel = Tribool::Maybe
)
: maxSubgraphSize_(maxSubgraphSize),
- startingPoint_(stateBegin, stateEnd),
inferMultilabel_(inferMultilabel)
{}
+ template<class P>
Parameter(
- const size_t maxSubgraphSize = 2,
- const Tribool inferMultilabel = Tribool::Maybe
+ const P & p
)
- : maxSubgraphSize_(maxSubgraphSize),
- startingPoint_(),
- inferMultilabel_(inferMultilabel)
+ : maxSubgraphSize_(p.maxSubgraphSize_),
+ inferMultilabel_(p.inferMultilabel_)
{}
size_t maxSubgraphSize_;
- std::vector<LabelType> startingPoint_;
Tribool inferMultilabel_;
};
@@ -646,9 +654,7 @@ LazyFlipper<GM, ACC>::LazyFlipper(
}
}
}
- if(param.startingPoint_.size() == gm_.numberOfVariables()) {
- movemaker_.initialize(param.startingPoint_.begin());
- }
+
}
template<class GM, class ACC>
diff --git a/include/opengm/inference/loc.hxx b/include/opengm/inference/loc.hxx
index aa7c821..9ecea8d 100644
--- a/include/opengm/inference/loc.hxx
+++ b/include/opengm/inference/loc.hxx
@@ -81,6 +81,16 @@ public:
typedef opengm::LPCplex<SubGmType,AccumulationType> LpCplexSubInf;
#endif
+ template<class _GM>
+ struct RebindGm{
+ typedef LOC<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef LOC<_GM, _ACC > type;
+ };
+
class Parameter {
public:
@@ -115,6 +125,25 @@ public:
{
}
+
+ template<class P>
+ Parameter
+ (
+ const P & p
+ )
+ : solver_(p.solver_),
+ phi_(p.phi_),
+ maxBlockRadius_(p.maxBlockRadius_),
+ maxTreeRadius_(p.maxTreeRadius_),
+ pFastHeuristic_(p.pFastHeuristic_),
+ maxIterations_(p.maxIterations_),
+ stopAfterNBadIterations_(p.stopAfterNBadIterations_),
+ maxBlockSize_(p.maxBlockSize_),
+ treeRuns_(p.treeRuns_)
+ {
+
+ }
+
// subsolver used for submodel ("ad3" or "astar" so far)
std::string solver_;
/// phi of the truncated geometric distribution is used to select a certain subgraph radius with a certain probability
diff --git a/include/opengm/inference/lpcplex.hxx b/include/opengm/inference/lpcplex.hxx
index cd155d2..841c413 100644
--- a/include/opengm/inference/lpcplex.hxx
+++ b/include/opengm/inference/lpcplex.hxx
@@ -45,6 +45,16 @@ public:
typedef visitors::EmptyVisitor<LPCplex<GM,ACC> > EmptyVisitorType;
typedef visitors::TimingVisitor<LPCplex<GM,ACC> > TimingVisitorType;
+ template<class _GM>
+ struct RebindGm{
+ typedef LPCplex<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef LPCplex<_GM, _ACC > type;
+ };
+
// enum LP_SOLVER {LP_SOLVER_AUTO, LP_SOLVER_PRIMAL_SIMPLEX, LP_SOLVER_DUAL_SIMPLEX, LP_SOLVER_NETWORK_SIMPLEX, LP_SOLVER_BARRIER, LP_SOLVER_SIFTING, LP_SOLVER_CONCURRENT};
// enum LP_PRESOLVE{LP_PRESOLVE_AUTO, LP_PRESOLVE_OFF, LP_PRESOLVE_CONSEVATIVE, LP_PRESOLVE_AGRESSIVE};
@@ -52,9 +62,9 @@ public:
class Parameter {
public:
- bool integerConstraint_; // ILP=true, 1order-LP=false
- int numberOfThreads_; // number of threads (0=autosect)
- bool verbose_; // switch on/off verbode mode
+ bool integerConstraint_; // ILP=true, 1order-LP=false
+ int numberOfThreads_; // number of threads (0=autosect)
+ bool verbose_; // switch on/off verbode mode
double cutUp_; // upper cutoff
double epOpt_; // Optimality tolerance
double epMrk_; // Markowitz tolerance
@@ -65,25 +75,62 @@ public:
double workMem_; // maximal ammount of memory in MB used for workspace
double treeMemoryLimit_; // maximal ammount of memory in MB used for treee
double timeLimit_; // maximal time in seconds the solver has
- int probeingLevel_;
+ int probeingLevel_;
//int coverCutLevel_;
//int disjunctiverCutLevel_;
//int cliqueCutLevel_;
//int MIRCutLevel_;
- LP_SOLVER rootAlg_;
- LP_SOLVER nodeAlg_;
- LP_PRESOLVE presolve_;
+ LP_SOLVER rootAlg_;
+ LP_SOLVER nodeAlg_;
+ LP_PRESOLVE presolve_;
MIP_EMPHASIS mipEmphasis_;
- MIP_CUT cutLevel_; // Determines whether or not to cuts for the problem and how aggressively (will be overruled by specific ones).
- MIP_CUT cliqueCutLevel_; // Determines whether or not to generate clique cuts for the problem and how aggressively.
- MIP_CUT coverCutLevel_; // Determines whether or not to generate cover cuts for the problem and how aggressively.
- MIP_CUT gubCutLevel_; // Determines whether or not to generate generalized upper bound (GUB) cuts for the problem and how aggressively.
- MIP_CUT mirCutLevel_; // Determines whether or not mixed integer rounding (MIR) cuts should be generated for the problem and how aggressively.
- MIP_CUT iboundCutLevel_; // Determines whether or not to generate implied bound cuts for the problem and how aggressively.
- MIP_CUT flowcoverCutLevel_; //Determines whether or not to generate flow cover cuts for the problem and how aggressively.
- MIP_CUT flowpathCutLevel_; //Determines whether or not to generate flow path cuts for the problem and how aggressively.
- MIP_CUT disjunctCutLevel_; // Determines whether or not to generate disjunctive cuts for the problem and how aggressively.
- MIP_CUT gomoryCutLevel_; // Determines whether or not to generate gomory fractional cuts for the problem and how aggressively.
+ MIP_CUT cutLevel_; // Determines whether or not to cuts for the problem and how aggressively (will be overruled by specific ones).
+ MIP_CUT cliqueCutLevel_; // Determines whether or not to generate clique cuts for the problem and how aggressively.
+ MIP_CUT coverCutLevel_; // Determines whether or not to generate cover cuts for the problem and how aggressively.
+ MIP_CUT gubCutLevel_; // Determines whether or not to generate generalized upper bound (GUB) cuts for the problem and how aggressively.
+ MIP_CUT mirCutLevel_; // Determines whether or not mixed integer rounding (MIR) cuts should be generated for the problem and how aggressively.
+ MIP_CUT iboundCutLevel_; // Determines whether or not to generate implied bound cuts for the problem and how aggressively.
+ MIP_CUT flowcoverCutLevel_; //Determines whether or not to generate flow cover cuts for the problem and how aggressively.
+ MIP_CUT flowpathCutLevel_; //Determines whether or not to generate flow path cuts for the problem and how aggressively.
+ MIP_CUT disjunctCutLevel_; // Determines whether or not to generate disjunctive cuts for the problem and how aggressively.
+ MIP_CUT gomoryCutLevel_; // Determines whether or not to generate gomory fractional cuts for the problem and how aggressively.
+
+ template<class P>
+ Parameter(
+ const P & p
+ ):
+
+ integerConstraint_(p.integerConstraint_),
+ numberOfThreads_(p.numberOfThreads_),
+ verbose_(p.verbose_),
+ cutUp_(p.cutUp_),
+ epOpt_(p.epOpt_),
+ epMrk_(p.epMrk_),
+ epRHS_(p.epRHS_),
+ epInt_(p.epInt_),
+ epAGap_(p.epAGap_),
+ epGap_(p.epGap_),
+ workMem_(p.workMem_),
+ treeMemoryLimit_(p.treeMemoryLimit_),
+ timeLimit_(p.timeLimit_),
+ probeingLevel_(p.probeingLevel_),
+ rootAlg_(p.rootAlg_),
+ nodeAlg_(p.nodeAlg_),
+ presolve_(p.presolve_),
+ mipEmphasis_(p.mipEmphasis_),
+ cutLevel_(p.cutLevel_),
+ cliqueCutLevel_(p.cliqueCutLevel_),
+ coverCutLevel_(p.coverCutLevel_),
+ gubCutLevel_(p.gubCutLevel_),
+ mirCutLevel_(p.mirCutLevel_),
+ iboundCutLevel_(p.iboundCutLevel_),
+ flowcoverCutLevel_(p.flowcoverCutLevel_),
+ flowpathCutLevel_(p.flowpathCutLevel_),
+ disjunctCutLevel_(p.disjunctCutLevel_),
+ gomoryCutLevel_(p.gomoryCutLevel_)
+ {
+
+ }
/// constructor
/// \param cutUp upper cutoff - assume that: min_x f(x) <= cutUp
diff --git a/include/opengm/inference/lpgurobi.hxx b/include/opengm/inference/lpgurobi.hxx
index 2b8e8c7..7296f8c 100644
--- a/include/opengm/inference/lpgurobi.hxx
+++ b/include/opengm/inference/lpgurobi.hxx
@@ -46,11 +46,21 @@ public:
typedef visitors::EmptyVisitor< LPGurobi<GM, ACC> > EmptyVisitorType;
+ template<class _GM>
+ struct RebindGm{
+ typedef LPGurobi<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef LPGurobi<_GM, _ACC > type;
+ };
+
class Parameter {
public:
- bool integerConstraint_; // ILP=true, 1order-LP=false
- int numberOfThreads_; // number of threads (0=autosect)
- bool verbose_; // switch on/off verbode mode
+ bool integerConstraint_; // ILP=true, 1order-LP=false
+ int numberOfThreads_; // number of threads (0=autosect)
+ bool verbose_; // switch on/off verbode mode
double cutUp_; // upper cutoff
double epOpt_; // Optimality tolerance
double epMrk_; // Markowitz tolerance
@@ -61,26 +71,62 @@ public:
double workMem_; // maximal ammount of memory in MB used for workspace
double treeMemoryLimit_; // maximal ammount of memory in MB used for treee
double timeLimit_; // maximal time in seconds the solver has
- int probeingLevel_;
+ int probeingLevel_;
//int coverCutLevel_;
//int disjunctiverCutLevel_;
//int cliqueCutLevel_;
//int MIRCutLevel_;
//int presolveLevel_;
- LP_SOLVER rootAlg_;
- LP_SOLVER nodeAlg_;
+ LP_SOLVER rootAlg_;
+ LP_SOLVER nodeAlg_;
MIP_EMPHASIS mipFocus_;
- LP_PRESOLVE presolve_;
- MIP_CUT cutLevel_; // Determines whether or not to cuts for the problem and how aggressively (will be overruled by specific ones).
- MIP_CUT cliqueCutLevel_; // Determines whether or not to generate clique cuts for the problem and how aggressively.
- MIP_CUT coverCutLevel_; // Determines whether or not to generate cover cuts for the problem and how aggressively.
- MIP_CUT gubCutLevel_; // Determines whether or not to generate generalized upper bound (GUB) cuts for the problem and how aggressively.
- MIP_CUT mirCutLevel_; // Determines whether or not mixed integer rounding (MIR) cuts should be generated for the problem and how aggressively.
- MIP_CUT iboundCutLevel_; // Determines whether or not to generate implied bound cuts for the problem and how aggressively.
- MIP_CUT flowcoverCutLevel_; //Determines whether or not to generate flow cover cuts for the problem and how aggressively.
- MIP_CUT flowpathCutLevel_; //Determines whether or not to generate flow path cuts for the problem and how aggressively.
- MIP_CUT disjunctCutLevel_; // Determines whether or not to generate disjunctive cuts for the problem and how aggressively.
- MIP_CUT gomoryCutLevel_; // Determines whether or not to generate gomory fractional cuts for the problem and how aggressively.
+ LP_PRESOLVE presolve_;
+ MIP_CUT cutLevel_; // Determines whether or not to cuts for the problem and how aggressively (will be overruled by specific ones).
+ MIP_CUT cliqueCutLevel_; // Determines whether or not to generate clique cuts for the problem and how aggressively.
+ MIP_CUT coverCutLevel_; // Determines whether or not to generate cover cuts for the problem and how aggressively.
+ MIP_CUT gubCutLevel_; // Determines whether or not to generate generalized upper bound (GUB) cuts for the problem and how aggressively.
+ MIP_CUT mirCutLevel_; // Determines whether or not mixed integer rounding (MIR) cuts should be generated for the problem and how aggressively.
+ MIP_CUT iboundCutLevel_; // Determines whether or not to generate implied bound cuts for the problem and how aggressively.
+ MIP_CUT flowcoverCutLevel_; //Determines whether or not to generate flow cover cuts for the problem and how aggressively.
+ MIP_CUT flowpathCutLevel_; //Determines whether or not to generate flow path cuts for the problem and how aggressively.
+ MIP_CUT disjunctCutLevel_; // Determines whether or not to generate disjunctive cuts for the problem and how aggressively.
+ MIP_CUT gomoryCutLevel_; // Determines whether or not to generate gomory fractional cuts for the problem and how aggressively.
+
+
+ template<class P>
+ Parameter(const P & p )
+ :
+ integerConstraint_(p.integerConstraint_),
+ numberOfThreads_(p.numberOfThreads_),
+ verbose_(p.verbose_),
+ cutUp_(p.cutUp_),
+ epOpt_(p.epOpt_),
+ epMrk_(p.epMrk_),
+ epRHS_(p.epRHS_),
+ epInt_(p.epInt_),
+ epAGap_(p.epAGap_),
+ epGap_(p.epGap_),
+ workMem_(p.workMem_),
+ treeMemoryLimit_(p.treeMemoryLimit_),
+ timeLimit_(p.timeLimit_),
+ probeingLevel_(p.probeingLevel_),
+ rootAlg_(p.rootAlg_),
+ nodeAlg_(p.nodeAlg_),
+ mipFocus_(p.mipFocus_),
+ presolve_(p.presolve_),
+ cutLevel_(p.cutLevel_),
+ cliqueCutLevel_(p.cliqueCutLevel_),
+ coverCutLevel_(p.coverCutLevel_),
+ gubCutLevel_(p.gubCutLevel_),
+ mirCutLevel_(p.mirCutLevel_),
+ iboundCutLevel_(p.iboundCutLevel_),
+ flowcoverCutLevel_(p.flowcoverCutLevel_),
+ flowpathCutLevel_(p.flowpathCutLevel_),
+ disjunctCutLevel_(p.disjunctCutLevel_),
+ gomoryCutLevel_(p.gomoryCutLevel_)
+ {
+
+ }
/// constructor
/// \param cutUp upper cutoff - assume that: min_x f(x) <= cutUp
diff --git a/include/opengm/inference/lsatr.hxx b/include/opengm/inference/lsatr.hxx
index 1ddfa42..2772356 100644
--- a/include/opengm/inference/lsatr.hxx
+++ b/include/opengm/inference/lsatr.hxx
@@ -97,7 +97,19 @@ namespace opengm {
typedef opengm::visitors::VerboseVisitor<LSA_TR<GM,ACC> > VerboseVisitorType;
typedef opengm::visitors::EmptyVisitor<LSA_TR<GM,ACC> > EmptyVisitorType;
typedef opengm::visitors::TimingVisitor<LSA_TR<GM,ACC> > TimingVisitorType;
-
+
+
+ template<class _GM>
+ struct RebindGm{
+ typedef LSA_TR<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef LSA_TR<_GM, _ACC > type;
+ };
+
+
class Parameter {
public:
enum DISTANCE {HAMMING, EUCLIDEAN};
@@ -118,6 +130,18 @@ namespace opengm {
reductionRatio_ = 0.25; // used to decide whether to increase or decrease lambda using the multiplier
distance_ = EUCLIDEAN;
}
+
+ template<class P>
+ Parameter(const P & p)
+ : randSeed_(p.randSeed_),
+ maxLambda_(p.maxLambda_),
+ initialLambda_(p.initialLambda_),
+ precisionLambda_(p.precisionLambda_),
+ lambdaMultiplier_(p.lambdaMultiplier_),
+ reductionRatio_(p.reductionRatio_),
+ distance_(p.distance_){
+
+ }
};
LSA_TR(const GraphicalModelType&);
diff --git a/include/opengm/inference/movemaker.hxx b/include/opengm/inference/movemaker.hxx
index caf3478..468115c 100644
--- a/include/opengm/inference/movemaker.hxx
+++ b/include/opengm/inference/movemaker.hxx
@@ -32,6 +32,14 @@ public:
typedef opengm::GraphicalModel<ValueType, OperatorType, FunctionTypeList, SubGmSpace> SubGmType;
/// \endcond
+
+ template<class _GM>
+ struct RebindGm{
+ typedef Movemaker<_GM> type;
+ };
+
+
+
Movemaker(const GraphicalModelType&);
template<class StateIterator>
Movemaker(const GraphicalModelType&, StateIterator);
diff --git a/include/opengm/inference/mqpbo.hxx b/include/opengm/inference/mqpbo.hxx
index c1fd399..9c14aa1 100644
--- a/include/opengm/inference/mqpbo.hxx
+++ b/include/opengm/inference/mqpbo.hxx
@@ -46,11 +46,36 @@ namespace opengm {
typedef visitors::TimingVisitor<MQPBO<GM, ACC> > TimingVisitorType;
typedef ValueType GraphValueType;
+ template<class _GM>
+ struct RebindGm{
+ typedef MQPBO<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef MQPBO<_GM, _ACC > type;
+ };
+
+
+
enum PermutationType {NONE, RANDOM, MINMARG};
class Parameter{
public:
Parameter(): useKovtunsMethod_(true), probing_(false), strongPersistency_(false), rounds_(0), permutationType_(NONE) {};
+
+
+ template<class P>
+ Parameter(const P & p)
+ : label_(p.label_),
+ useKovtunsMethod_(p.useKovtunsMethod_),
+ probing_(p.probing_),
+ strongPersistency_(p.strongPersistency_),
+ rounds_(p.rounds_),
+ permutationType_(p.permutationType_){
+
+ }
+
std::vector<LabelType> label_;
bool useKovtunsMethod_;
const bool probing_; //do not use this!
diff --git a/include/opengm/inference/multicut.hxx b/include/opengm/inference/multicut.hxx
index 7d669b0..b2038ca 100644
--- a/include/opengm/inference/multicut.hxx
+++ b/include/opengm/inference/multicut.hxx
@@ -80,7 +80,15 @@ public:
typedef visitors::VerboseVisitor<Multicut<GM,ACC> > VerboseVisitorType;
typedef visitors::EmptyVisitor<Multicut<GM,ACC> > EmptyVisitorType;
typedef visitors::TimingVisitor<Multicut<GM,ACC> > TimingVisitorType;
+ template<class _GM>
+ struct RebindGm{
+ typedef Multicut<_GM, ACC> type;
+ };
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef Multicut<_GM, _ACC > type;
+ };
#ifdef WITH_BOOST
typedef boost::unordered_map<IndexType, LPIndexType> EdgeMapType;
@@ -109,13 +117,28 @@ public:
size_t reductionMode_;
std::vector<bool> allowCutsWithin_;
+ template<class P>
+ Parameter(const P & p)
+ : numThreads_(p.numThreads_),
+ verbose_(p.verbose_),
+ verboseCPLEX_(p.verboseCPLEX_),
+ cutUp_(p.cutUp_),
+ workFlow_(p.workFlow_),
+ workFlow_(p.workFlow_),
+ maximalNumberOfConstraintsPerRound_(p.maximalNumberOfConstraintsPerRound_),
+ edgeRoundingValue_(p.edgeRoundingValue_),
+ MWCRounding_(p.MWCRounding_),
+ reductionMode_(p.reductionMode_),
+ allowCutsWithin_(p.allowCutsWithin_){
+ }
+
/// \param numThreads number of threads that should be used (default = 0 [automatic])
/// \param cutUp value which the optima at least has (helps to cut search-tree)
Parameter
(
int numThreads=0,
double cutUp=1.0e+75
- )
+ )
: numThreads_(numThreads), verbose_(false),verboseCPLEX_(false), cutUp_(cutUp),
timeOut_(36000000), maximalNumberOfConstraintsPerRound_(1000000),
edgeRoundingValue_(0.00000001),MWCRounding_(NEAREST), reductionMode_(3)
diff --git a/include/opengm/inference/partition-move.hxx b/include/opengm/inference/partition-move.hxx
index 0dc49a7..b508356 100644
--- a/include/opengm/inference/partition-move.hxx
+++ b/include/opengm/inference/partition-move.hxx
@@ -53,10 +53,23 @@ public:
typedef __gnu_cxx::hash_map<IndexType, LPIndexType> EdgeMapType;
typedef __gnu_cxx::hash_set<IndexType> VariableSetType;
#endif
-
+
+
+ template<class _GM>
+ struct RebindGm{
+ typedef PartitionMove<_GM, ACC> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef PartitionMove<_GM, _ACC > type;
+ };
+
struct Parameter{
Parameter ( ) {};
+ template<class P>
+ Parameter (const P & p) {};
};
~PartitionMove();
diff --git a/include/opengm/inference/qpbo.hxx b/include/opengm/inference/qpbo.hxx
index b24d2bf..b31571c 100644
--- a/include/opengm/inference/qpbo.hxx
+++ b/include/opengm/inference/qpbo.hxx
@@ -26,7 +26,22 @@ public:
typedef visitors::TimingVisitor<QPBO<GM,MIN_ST_CUT> > TimingVisitorType;
typedef visitors::EmptyVisitor<QPBO<GM,MIN_ST_CUT> > EmptyVisitorType;
- struct Parameter {};
+ template<class _GM>
+ struct RebindGm{
+ typedef QPBO<_GM, MIN_ST_CUT> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef QPBO<_GM ,MIN_ST_CUT> type;
+ };
+
+
+ struct Parameter{
+ Parameter ( ) {};
+ template<class P>
+ Parameter (const P & p) {};
+ };
QPBO(const GraphicalModelType&, Parameter = Parameter());
std::string name() const;
diff --git a/include/opengm/inference/reducedinference.hxx b/include/opengm/inference/reducedinference.hxx
index 16baad6..6460e9c 100644
--- a/include/opengm/inference/reducedinference.hxx
+++ b/include/opengm/inference/reducedinference.hxx
@@ -84,6 +84,19 @@ namespace opengm {
typedef visitors::TimingVisitor<ReducedInference<GM, ACC, INF> > TimingVisitorType;
+ template<class _GM>
+ struct RebindGm{
+ typedef typename INF:: template RebindGm<_GM>::type RebindedInf;
+ typedef ReducedInference<_GM, ACC, RebindedInf> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef typename INF:: template RebindGmAndAcc<_GM,_ACC>::type RebindedInf;
+ typedef ReducedInference<_GM,_ACC, RebindedInf> type;
+ };
+
+
class Parameter
{
public:
@@ -91,6 +104,17 @@ namespace opengm {
bool Persistency_;
bool Tentacle_;
bool ConnectedComponents_;
+
+
+ template<class P>
+ Parameter(const P & p)
+ : subParameter_(p.subParameter_),
+ Persistency_(p.Persistency_),
+ Tentacle_(p.Tentacle_),
+ ConnectedComponents_(p.ConnectedComponents_)
+ {
+ }
+
Parameter(
const bool Persistency=false,
const bool Tentacle=false,
diff --git a/include/opengm/inference/sat.hxx b/include/opengm/inference/sat.hxx
index 2fdbfc4..8515aaa 100644
--- a/include/opengm/inference/sat.hxx
+++ b/include/opengm/inference/sat.hxx
@@ -27,7 +27,23 @@ namespace opengm {
typedef GM GraphicalModelType;
OPENGM_GM_TYPE_TYPEDEFS;
- struct Parameter {};
+
+ template<class _GM>
+ struct RebindGm{
+ typedef SAT<_GM> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef SAT<_GM> type;
+ };
+
+
+ struct Parameter{
+ Parameter ( ) {};
+ template<class P>
+ Parameter (const P & p) {};
+ };
SAT(const GraphicalModelType&, const Parameter& = Parameter());
std::string name() const;
diff --git a/include/opengm/inference/self_fusion.hxx b/include/opengm/inference/self_fusion.hxx
index 7f260a3..37b342e 100644
--- a/include/opengm/inference/self_fusion.hxx
+++ b/include/opengm/inference/self_fusion.hxx
@@ -72,7 +72,7 @@ struct FusionVisitor{
iteration_(0),
fuseNth_(fuseNth),
value_(value),
- bound_(bound),
+ bound_(bound),
argFromInf_(selfFusion.graphicalModel().numberOfVariables()),
argBest_(argBest),
argOut_(selfFusion.graphicalModel().numberOfVariables()),
@@ -286,6 +286,19 @@ public:
};
+ template<class _GM>
+ struct RebindGm{
+ typedef typename INFERENCE:: template RebindGm<_GM>::type RebindedInf;
+ typedef SelfFusion<RebindedInf> type;
+ };
+
+ template<class _GM,class _ACC>
+ struct RebindGmAndAcc{
+ typedef typename INFERENCE:: template RebindGm<_GM, _ACC>::type RebindedInf;
+ typedef SelfFusion<RebindedInf> type;
+ };
+
+
class Parameter {
public:
Parameter(
@@ -311,6 +324,24 @@ public:
{
}
+
+ template<class P>
+ Parameter(
+ const P & p
+ )
+ : fuseNth_(p.fuseNth_),
+ fusionSolver_(p.fusionSolver_),
+ infParam_(p.infParam_),
+ maxSubgraphSize_(p.maxSubgraphSize_),
+ reducedInf_(p.reducedInf_),
+ connectedComponents_(p.connectedComponents_),
+ tentacles_(p.tentacles_),
+ fusionTimeLimit_(p.fusionTimeLimit_),
+ numStopIt_(p.numStopIt_)
+ {
+
+ }
+
UInt64Type fuseNth_;
FusionSolver fusionSolver_;
typename INFERENCE::Parameter infParam_;
diff --git a/src/interfaces/python/opengm/inference/pyFusionMoves.cxx b/src/interfaces/python/opengm/inference/pyFusionMoves.cxx
index b5f9727..bc44fbc 100644
--- a/src/interfaces/python/opengm/inference/pyFusionMoves.cxx
+++ b/src/interfaces/python/opengm/inference/pyFusionMoves.cxx
@@ -123,10 +123,10 @@ private:
#endif
}
else if(fusionSolver==std::string("lf2")){
- return fusionMover_. template fuse<LazyFlipperSubInf> (typename LazyFlipperSubInf::Parameter(2),true);
+ return fusionMover_. template fuse<LazyFlipperSubInf> (typename LazyFlipperSubInf::Parameter(size_t(2)),true);
}
else if(fusionSolver==std::string("lf3")){
- return fusionMover_. template fuse<LazyFlipperSubInf> (typename LazyFlipperSubInf::Parameter(3),true);
+ return fusionMover_. template fuse<LazyFlipperSubInf> (typename LazyFlipperSubInf::Parameter(size_t(3)),true);
}
}
diff --git a/src/unittest/inference/test_graphcut.cxx b/src/unittest/inference/test_graphcut.cxx
index a8ade0b..88d672f 100644
--- a/src/unittest/inference/test_graphcut.cxx
+++ b/src/unittest/inference/test_graphcut.cxx
@@ -61,7 +61,7 @@ int main() {
{
typedef opengm::external::MinSTCutIBFS<int, int> MinStCutType;
typedef opengm::GraphCut<GraphicalModelType, opengm::Minimizer, MinStCutType> MinGraphCut;
- MinGraphCut::Parameter para(10000);
+ MinGraphCut::Parameter para(10000.0f);
minTester.test<MinGraphCut>(para);
}
#endif
@@ -95,7 +95,7 @@ int main() {
{
typedef opengm::MinSTCutBoost<size_t, long, opengm::PUSH_RELABEL> MinStCutType;
typedef opengm::GraphCut<GraphicalModelType, opengm::Minimizer, MinStCutType> MinGraphCut;
- MinGraphCut::Parameter para(1000000);
+ MinGraphCut::Parameter para(1000000.f);
minTester.test<MinGraphCut>(para);
}
std::cout << " * Test Min-Sum with BOOST-Edmonds-Karp" << std::endl;
@@ -119,7 +119,7 @@ int main() {
{
typedef opengm::external::MinSTCutIBFS<int, int> MinStCutType;
typedef opengm::GraphCut<GraphicalModelType, opengm::Maximizer, MinStCutType> MaxGraphCut;
- MaxGraphCut::Parameter para(10000);
+ MaxGraphCut::Parameter para(10000.0f);
maxTester.test<MaxGraphCut>(para);
}
diff --git a/src/unittest/inference/test_lazyflipper.cxx b/src/unittest/inference/test_lazyflipper.cxx
index 6645c40..cee5372 100644
--- a/src/unittest/inference/test_lazyflipper.cxx
+++ b/src/unittest/inference/test_lazyflipper.cxx
@@ -83,7 +83,7 @@ void additionalTest() {
}
{
- LazyFlipper::Parameter parameter(6);
+ LazyFlipper::Parameter parameter(size_t(6));
LazyFlipper lazyFlipper(model, parameter);
lazyFlipper.infer();
--
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