28 typedef std::shared_ptr<SingleValue>
shared_ptr;
32 :
Constraint(key), cardinality_(n), value_(value) {}
36 :
Constraint(dkey.first), cardinality_(dkey.second), value_(value) {}
40 DefaultKeyFormatter)
const override;
44 if (!dynamic_cast<const SingleValue*>(&other))
47 const SingleValue& f(static_cast<const SingleValue&>(other));
48 return (cardinality_ == f.cardinality_) && (value_ == f.value_);
67 bool ensureArcConsistency(
Key j, Domains* domains)
const override;
70 Constraint::shared_ptr partiallyApply(
const DiscreteValues& values)
const override;
73 Constraint::shared_ptr partiallyApply(
74 const Domains& domains)
const override;
SingleValue(Key key, size_t n, size_t value)
Construct from key, cardinality, and given value.
Definition: SingleValue.h:31
Definition: DecisionTreeFactor.h:44
Definition: Constraint.h:35
Point2 operator*(double s, const Point2 &p)
multiply with scalar
Definition: Point2.h:52
GTSAM_EXPORT void print(const Matrix &A, const std::string &s, std::ostream &stream)
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
Definition: chartTesting.h:28
specialized key for discrete variables
Definition: DiscreteFactor.h:38
std::pair< Key, size_t > DiscreteKey
Definition: DiscreteKey.h:38
bool equals(const DiscreteFactor &other, double tol) const override
equals
Definition: SingleValue.h:43
SingleValue(const DiscreteKey &dkey, size_t value)
Construct from DiscreteKey and given value.
Definition: SingleValue.h:35
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
Definition: SingleValue.h:19