This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/CLPBN/clpbn/bp/CptEntry.cpp
2011-02-23 15:31:56 +00:00

39 lines
604 B
C++

#include "CptEntry.h"
CptEntry::CptEntry (int cptIndex, vector<int> instantiations)
{
cptIndex_ = cptIndex;
instantiations_ = instantiations;
}
int
CptEntry::getCptIndex (void) const
{
return cptIndex_;
}
vector<int>
CptEntry::getDomainInstantiations (void) const
{
return instantiations_;
}
bool
CptEntry::matchConstraints (const vector<pair<int,int> >& constraints) const
{
for (unsigned int j = 0; j < constraints.size(); j++) {
int index = constraints[j].first;
if (instantiations_[index] != constraints[j].second) {
return false;
}
}
return true;
}