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