30 for (
size_t v = 0;
v < cardinality_;
v++)
43 Constraint(other.keys_[0]), values_(other.values_) {
48 values_.insert(value);
57 return values_.size();
61 return nrValues() == 1;
65 return *values_.begin();
69 void print(
const std::string&
s =
"",
74 if(!dynamic_cast<const Domain*>(&other))
77 const Domain&
f(static_cast<const Domain&>(other));
83 return values_.count(value)>0;
100 bool ensureArcConsistency(
size_t j, std::vector<Domain>& domains)
const override;
107 bool checkAllDiff(
const KeyVector keys, std::vector<Domain>& domains);
114 const std::vector<Domain>& domains)
const override;
void print(const Matrix &A, const string &s, ostream &stream)
Point2 operator*(double s, const Point2 &p)
multiply with scalar
static const KeyFormatter DefaultKeyFormatter
boost::shared_ptr< Domain > shared_ptr
allowed values
const KeyFormatter & formatter
bool equals(const DiscreteFactor &other, double tol) const override
equals
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
constexpr int first(int i)
Implementation details for constexpr functions.
std::set< size_t > values_
Cardinality.
std::pair< Key, size_t > DiscreteKey
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Domain(const Domain &other)
Constructor.
Domain(const DiscreteKey &dkey)
specialized key for discrete variables
size_t firstValue() const
bool contains(size_t value) const
Domain(const DiscreteKey &dkey, size_t v)
boost::shared_ptr< Constraint > shared_ptr
void insert(size_t value)
insert a value, non const :-(
void erase(size_t value)
erase a value, non const :-(