28 class SymbolicFactorGraph;
30 class SymbolicBayesNet;
31 class SymbolicEliminationTree;
32 class SymbolicBayesTree;
33 class SymbolicJunctionTree;
45 static std::pair<std::shared_ptr<ConditionalType>, std::shared_ptr<FactorType> >
51 const FactorGraphType&
graph,
52 std::optional<std::reference_wrapper<const VariableIndex>> variableIndex) {
79 template<
typename ITERATOR>
83 template<
class CONTAINER>
87 template<
class DERIVEDFACTOR>
95 std::initializer_list<std::shared_ptr<SymbolicFactor>> sharedFactors)
96 : Base(sharedFactors) {}
100 emplace_shared<SymbolicFactor>(
c);
110 emplace_shared<SymbolicFactor>(
c);
119 bool equals(
const This& fg,
double tol = 1
e-9)
const;
123 const std::string&
s =
"SymbolicFactorGraph",
134 void push_factor(
Key key);
148 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 150 friend class boost::serialization::access;
151 template<
class ARCHIVE>
152 void serialize(ARCHIVE & ar,
const unsigned int ) {
153 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
const gtsam::Symbol key('X', 0)
Typedefs for easier changing of types.
const Symbol key3('v', 3)
std::string serialize(const T &input)
serializes to a string
SymbolicFactorGraph(const FactorGraph< DERIVEDFACTOR > &graph)
Variable elimination algorithms for factor graphs.
static Ordering DefaultOrderingFunc(const FactorGraphType &graph, std::optional< std::reference_wrapper< const VariableIndex >> variableIndex)
The default ordering generation function.
SymbolicBayesNet BayesNetType
Type of Bayes net from sequential elimination.
const GaussianFactorGraph factors
SymbolicFactorGraph FactorGraphType
Type of the factor graph (e.g. GaussianFactorGraph)
SymbolicFactorGraph(ITERATOR firstFactor, ITERATOR lastFactor)
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
NonlinearFactorGraph graph
static const KeyFormatter DefaultKeyFormatter
FactorGraph< SymbolicFactor > Base
Typedef to base factor graph type.
const KeyFormatter & formatter
static Ordering Colamd(const FACTOR_GRAPH &graph)
std::pair< std::shared_ptr< SymbolicConditional >, std::shared_ptr< SymbolicFactor > > EliminateSymbolic(const SymbolicFactorGraph &factors, const Ordering &keys)
const Symbol key1('v', 1)
SymbolicFactor FactorType
Type of factors in factor graph.
const Symbol key4('v', 4)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
SymbolicFactorGraph & operator()(SymbolicFactor &&c)
Add a single factor and return a reference. This allows for chaining, e.g., SymbolicFactorGraph bn = ...
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
SymbolicFactorGraph(SymbolicFactor &&c)
Construct from a single factor.
static std::pair< std::shared_ptr< ConditionalType >, std::shared_ptr< FactorType > > DefaultEliminate(const FactorGraphType &factors, const Ordering &keys)
The default dense elimination function.
SymbolicConditional ConditionalType
Type of conditionals from elimination.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
SymbolicFactorGraph(std::initializer_list< std::shared_ptr< SymbolicFactor >> sharedFactors)
EliminateableFactorGraph< This > BaseEliminateable
Typedef to base elimination class.
SymbolicJunctionTree JunctionTreeType
SymbolicFactorGraph This
Typedef to this class.
void print(const std::string &s="SymbolicFactorGraph", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
SymbolicFactorGraph(const CONTAINER &factors)
SymbolicBayesTree BayesTreeType
Type of Bayes tree.
std::uint64_t Key
Integer nonlinear key type.
SymbolicEliminationTree EliminationTreeType
Type of elimination tree.
const Symbol key2('v', 2)