DiscreteBayesTree.cpp
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 
25 
26 namespace gtsam {
27 
28  // Instantiate base class
29  template class BayesTreeCliqueBase<DiscreteBayesTreeClique, DiscreteFactorGraph>;
30  template class BayesTree<DiscreteBayesTreeClique>;
31 
32  /* ************************************************************************* */
34  const DiscreteConditional::Values& values) const {
35  // evaluate all conditionals and multiply
36  double result = (*conditional_)(values);
37  for (const auto& child : children) {
38  result *= child->evaluate(values);
39  }
40  return result;
41  }
42 
43  /* ************************************************************************* */
44  bool DiscreteBayesTree::equals(const This& other, double tol) const {
45  return Base::equals(other, tol);
46  }
47 
48  /* ************************************************************************* */
50  const DiscreteConditional::Values& values) const {
51  double result = 1.0;
52  for (const auto& root : roots_) {
53  result *= root->evaluate(values);
54  }
55  return result;
56  }
57 
58 } // \namespace gtsam
59 
60 
61 
62 
bool equals(const This &other, double tol=1e-9) const
leaf::MyValues values
Base class for cliques of a BayesTree.
const mpreal root(const mpreal &x, unsigned long int k, mp_rnd_t r=mpreal::get_default_rnd())
Definition: mpreal.h:2194
double evaluate(const DiscreteConditional::Values &values) const
Values result
double evaluate(const DiscreteConditional::Values &values) const
Discrete Bayes Tree, the result of eliminating a DiscreteJunctionTree.
traits
Definition: chartTesting.h:28
bool equals(const DiscreteBayesTreeClique &other, double tol=1e-9) const
const G double tol
Definition: Group.h:83


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