Go to the documentation of this file.
20 cout <<
s <<
"SingleValue on "
21 <<
"j=" <<
formatter(keys_[0]) <<
" with value " << value_ << endl;
26 return (
double)(
values.
at(keys_[0]) == value_);
33 for (
size_t i1 = 0;
i1 < cardinality_;
i1++)
table.push_back(
i1 == value_);
41 return toDecisionTreeFactor() *
f;
47 throw invalid_argument(
"SingleValue check on wrong domain");
49 if (
D.isSingleton()) {
50 if (
D.firstValue() != value_)
throw runtime_error(
"Unsatisfiable");
53 D =
Domain(discreteKey(), value_);
59 DiscreteValues::const_iterator it =
values.
find(keys_[0]);
60 if (it !=
values.
end() && it->second != value_)
61 throw runtime_error(
"SingleValue::partiallyApply: unsatisfiable");
62 return std::make_shared<SingleValue>(keys_[0], cardinality_, value_);
68 const Domain& Dk = domains.at(keys_[0]);
70 throw runtime_error(
"SingleValue::partiallyApply: unsatisfiable");
71 return std::make_shared<SingleValue>(discreteKey(), value_);
DecisionTreeFactor operator*(const DecisionTreeFactor &f) const override
Multiply into a decisiontree.
bool contains(size_t value) const
Concept check for values that can be used in unit tests.
bool ensureArcConsistency(Key j, Domains *domains) const override
const KeyFormatter & formatter
double operator()(const DiscreteValues &values) const override
Calculate value.
DiscreteKeys is a set of keys that can be assembled using the & operator.
const ValueType at(Key j) const
deref_iterator end() const
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
std::map< Key, Domain > Domains
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Constraint::shared_ptr partiallyApply(const DiscreteValues &values) const override
Partially apply known values.
std::pair< Key, size_t > DiscreteKey
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
std::shared_ptr< Constraint > shared_ptr
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree.
std::uint64_t Key
Integer nonlinear key type.
deref_iterator find(Key j) const
gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:02:50