gtsam  4.1.0
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 
25 namespace 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 
62 
64  GTSAM_EXPORT bool equals(const This& bn, double tol = 1e-9) const;
65 
67 
70 
71  GTSAM_EXPORT void saveGraph(const std::string &s, const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
72 
74 
75  private:
78  template<class ARCHIVE>
79  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
80  ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
81  }
82 };
83 
85  template<>
86  struct traits<SymbolicBayesNet> : public Testable<SymbolicBayesNet> {
87  };
88 
89 } //\ namespace gtsam
gtsam::SymbolicBayesNet
Symbolic Bayes Net.
Definition: SymbolicBayesNet.h:30
gtsam::SymbolicBayesNet::SymbolicBayesNet
SymbolicBayesNet()
Construct empty factor graph.
Definition: SymbolicBayesNet.h:44
gtsam::SymbolicBayesNet::SymbolicBayesNet
SymbolicBayesNet(const CONTAINER &conditionals)
Construct from container of factors (shared_ptr or plain objects)
Definition: SymbolicBayesNet.h:52
gtsam::traits
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
gtsam::SymbolicConditional
SymbolicConditional is a conditional with keys but no probability data, produced by symbolic eliminat...
Definition: SymbolicConditional.h:38
gtsam::SymbolicBayesNet::equals
GTSAM_EXPORT bool equals(const This &bn, double tol=1e-9) const
Check equality.
Definition: SymbolicBayesNet.cpp:32
types.h
Typedefs for easier changing of types.
FactorGraph.h
Factor Graph Base Class.
gtsam
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
gtsam::Testable
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
gtsam::SymbolicBayesNet::SymbolicBayesNet
SymbolicBayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
Construct from iterator over conditionals.
Definition: SymbolicBayesNet.h:48
gtsam::FactorGraph
A factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition: FactorGraph.h:94
gtsam::KeyFormatter
boost::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
SymbolicConditional.h
gtsam::SymbolicBayesNet::access
friend class boost::serialization::access
Serialization function.
Definition: SymbolicBayesNet.h:77
gtsam::SymbolicBayesNet::SymbolicBayesNet
SymbolicBayesNet(const FactorGraph< DERIVEDCONDITIONAL > &graph)
Implicit copy/downcast constructor to override explicit template container constructor.
Definition: SymbolicBayesNet.h:56