Go to the documentation of this file.
22 #include <gtsam_unstable/dllexport.h>
50 template <
class KeyIterator>
75 virtual bool ensureArcConsistency(
Key j,
Domains* domains)
const = 0;
78 virtual shared_ptr partiallyApply(
const DiscreteValues&)
const = 0;
81 virtual shared_ptr partiallyApply(
const Domains&)
const = 0;
86 return std::make_shared<DecisionTreeFactor>(
87 this->
operator*(df->toDecisionTreeFactor()));
92 return this->toDecisionTreeFactor() *
s;
97 return this->toDecisionTreeFactor() * dtf;
103 return this->toDecisionTreeFactor() / df;
110 return toDecisionTreeFactor().sum(nrFrontals);
114 return toDecisionTreeFactor().sum(
keys);
118 double max()
const override {
return toDecisionTreeFactor().max(); }
121 return toDecisionTreeFactor().max(nrFrontals);
125 return toDecisionTreeFactor().max(
keys);
130 throw std::runtime_error(
"Constraint::error not implemented");
136 throw std::runtime_error(
"Constraint::restrict not implemented");
146 return "`Constraint` on " + std::to_string(
size()) +
" variables\n";
152 return "<p>Constraint on " + std::to_string(
size()) +
" variables</p>";
DiscreteFactor::shared_ptr max(const Ordering &keys) const override
Create new factor by maximizing over all values with the same separator.
DiscreteFactor::shared_ptr max(size_t nrFrontals) const override
Create new factor by maximizing over all values with the same separator.
DecisionTreeFactor operator*(const DecisionTreeFactor &dtf) const override
Multiply by a DecisionTreeFactor and return a DecisionTreeFactor.
DiscreteFactor::shared_ptr multiply(const DiscreteFactor::shared_ptr &df) const override
Multiply factors, DiscreteFactor::shared_ptr edition.
DiscreteFactor::shared_ptr operator/(const DiscreteFactor::shared_ptr &df) const override
divide by DiscreteFactor::shared_ptr f (safely)
Constraint(KeyIterator beginKey, KeyIterator endKey)
construct from container
std::string markdown(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override
Render as markdown table.
DiscreteFactor::shared_ptr restrict(const DiscreteValues &assignment) const override
Compute error for each assignment and return as a tree.
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override
Render as html table.
DiscreteFactor::shared_ptr sum(const Ordering &keys) const override
Create new factor by summing all values with the same separator values.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Constraint(const KeyVector &js)
Construct n-way constraint factor.
double max() const override
Find the max value.
virtual DiscreteFactor::shared_ptr operator*(double s) const override
Multiply by a scalar.
uint64_t nrValues() const override
Get the number of non-zero values contained in this factor.
AlgebraicDecisionTree< Key > errorTree() const override
Compute error for each assignment and return as a tree.
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
std::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
DiscreteValues::Names Names
Translation table from values to strings.
Constraint(Key j1, Key j2)
Construct binary constraint factor.
unsigned __int64 uint64_t
DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override
Create new factor by summing all values with the same separator values.
std::shared_ptr< Constraint > shared_ptr
std::uint64_t Key
Integer nonlinear key type.
~Constraint() override
Virtual destructor.
Constraint(Key j)
Construct unary constraint factor.
gtsam
Author(s):
autogenerated on Wed Mar 19 2025 03:01:26