15 #ifndef __defined_libdai_clustergraph_h
16 #define __defined_libdai_clustergraph_h
70 const std::vector<Var>&
vars()
const {
return _vars; }
114 bool adj(
size_t i1,
size_t i2 )
const {
119 if( find(
_G.
nb2(I).begin(),
_G.
nb2(I).end(), i2 ) !=
_G.
nb2(I).end() ) {
134 if( (J != I) && (clI <<
_clusters[J]) ) {
156 std::vector<size_t> nbs;
159 nbs.push_back( iter );
160 if( iter ==
_vars.size() ) {
162 _vars.push_back( *n );
165 _G.
addNode2( nbs.begin(), nbs.end(), nbs.size() );
185 while(
_G.
nb1(i).size() ) {
223 template<
class EliminationChoice>
232 std::set<size_t> varindices;
233 for(
size_t i = 0; i <
_vars.size(); ++i )
234 varindices.insert( i );
238 while( !varindices.empty() ) {
239 size_t i = f( cl, varindices );
244 if( totalStates > (
BigInt)maxStates )
245 DAI_THROW(OUT_OF_MEMORY);
247 varindices.erase( i );