change from DiscreteValues to Assignment<Key>
parent
aa25ccfa6e
commit
90d7e21941
|
@ -26,7 +26,7 @@ void AllDiff::print(const std::string& s, const KeyFormatter& formatter) const {
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
double AllDiff::operator()(const DiscreteValues& values) const {
|
||||
double AllDiff::operator()(const Assignment<Key>& values) const {
|
||||
std::set<size_t> taken; // record values taken by keys
|
||||
for (Key dkey : keys_) {
|
||||
size_t value = values.at(dkey); // get the value for that key
|
||||
|
|
|
@ -45,7 +45,7 @@ class GTSAM_UNSTABLE_EXPORT AllDiff : public Constraint {
|
|||
}
|
||||
|
||||
/// Calculate value = expensive !
|
||||
double operator()(const DiscreteValues& values) const override;
|
||||
double operator()(const Assignment<Key>& values) const override;
|
||||
|
||||
/// Convert into a decisiontree, can be *very* expensive !
|
||||
DecisionTreeFactor toDecisionTreeFactor() const override;
|
||||
|
|
|
@ -47,7 +47,7 @@ class BinaryAllDiff : public Constraint {
|
|||
}
|
||||
|
||||
/// Calculate value
|
||||
double operator()(const DiscreteValues& values) const override {
|
||||
double operator()(const Assignment<Key>& values) const override {
|
||||
return (double)(values.at(keys_[0]) != values.at(keys_[1]));
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ string Domain::base1Str() const {
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
double Domain::operator()(const DiscreteValues& values) const {
|
||||
double Domain::operator()(const Assignment<Key>& values) const {
|
||||
return contains(values.at(key()));
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ class GTSAM_UNSTABLE_EXPORT Domain : public Constraint {
|
|||
bool contains(size_t value) const { return values_.count(value) > 0; }
|
||||
|
||||
/// Calculate value
|
||||
double operator()(const DiscreteValues& values) const override;
|
||||
double operator()(const Assignment<Key>& values) const override;
|
||||
|
||||
/// Convert into a decisiontree
|
||||
DecisionTreeFactor toDecisionTreeFactor() const override;
|
||||
|
|
Loading…
Reference in New Issue