11#include <gtsam_unstable/discrete/AllDiff.h>
12#include <gtsam_unstable/discrete/SingleValue.h>
26 typedef boost::shared_ptr<Values> sharedValues;
35 boost::shared_ptr<SingleValue> factor(
new SingleValue(dkey, value));
41 boost::shared_ptr<BinaryAllDiff> factor(
new BinaryAllDiff(key1, key2));
47 boost::shared_ptr<AllDiff> factor(
new AllDiff(dkeys));
60 sharedValues optimalAssignment()
const;
63 sharedValues optimalAssignment(
const Ordering& ordering)
const;
83 void runArcConsistency(
size_t cardinality,
size_t nrIterations = 10,
84 bool print =
false)
const;
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
std::pair< Key, size_t > DiscreteKey
Key type for discrete conditionals Includes name and cardinality.
Definition: DiscreteKey.h:34
An assignment from labels to value index (size_t).
Definition: Assignment.h:34
A Discrete Factor Graph is a factor graph where all factors are Discrete, i.e.
Definition: DiscreteFactorGraph.h:66
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition: DiscreteKey.h:37
Definition: Ordering.h:34
General AllDiff constraint Returns 1 if values for all keys are different, 0 otherwise DiscreteFactor...
Definition: AllDiff.h:22
Binary AllDiff constraint Returns 1 if values for two keys are different, 0 otherwise DiscreteFactors...
Definition: BinaryAllDiff.h:23
Constraint Satisfaction Problem class A specialization of a DiscreteFactorGraph.
Definition: CSP.h:21
void addSingleValue(const DiscreteKey &dkey, size_t value)
Add a unary constraint, allowing only a single value.
Definition: CSP.h:34
KeyVector Indices
A map from keys to values.
Definition: CSP.h:24
void addAllDiff(const DiscreteKeys &dkeys)
Add a general AllDiff constraint.
Definition: CSP.h:46
void addAllDiff(const DiscreteKey &key1, const DiscreteKey &key2)
Add a binary AllDiff constraint.
Definition: CSP.h:40
SingleValue constraint.
Definition: SingleValue.h:18