32 cardinality0_(key1.second), cardinality1_(key2.second) {
36 void print(
const std::string&
s =
"",
44 if(!dynamic_cast<const BinaryAllDiff*>(&other))
54 return (
double) (values.at(
keys_[0]) != values.at(
keys_[1]));
62 std::vector<double>
table;
65 table.push_back(i1 != i2);
90 throw std::runtime_error(
"BinaryAllDiff::partiallyApply not implemented");
95 const std::vector<Domain>&)
const override {
96 throw std::runtime_error(
"BinaryAllDiff::partiallyApply not implemented");
Constraint::shared_ptr partiallyApply(const Values &) const override
Partially apply known values.
Constraint::shared_ptr partiallyApply(const std::vector< Domain > &) const override
Partially apply known values, domain version.
DecisionTreeFactor operator*(const DecisionTreeFactor &f) const override
Multiply into a decisiontree.
bool ensureArcConsistency(size_t j, std::vector< Domain > &domains) const override
KeyVector keys_
The keys involved in this factor.
static const KeyFormatter DefaultKeyFormatter
const KeyFormatter & formatter
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
const Symbol key1('v', 1)
constexpr int first(int i)
Implementation details for constexpr functions.
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 >)
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree.
bool equals(const DiscreteFactor &other, double tol) const override
equals
const KeyVector & keys() const
Access the factor's involved variable keys.
const Symbol key2('v', 2)
BinaryAllDiff(const DiscreteKey &key1, const DiscreteKey &key2)
cardinality
double operator()(const Values &values) const override
Calculate value.
boost::shared_ptr< Constraint > shared_ptr
DiscreteKeys is a set of keys that can be assembled using the & operator.