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.h

44 lines
859 B
C
Raw Normal View History

2011-12-12 15:29:51 +00:00
#ifndef HORUS_CPTENTRY_H
#define HORUS_CPTENTRY_H
#include <vector>
#include "Shared.h"
using namespace std;
class CptEntry
{
public:
CptEntry (unsigned index, const DConf& conf)
{
index_ = index;
conf_ = conf;
}
unsigned getParameterIndex (void) const { return index_; }
const DConf& getDomainConfiguration (void) const { return conf_; }
bool matchConstraints (const DConstraint& constr) const
{
return conf_[constr.first] == constr.second;
}
bool matchConstraints (const vector<DConstraint>& constrs) const
{
for (unsigned j = 0; j < constrs.size(); j++) {
if (conf_[constrs[j].first] != constrs[j].second) {
return false;
}
}
return true;
}
private:
unsigned index_;
DConf conf_;
};
2011-12-12 15:29:51 +00:00
#endif // HORUS_CPTENTRY_H