gtsam  4.0.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 GTSAM_EXPORT 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  bool equals(const This& bn, double tol = 1e-9) const;
65 
67 
70 
71  void saveGraph(const std::string &s, const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
72 
74 
75  private:
77  friend class boost::serialization::access;
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
SymbolicBayesNet()
Construct empty factor graph.
Definition: SymbolicBayesNet.h:44
Symbolic Bayes Net.
Definition: SymbolicBayesNet.h:30
Template to create a binary predicate.
Definition: Testable.h:110
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
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:33
SymbolicConditional is a conditional with keys but no probability data, produced by symbolic eliminat...
Definition: SymbolicConditional.h:36
SymbolicBayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
Construct from iterator over conditionals.
Definition: SymbolicBayesNet.h:48
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 factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition: BayesTree.h:32
SymbolicBayesNet(const CONTAINER &conditionals)
Construct from container of factors (shared_ptr or plain objects)
Definition: SymbolicBayesNet.h:52
SymbolicBayesNet(const FactorGraph< DERIVEDCONDITIONAL > &graph)
Implicit copy/downcast constructor to override explicit template container constructor.
Definition: SymbolicBayesNet.h:56
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Factor Graph Base Class.
Typedefs for easier changing of types.