GaussianBayesTree.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 
27 
28 namespace gtsam {
29 
30  // Instantiate base class
31  template class BayesTreeCliqueBase<GaussianBayesTreeClique, GaussianFactorGraph>;
32  template class BayesTree<GaussianBayesTreeClique>;
33 
34  /* ************************************************************************* */
35  namespace internal
36  {
37  /* ************************************************************************* */
39  double& parentSum) {
40  parentSum += clique->conditional()
41  ->R()
42  .diagonal()
43  .unaryExpr([](double x) { return log(x); })
44  .sum();
45  return 0;
46  }
47  } // namespace internal
48 
49  /* ************************************************************************* */
50  bool GaussianBayesTree::equals(const This& other, double tol) const
51  {
52  return Base::equals(other, tol);
53  }
54 
55  /* ************************************************************************* */
57  {
59  }
60 
61  /* ************************************************************************* */
63  {
64  gttic(GaussianBayesTree_optimizeGradientSearch);
66  }
67 
68  /* ************************************************************************* */
70  return GaussianFactorGraph(*this).gradient(x0);
71  }
72 
73  /* ************************************************************************* */
75  return GaussianFactorGraph(*this).gradientAtZero();
76  }
77 
78  /* ************************************************************************* */
79  double GaussianBayesTree::error(const VectorValues& x) const {
80  return GaussianFactorGraph(*this).error(x);
81  }
82 
83  /* ************************************************************************* */
85  {
86  if(this->roots_.empty()) {
87  return 0.0;
88  } else {
89  double sum = 0.0;
91  return sum;
92  }
93  }
94 
95  /* ************************************************************************* */
97  {
98  return exp(logDeterminant());
99  }
100 
101  /* ************************************************************************* */
103  {
104  return marginalFactor(key)->information().inverse();
105  }
106 
107 
108 } // \namespace gtsam
109 
110 
111 
112 
VectorValues gradient(const VectorValues &x0) const
VectorValues optimizeGradientSearch() const
bool equals(const This &other, double tol=1e-9) const
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
double logDeterminant(const typename BAYESTREE::sharedClique &clique)
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:43
EIGEN_DEVICE_FUNC const LogReturnType log() const
Base class for cliques of a BayesTree.
double error(const VectorValues &x) const
VectorValues optimizeGradientSearch() const
sharedConditional marginalFactor(Key j, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const
void DepthFirstForest(FOREST &forest, DATA &rootData, VISITOR_PRE &visitorPre, VISITOR_POST &visitorPost)
double error(const VectorValues &x) const
#define gttic(label)
Definition: timing.h:280
Factor Graph Values.
VectorValues gradient(const VectorValues &x0) const
double logDeterminant(const GaussianBayesTreeClique::shared_ptr &clique, double &parentSum)
Templated algorithms that are used in multiple places in linear.
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
Definition: mpreal.h:2381
VectorValues optimizeBayesTree(const BAYESTREE &bayesTree)
static Symbol x0('x', 0)
traits
Definition: chartTesting.h:28
VectorValues optimize() const
VectorValues gradientAtZero() const
Chordal Bayes Net, the result of eliminating a factor graph.
const G double tol
Definition: Group.h:83
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Gaussian Bayes Tree, the result of eliminating a GaussianJunctionTree.
Matrix marginalCovariance(Key key) const
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:61
boost::shared_ptr< This > shared_ptr
virtual VectorValues gradientAtZero() const
bool equals(const This &other, double tol=1e-9) const


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:05