22#include <gtsam_unstable/dllexport.h>
24#include <boost/format.hpp>
30using Domains = std::map<Key, Domain>;
38 typedef boost::shared_ptr<Constraint> shared_ptr;
51 template <
class KeyIterator>
75 virtual bool ensureArcConsistency(
Key j, Domains* domains)
const = 0;
88 const Names& names = {})
const override {
89 return (boost::format(
"`Constraint` on %1% variables\n") % (size())).str();
94 const Names& names = {})
const override {
95 return (boost::format(
"<p>Constraint on %1% variables</p>") % (size())).str();
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
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::uint64_t Key
Integer nonlinear key type.
Definition types.h:100
DiscreteValues::Names Names
Translation table from values to strings.
Definition DiscreteFactor.h:106
DiscreteFactor()
Default constructor creates empty factor.
Definition DiscreteFactor.h:55
A map from keys to values.
Definition DiscreteValues.h:34
~Constraint() override
Virtual destructor.
Definition Constraint.h:63
virtual shared_ptr partiallyApply(const Domains &) const =0
Partially apply known values, domain version.
Constraint(const KeyVector &js)
Construct n-way constraint factor.
Definition Constraint.h:48
Constraint()
Default constructor for I/O.
Constraint(Key j1, Key j2)
Construct binary constraint factor.
Definition Constraint.h:45
virtual shared_ptr partiallyApply(const DiscreteValues &) const =0
Partially apply known values.
Constraint(KeyIterator beginKey, KeyIterator endKey)
construct from container
Definition Constraint.h:52
std::string markdown(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override
Render as markdown table.
Definition Constraint.h:87
Constraint(Key j)
Construct unary constraint factor.
Definition Constraint.h:42
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override
Render as html table.
Definition Constraint.h:93
The Domain class represents a constraint that restricts the possible values a particular variable,...
Definition Domain.h:19