gtsam  4.1.0
gtsam
BayesNet.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 
21 #include <boost/shared_ptr.hpp>
22 
24 
25 namespace gtsam {
26 
33  template<class CONDITIONAL>
34  class BayesNet : public FactorGraph<CONDITIONAL> {
35 
36  private:
37 
39 
40  public:
41  typedef typename boost::shared_ptr<CONDITIONAL> sharedConditional;
42 
43  protected:
46 
48  BayesNet() {};
49 
51  template<typename ITERATOR>
52  BayesNet(ITERATOR firstConditional, ITERATOR lastConditional) : Base(firstConditional, lastConditional) {}
53 
55 
56  public:
59 
61  void print(const std::string& s = "BayesNet",
62  const KeyFormatter& formatter = DefaultKeyFormatter) const;
63 
65 
68 
69  void saveGraph(const std::string &s, const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
70  };
71 
72 }
73 
74 #include <gtsam/inference/BayesNet-inst.h>
FactorGraph.h
Factor Graph Base Class.
gtsam
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
gtsam::FactorGraph
A factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition: FactorGraph.h:94
gtsam::BayesNet
A BayesNet is a tree of conditionals, stored in elimination order.
Definition: BayesNet.h:34
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
gtsam::BayesNet::print
void print(const std::string &s="BayesNet", const KeyFormatter &formatter=DefaultKeyFormatter) const
print out graph
Definition: BayesNet-inst.h:31
gtsam::BayesNet::BayesNet
BayesNet()
Default constructor as an empty BayesNet.
Definition: BayesNet.h:48
gtsam::BayesNet::sharedConditional
boost::shared_ptr< CONDITIONAL > sharedConditional
A shared pointer to a conditional.
Definition: BayesNet.h:41
gtsam::BayesNet::BayesNet
BayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
Construct from iterator over conditionals.
Definition: BayesNet.h:52