DiscreteBayesTree.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 
21 #pragma once
22 
28 
29 #include <string>
30 
31 namespace gtsam {
32 
33 // Forward declarations
34 class DiscreteConditional;
35 class VectorValues;
36 
37 /* ************************************************************************* */
39 class GTSAM_EXPORT DiscreteBayesTreeClique
40  : public BayesTreeCliqueBase<DiscreteBayesTreeClique, DiscreteFactorGraph> {
41  public:
45  typedef boost::shared_ptr<This> shared_ptr;
46  typedef boost::weak_ptr<This> weak_ptr;
50  const boost::shared_ptr<DiscreteConditional>& conditional)
51  : Base(conditional) {}
52 
55  const std::string& s = "Clique: ",
57  conditional_->printSignature(s, formatter);
58  }
59 
60  //** evaluate conditional probability of subtree for given Values */
61  double evaluate(const DiscreteConditional::Values& values) const;
62 };
63 
64 /* ************************************************************************* */
66 class GTSAM_EXPORT DiscreteBayesTree
67  : public BayesTree<DiscreteBayesTreeClique> {
68  private:
70 
71  public:
73  typedef boost::shared_ptr<This> shared_ptr;
74 
77 
79  bool equals(const This& other, double tol = 1e-9) const;
80 
81  //** evaluate probability for given Values */
82  double evaluate(const DiscreteConditional::Values& values) const;
83 };
84 
85 } // namespace gtsam
Base class for conditional densities.
boost::shared_ptr< This > shared_ptr
leaf::MyValues values
DiscreteBayesTreeClique This
static const KeyFormatter DefaultKeyFormatter
Definition: Key.h:43
const KeyFormatter & formatter
BayesTree< DiscreteBayesTreeClique > Base
void printSignature(const std::string &s="Clique: ", const KeyFormatter &formatter=DefaultKeyFormatter) const
print index signature only
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
Array< double, 1, 3 > e(1./3., 0.5, 2.)
RealScalar s
BayesTreeCliqueBase< DiscreteBayesTreeClique, DiscreteFactorGraph > Base
Bayes Tree is a tree of cliques of a Bayes Chain.
traits
Definition: chartTesting.h:28
boost::shared_ptr< This > shared_ptr
DiscreteBayesTreeClique(const boost::shared_ptr< DiscreteConditional > &conditional)
const G double tol
Definition: Group.h:83
Base class for cliques of a BayesTree.
boost::weak_ptr< This > weak_ptr


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