Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3
Conflicts: packages/CLPBN/horus/LiftedWCNF.h packages/CLPBN/horus/ParfactorList.cpp
This commit is contained in:
commit
bd9e840e8b
@ -21,6 +21,16 @@ enum class LogVarType {
|
||||
negLvt
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Workaround GCC bug #38064
|
||||
inline bool operator< (LogVarType lvt1, LogVarType lvt2)
|
||||
{
|
||||
return (int)lvt1 < (int)lvt2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
typedef long LiteralId;
|
||||
typedef std::vector<LogVarType> LogVarTypes;
|
||||
|
||||
@ -192,9 +202,7 @@ struct CmpLitLvTypes
|
||||
return true;
|
||||
}
|
||||
if (types1.lid() == types2.lid()){
|
||||
#if !defined(__GNUC__) || ( __GNUC__ == 4 && __GNUC_MINOR__ > 4)
|
||||
return types1.logVarTypes() < types2.logVarTypes();
|
||||
#endif
|
||||
return types1.logVarTypes() < types2.logVarTypes();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -118,25 +118,26 @@ ParfactorList::isAllShattered() const
|
||||
|
||||
|
||||
|
||||
struct sortByParams {
|
||||
bool operator() (const Parfactor* pf1, const Parfactor* pf2) const
|
||||
{
|
||||
if (pf1->params().size() < pf2->params().size()) {
|
||||
return true;
|
||||
} else if (pf1->params().size() == pf2->params().size() &&
|
||||
pf1->params() < pf2->params()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
void
|
||||
ParfactorList::print() const
|
||||
{
|
||||
struct sortByParams {
|
||||
bool operator() (const Parfactor* pf1, const Parfactor* pf2) const
|
||||
{
|
||||
if (pf1->params().size() < pf2->params().size()) {
|
||||
return true;
|
||||
} else if (pf1->params().size() == pf2->params().size() &&
|
||||
pf1->params() < pf2->params()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
Parfactors pfVec (pfList_.begin(), pfList_.end());
|
||||
#if !defined(__GNUC__) || ( __GNUC__ == 4 && __GNUC_MINOR__ > 4)
|
||||
std::sort (pfVec.begin(), pfVec.end(), sortByParams());
|
||||
#endif
|
||||
for (size_t i = 0; i < pfVec.size(); i++) {
|
||||
pfVec[i]->print();
|
||||
std::cout << std::endl;
|
||||
|
Reference in New Issue
Block a user