29 #include "drwnVarUniverse.h" 54 for (
int i = 0; i < (int)a.size(); i++) {
56 this->insert(make_pair(i, a[i]));
64 for (drwnClique::const_iterator it = c.begin(); it != c.end(); ++it) {
66 this->insert(make_pair(*it, a[*it]));
74 for (
size_t i = 0; i < vars.size(); i++) {
75 this->insert(make_pair(vars[i], vals[i]));
83 for (const_iterator it = begin(); it != end(); ++it) {
93 for (
size_t i = 0; i < vars.size(); i++) {
94 const_iterator it = this->find(vars[i]);
95 a[i] = (it == end()) ? -1 : it->second;
110 for (const_iterator it = begin(); it != end(); ++it) {
111 a[it->first] = it->second;
drwnFullAssignment toFullAssignment() const
convert a partial assignment to a full assignment (missing values are assigned -1) ...
Definition: drwnVarAssignment.h:102
std::vector< int > drwnLocalAssignment
defines an assignment to a subset of variables in the universe relative to some local scope (and fixe...
Definition: drwnVarAssignment.h:42
void successor(drwnFullAssignment &assignment, const drwnVarUniverse &universe)
next full assignment
Definition: drwnVarAssignment.cpp:24
drwnPartialAssignment(const drwnFullAssignment &a)
construct a partial assignment from a full assignment (values of -1 in the full assignment are ignore...
Definition: drwnVarAssignment.h:53
drwnPartialAssignment(const drwnFullAssignment &a, const drwnClique &c)
construct a partial assignment from a full assignment over a subset of the variables ...
Definition: drwnVarAssignment.h:63
void predecessor(drwnFullAssignment &assignment, const drwnVarUniverse &universe)
previous full assignment
Definition: drwnVarAssignment.cpp:36
drwnLocalAssignment toLocalAssignment(const vector< int > &vars) const
convert a partial assignment to a local assignment (missing values are assigned -1) ...
Definition: drwnVarAssignment.h:91
Data structure for definining the random variables (name and cardinality) for a given problem instanc...
Definition: drwnVarUniverse.h:29
std::set< int > drwnClique
variable clique
Definition: drwnGraphUtils.h:37
drwnPartialAssignment(const vector< int > &vars, const drwnLocalAssignment &vals)
construct a partial assignment from a partial assignment expressed using a vector of variables and a ...
Definition: drwnVarAssignment.h:73
std::vector< int > drwnFullAssignment
defines a complete assignment to all variables in the universe
Definition: drwnVarAssignment.h:36
defines an assignment to a subset of the variables
Definition: drwnVarAssignment.h:47
drwnClique getClique() const
return the clique of variables over which the partial assignment is defined
Definition: drwnVarAssignment.h:81
drwnPartialAssignment()
construct an empty partial assignment
Definition: drwnVarAssignment.h:50