24#include <boost/shared_ptr.hpp>
25#include <boost/assign/list_of.hpp>
26#include <boost/make_shared.hpp>
33 class SymbolicConditional;
58 Base(boost::assign::cref_list_of<1>(j)) {}
62 Base(boost::assign::cref_list_of<2>(j1)(j2)) {}
66 Base(boost::assign::cref_list_of<3>(j1)(j2)(j3)) {}
70 Base(boost::assign::cref_list_of<4>(j1)(j2)(j3)(j4)) {}
74 Base(boost::assign::cref_list_of<5>(j1)(j2)(j3)(j4)(j5)) {}
78 Base(boost::assign::cref_list_of<6>(j1)(j2)(j3)(j4)(j5)(j6)) {}
93 bool equals(
const This& other,
double tol = 1e-9)
const;
97 const std::string& s =
"SymbolicFactor",
98 const KeyFormatter& formatter = DefaultKeyFormatter)
const override {
104 const std::string& s =
"SymbolicFactor",
105 const KeyFormatter& formatter = DefaultKeyFormatter)
const override {
106 Base::printKeys(s, formatter);
115 template<
typename KEYITERATOR>
121 template<
typename KEYITERATOR>
124 result->keys_.assign(beginKey, endKey);
130 template<
class CONTAINER>
137 template<
class CONTAINER>
139 return FromIteratorsShared(keys.begin(), keys.end());
148 bool empty()
const {
return keys_.empty(); }
152 std::pair<boost::shared_ptr<SymbolicConditional>, boost::shared_ptr<SymbolicFactor> >
153 eliminate(
const Ordering& keys)
const;
159 friend class boost::serialization::access;
160 template<
class ARCHIVE>
161 void serialize(ARCHIVE & ar,
const unsigned int ) {
162 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
167 class SymbolicFactorGraph;
174 GTSAM_EXPORT std::pair<boost::shared_ptr<SymbolicConditional>, boost::shared_ptr<SymbolicFactor> >
Concept check for values that can be used in unit tests.
The base class for all factors.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:112
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
std::pair< boost::shared_ptr< SymbolicConditional >, boost::shared_ptr< SymbolicFactor > > EliminateSymbolic(const SymbolicFactorGraph &factors, const Ordering &keys)
Dense elimination function for symbolic factors.
Definition: SymbolicFactor.cpp:31
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
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
Template to create a binary predicate.
Definition: Testable.h:111
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:151
This is the base class for all factor types.
Definition: Factor.h:56
Definition: Ordering.h:34
SymbolicConditional is a conditional with keys but no probability data, produced by symbolic eliminat...
Definition: SymbolicConditional.h:38
SymbolicFactor represents a symbolic factor that specifies graph topology but is not associated with ...
Definition: SymbolicFactor.h:39
void print(const std::string &s="SymbolicFactor", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
Definition: SymbolicFactor.h:96
bool empty() const
Whether the factor is empty (involves zero variables).
Definition: SymbolicFactor.h:148
SymbolicFactor(Key j1, Key j2, Key j3, Key j4, Key j5, Key j6)
Construct 6-way factor.
Definition: SymbolicFactor.h:77
boost::shared_ptr< This > shared_ptr
Overriding the shared_ptr typedef.
Definition: SymbolicFactor.h:48
static SymbolicFactor FromKeys(const CONTAINER &keys)
Constructor from a collection of keys - compatible with boost::assign::list_of and boost::assign::cre...
Definition: SymbolicFactor.h:131
SymbolicFactor(const Factor &factor)
Create symbolic version of any factor.
Definition: SymbolicFactor.h:81
SymbolicFactor(Key j1, Key j2, Key j3, Key j4)
Construct 4-way factor.
Definition: SymbolicFactor.h:69
SymbolicFactor(Key j1, Key j2)
Construct binary factor.
Definition: SymbolicFactor.h:61
static SymbolicFactor FromIterators(KEYITERATOR beginKey, KEYITERATOR endKey)
Constructor from a collection of keys.
Definition: SymbolicFactor.h:116
void printKeys(const std::string &s="SymbolicFactor", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print only keys
Definition: SymbolicFactor.h:103
static SymbolicFactor::shared_ptr FromKeysShared(const CONTAINER &keys)
Constructor from a collection of keys - compatible with boost::assign::list_of and boost::assign::cre...
Definition: SymbolicFactor.h:138
SymbolicFactor(Key j1, Key j2, Key j3)
Construct ternary factor.
Definition: SymbolicFactor.h:65
SymbolicFactor(Key j)
Construct unary factor.
Definition: SymbolicFactor.h:57
SymbolicFactor(Key j1, Key j2, Key j3, Key j4, Key j5)
Construct 5-way factor.
Definition: SymbolicFactor.h:73
static SymbolicFactor::shared_ptr FromIteratorsShared(KEYITERATOR beginKey, KEYITERATOR endKey)
Constructor from a collection of keys.
Definition: SymbolicFactor.h:122
SymbolicFactor()
Default constructor for I/O.
Definition: SymbolicFactor.h:54
SymbolicFactor::shared_ptr clone() const
Copy this object as its actual derived type.
Definition: SymbolicFactor.h:86