gtsam 4.1.1
gtsam
SymbolicBayesNet.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
19#pragma once
20
23#include <gtsam/base/types.h>
24
25namespace gtsam {
26
30 class SymbolicBayesNet : public FactorGraph<SymbolicConditional> {
31
32 public:
33
35 typedef SymbolicBayesNet This;
37 typedef boost::shared_ptr<This> shared_ptr;
38 typedef boost::shared_ptr<ConditionalType> sharedConditional;
39
42
45
47 template<typename ITERATOR>
48 SymbolicBayesNet(ITERATOR firstConditional, ITERATOR lastConditional) : Base(firstConditional, lastConditional) {}
49
51 template<class CONTAINER>
52 explicit SymbolicBayesNet(const CONTAINER& conditionals) : Base(conditionals) {}
53
55 template<class DERIVEDCONDITIONAL>
57
59 virtual ~SymbolicBayesNet() {}
60
62
65
67 GTSAM_EXPORT bool equals(const This& bn, double tol = 1e-9) const;
68
70 GTSAM_EXPORT void print(
71 const std::string& s = "SymbolicBayesNet",
72 const KeyFormatter& formatter = DefaultKeyFormatter) const override {
73 Base::print(s, formatter);
74 }
75
77
80
81 GTSAM_EXPORT void saveGraph(const std::string &s, const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
82
84
85 private:
88 template<class ARCHIVE>
89 void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
90 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
91 }
92};
93
95 template<>
96 struct traits<SymbolicBayesNet> : public Testable<SymbolicBayesNet> {
97 };
98
99} //\ namespace gtsam
Typedefs for easier changing of types.
Factor Graph Base Class.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
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
A factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition: FactorGraph.h:93
virtual void print(const std::string &s="FactorGraph", const KeyFormatter &formatter=DefaultKeyFormatter) const
print out graph
Definition: FactorGraph-inst.h:36
Symbolic Bayes Net.
Definition: SymbolicBayesNet.h:30
virtual ~SymbolicBayesNet()
Destructor.
Definition: SymbolicBayesNet.h:59
GTSAM_EXPORT bool equals(const This &bn, double tol=1e-9) const
Check equality.
Definition: SymbolicBayesNet.cpp:32
GTSAM_EXPORT void print(const std::string &s="SymbolicBayesNet", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
Definition: SymbolicBayesNet.h:70
SymbolicBayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
Construct from iterator over conditionals.
Definition: SymbolicBayesNet.h:48
SymbolicBayesNet(const CONTAINER &conditionals)
Construct from container of factors (shared_ptr or plain objects)
Definition: SymbolicBayesNet.h:52
SymbolicBayesNet()
Construct empty factor graph.
Definition: SymbolicBayesNet.h:44
friend class boost::serialization::access
Serialization function.
Definition: SymbolicBayesNet.h:87
SymbolicBayesNet(const FactorGraph< DERIVEDCONDITIONAL > &graph)
Implicit copy/downcast constructor to override explicit template container constructor.
Definition: SymbolicBayesNet.h:56
SymbolicConditional is a conditional with keys but no probability data, produced by symbolic eliminat...
Definition: SymbolicConditional.h:38