28 typedef boost::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;
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;
specialized key for discrete variables
std::pair< Key, size_t > DiscreteKey
Key type for discrete variables.
Definition DiscreteKey.h:36
Global functions in a separate testing namespace.
Definition chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:156
Point2 operator*(double s, const Point2 &p)
multiply with scalar
Definition Point2.h:47
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
A discrete probabilistic factor.
Definition DecisionTreeFactor.h:45
Base class for discrete probabilistic factors The most general one is the derived DecisionTreeFactor.
Definition DiscreteFactor.h:38
A map from keys to values.
Definition DiscreteValues.h:34
KeyVector keys_
The keys involved in this factor.
Definition Factor.h:85
Constraint(Key j)
Construct unary constraint factor.
Definition Constraint.h:42
SingleValue(Key key, size_t n, size_t value)
Construct from key, cardinality, and given value.
Definition SingleValue.h:31
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