18 std::vector<typename GM::ValueType> & lambdas,
19 std::vector<typename GM::LabelType> & resultArg,
20 const typename GM::ValueType threshold=0.0
22 typedef typename GM::IndexType IndexType;
24 typedef typename GM::ValueType ValueType;
26 resultArg.resize(gm.numberOfVariables());
32 for(IndexType fi=0;fi<gm.numberOfFactors();++fi){
35 const IndexType vi0 =gm[fi].variableIndex(0);
36 const IndexType vi1 =gm[fi].variableIndex(1);
37 if(lambdas[fi]>threshold){
42 std::map<IndexType,IndexType> representativeLabeling;
44 ufd.representativeLabeling(representativeLabeling);
46 for(IndexType vi=0;vi<gm.numberOfVariables();++vi){
47 const IndexType find=ufd.find(vi);
48 const IndexType dense=representativeLabeling[find];
#define OPENGM_CHECK_OP(A, OP, B, TXT)
Disjoint set data structure with path compression.
void startFromThreshold(const GM &gm, std::vector< typename GM::ValueType > &lambdas, std::vector< typename GM::LabelType > &resultArg, const typename GM::ValueType threshold=0.0)