27class DecisionTreeFactor;
28class DiscreteConditional;
54 typedef boost::shared_ptr<Values> sharedValues;
66 template<
typename CONTAINER>
82 const std::string& s =
"DiscreteFactor\n",
83 const KeyFormatter& formatter = DefaultKeyFormatter)
const override {
88 virtual bool empty()
const {
return size() == 0; }
Concept check for values that can be used in unit tests.
An assignment from labels to a discrete value index (size_t)
The base class for all factors.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:151
An assignment from labels to value index (size_t).
Definition: Assignment.h:34
A discrete probabilistic factor.
Definition: DecisionTreeFactor.h:38
Base class for discrete probabilistic factors The most general one is the derived DecisionTreeFactor.
Definition: DiscreteFactor.h:34
virtual bool empty() const
Test whether the factor is empty.
Definition: DiscreteFactor.h:88
Factor Base
Our base class.
Definition: DiscreteFactor.h:41
void print(const std::string &s="DiscreteFactor\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
Definition: DiscreteFactor.h:81
virtual double operator()(const Values &) const =0
Find value for given assignment of values to variables.
boost::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
Definition: DiscreteFactor.h:40
virtual ~DiscreteFactor()
Virtual destructor.
Definition: DiscreteFactor.h:70
Assignment< Key > Values
A map from keys to values TODO: Do we need this? Should we just use gtsam::Values?...
Definition: DiscreteFactor.h:53
virtual bool equals(const DiscreteFactor &lf, double tol=1e-9) const =0
equals
DiscreteFactor This
This class.
Definition: DiscreteFactor.h:39
virtual DecisionTreeFactor operator*(const DecisionTreeFactor &) const =0
Multiply in a DecisionTreeFactor and return the result as DecisionTreeFactor.
DiscreteFactor(const CONTAINER &keys)
Construct from container of keys.
Definition: DiscreteFactor.h:67
DiscreteFactor()
Default constructor creates empty factor.
Definition: DiscreteFactor.h:62
This is the base class for all factor types.
Definition: Factor.h:56
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:63