Go to the documentation of this file.
29 :
Constraint(dkey.first), cardinality_(dkey.second) {
30 for (
size_t v = 0;
v < cardinality_;
v++) values_.insert(
v);
36 :
Constraint(dkey.first), cardinality_(dkey.second) {
52 size_t nrValues()
const {
return values_.size(); }
68 return (cardinality_ ==
f.cardinality_) && (values_ ==
f.values_);
74 throw std::runtime_error(
"Domain::error not implemented");
79 std::string base1Str()
const;
100 bool ensureArcConsistency(
Key j,
Domains* domains)
const override;
bool contains(size_t value) const
const KeyFormatter & formatter
Domain(const DiscreteKey &dkey, size_t v)
std::set< size_t > values_
Cardinality.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
void erase(size_t value)
Erase a value, non const :-(.
void insert(size_t value)
Insert a value, non const :-(.
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Point2 operator*(double s, const Point2 &p)
multiply with scalar
void print(const Matrix &A, const string &s, ostream &stream)
bool equals(const DiscreteFactor &other, double tol) const override
equals
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
std::map< Key, Domain > Domains
Key key() const
The one key.
specialized key for discrete variables
const gtsam::Symbol key('X', 0)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Domain(const DiscreteKey &dkey)
AlgebraicDecisionTree< Key > errorTree() const override
Compute error for each assignment and return as a tree.
std::pair< Key, size_t > DiscreteKey
Array< int, Dynamic, 1 > v
size_t firstValue() const
std::shared_ptr< Constraint > shared_ptr
std::shared_ptr< Domain > shared_ptr
allowed values
std::uint64_t Key
Integer nonlinear key type.
DiscreteKey discreteKey() const
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:29