DiscreteBayesNet.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 
18 #pragma once
19 
20 #include <vector>
21 #include <map>
22 #include <boost/shared_ptr.hpp>
26 
27 namespace gtsam {
28 
30  class GTSAM_EXPORT DiscreteBayesNet: public BayesNet<DiscreteConditional>
31  {
32  public:
33 
37  typedef boost::shared_ptr<This> shared_ptr;
38  typedef boost::shared_ptr<ConditionalType> sharedConditional;
39 
42 
45 
47  template<typename ITERATOR>
48  DiscreteBayesNet(ITERATOR firstConditional, ITERATOR lastConditional) : Base(firstConditional, lastConditional) {}
49 
51  template<class CONTAINER>
52  explicit DiscreteBayesNet(const CONTAINER& conditionals) : Base(conditionals) {}
53 
55  template<class DERIVEDCONDITIONAL>
57 
59  virtual ~DiscreteBayesNet() {}
60 
62 
65 
67  bool equals(const This& bn, double tol = 1e-9) const;
68 
70 
73 
75  void add(const Signature& s);
76 
77 // /** Add a DiscreteCondtional in front, when listing parents first*/
78 // GTSAM_EXPORT void add_front(const Signature& s);
79 
80  //** evaluate for given Values */
81  double evaluate(const DiscreteConditional::Values & values) const;
82 
87 
89  DiscreteFactor::sharedValues sample() const;
90 
92 
93  private:
95  friend class boost::serialization::access;
96  template<class ARCHIVE>
97  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
98  ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
99  }
100  };
101 
102 // traits
103 template<> struct traits<DiscreteBayesNet> : public Testable<DiscreteBayesNet> {};
104 
105 } // \ namespace gtsam
106 
FactorGraph< DiscreteConditional > Base
leaf::MyValues values
DiscreteConditional ConditionalType
NonlinearFactorGraph graph
Bayes network.
DiscreteBayesNet(const FactorGraph< DERIVEDCONDITIONAL > &graph)
graph add(boost::make_shared< UnaryFactor >(1, 0.0, 0.0, unaryNoise))
DiscreteBayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
RealScalar s
traits
Definition: chartTesting.h:28
DiscreteBayesNet(const CONTAINER &conditionals)
boost::shared_ptr< Values > sharedValues
Factor Graph Base Class.
boost::shared_ptr< This > shared_ptr
const G double tol
Definition: Group.h:83
boost::shared_ptr< ConditionalType > sharedConditional
virtual ~DiscreteBayesNet()
Destructor.
void serialize(ARCHIVE &ar, const unsigned int)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:41:59