32 typedef boost::shared_ptr<SingleValue>
shared_ptr;
36 Constraint(key), cardinality_(n), value_(value) {
41 Constraint(dkey.first), cardinality_(dkey.second), value_(value) {
45 virtual void print(
const std::string& s =
"",
46 const KeyFormatter& formatter = DefaultKeyFormatter)
const;
50 if(!dynamic_cast<const SingleValue*>(&other))
53 const SingleValue& f(static_cast<const SingleValue&>(other));
54 return (cardinality_==f.cardinality_) && (value_==f.value_);
59 virtual double operator()(
const Values& values)
const;
72 bool ensureArcConsistency(
size_t j, std::vector<Domain>& domains)
const;
75 virtual Constraint::shared_ptr partiallyApply(
76 const Values& values)
const;
79 virtual Constraint::shared_ptr partiallyApply(
80 const std::vector<Domain>& domains)
const;
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:70
Base class for discrete probabilistic factors The most general one is the derived DecisionTreeFactor.
Definition: Constraint.h:32
specialized key for discrete variables
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
SingleValue constraint.
Definition: SingleValue.h:18
bool equals(const DiscreteFactor &other, double tol) const
equals
Definition: SingleValue.h:49
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
Base class for discrete probabilistic factors The most general one is the derived DecisionTreeFactor.
Definition: DiscreteFactor.h:34
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33
SingleValue(Key key, size_t n, size_t value)
Constructor.
Definition: SingleValue.h:35
A discrete probabilistic factor.
Definition: DecisionTreeFactor.h:38
std::pair< Key, size_t > DiscreteKey
Key type for discrete conditionals Includes name and cardinality.
Definition: DiscreteKey.h:34
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
boost::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
Definition: DiscreteFactor.h:40
SingleValue(const DiscreteKey &dkey, size_t value)
Constructor.
Definition: SingleValue.h:40
Point2 operator *(double s, const Point2 &p)
multiply with scalar
Definition: Point2.h:170