22 #include <gtsam_unstable/dllexport.h> 29 using Domains = std::map<Key, Domain>;
37 typedef std::shared_ptr<Constraint>
shared_ptr;
50 template <
class KeyIterator>
74 virtual bool ensureArcConsistency(
Key j, Domains* domains)
const = 0;
77 virtual shared_ptr partiallyApply(
const DiscreteValues&)
const = 0;
80 virtual shared_ptr partiallyApply(
const Domains&)
const = 0;
87 const Names& names = {})
const override {
88 return "`Constraint` on " + std::to_string(size()) +
" variables\n";
93 const Names& names = {})
const override {
94 return "<p>Constraint on " + std::to_string(size()) +
" variables</p>";
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override
Render as html table.
Definition: Constraint.h:92
Definition: Constraint.h:35
~Constraint() override
Virtual destructor.
Definition: Constraint.h:62
Constraint(Key j)
Construct unary constraint factor.
Definition: Constraint.h:41
Definition: DiscreteValues.h:34
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
std::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
Definition: DiscreteFactor.h:44
DiscreteValues::Names Names
Translation table from values to strings.
Definition: DiscreteFactor.h:102
Definition: chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
Definition: DiscreteFactor.h:38
std::string markdown(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override
Render as markdown table.
Definition: Constraint.h:86
Constraint(const KeyVector &js)
Construct n-way constraint factor.
Definition: Constraint.h:47
Constraint(KeyIterator beginKey, KeyIterator endKey)
construct from container
Definition: Constraint.h:51
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
Constraint(Key j1, Key j2)
Construct binary constraint factor.
Definition: Constraint.h:44