diff --git a/packages/CLPBN/horus/LiftedWCNF.h b/packages/CLPBN/horus/LiftedWCNF.h index 67a6134ea..6fc800c4f 100644 --- a/packages/CLPBN/horus/LiftedWCNF.h +++ b/packages/CLPBN/horus/LiftedWCNF.h @@ -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 LogVarTypes; diff --git a/packages/CLPBN/horus/ParfactorList.cpp b/packages/CLPBN/horus/ParfactorList.cpp index dc50858ad..b07c59ef4 100644 --- a/packages/CLPBN/horus/ParfactorList.cpp +++ b/packages/CLPBN/horus/ParfactorList.cpp @@ -118,21 +118,24 @@ 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) - { - 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()); std::sort (pfVec.begin(), pfVec.end(), sortByParams()); for (size_t i = 0; i < pfVec.size(); i++) {