gtsam  4.0.0
gtsam
GaussianBayesNet.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 // \callgraph
20 
21 #pragma once
22 
25 #include <gtsam/global_includes.h>
26 
27 namespace gtsam {
28 
30  class GTSAM_EXPORT GaussianBayesNet: public FactorGraph<GaussianConditional>
31  {
32  public:
33 
35  typedef GaussianBayesNet This;
37  typedef boost::shared_ptr<This> shared_ptr;
38  typedef boost::shared_ptr<ConditionalType> sharedConditional;
39 
42 
45 
47  template<typename ITERATOR>
48  GaussianBayesNet(ITERATOR firstConditional, ITERATOR lastConditional) : Base(firstConditional, lastConditional) {}
49 
51  template<class CONTAINER>
52  explicit GaussianBayesNet(const CONTAINER& conditionals) : Base(conditionals) {}
53 
55  template<class DERIVEDCONDITIONAL>
57 
59 
62 
64  bool equals(const This& bn, double tol = 1e-9) const;
65 
67 
70 
72  VectorValues optimize() const;
73 
75  VectorValues optimize(const VectorValues& solutionForMissing) const;
76 
83  Ordering ordering() const;
84 
86 
89 
95  std::pair<Matrix, Vector> matrix(boost::optional<const Ordering&> ordering = boost::none) const;
96 
122  VectorValues optimizeGradientSearch() const;
123 
129  VectorValues gradient(const VectorValues& x0) const;
130 
137  VectorValues gradientAtZero() const;
138 
140  double error(const VectorValues& x) const;
141 
149  double determinant() const;
150 
157  double logDeterminant() const;
158 
163  VectorValues backSubstitute(const VectorValues& gx) const;
164 
171  VectorValues backSubstituteTranspose(const VectorValues& gx) const;
172 
174 
175  private:
177  friend class boost::serialization::access;
178  template<class ARCHIVE>
179  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
180  ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
181  }
182  };
183 
185  template<>
186  struct traits<GaussianBayesNet> : public Testable<GaussianBayesNet> {
187  };
188 
189 } //\ namespace gtsam
A conditional Gaussian functions as the node in a Bayes network It has a set of parents y,...
Definition: GaussianConditional.h:36
Conditional Gaussian Base class.
Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
Optimize for triangulation.
Definition: triangulation.cpp:73
GaussianBayesNet(const CONTAINER &conditionals)
Construct from container of factors (shared_ptr or plain objects)
Definition: GaussianBayesNet.h:52
GaussianBayesNet()
Construct empty factor graph.
Definition: GaussianBayesNet.h:44
Template to create a binary predicate.
Definition: Testable.h:110
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
Included from all GTSAM files.
This class represents a collection of vector-valued variables associated each with a unique integer i...
Definition: VectorValues.h:73
A Bayes net made from linear-Gaussian densities.
Definition: GaussianBayesNet.h:30
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
A factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition: BayesTree.h:32
GaussianBayesNet(const FactorGraph< DERIVEDCONDITIONAL > &graph)
Implicit copy/downcast constructor to override explicit template container constructor.
Definition: GaussianBayesNet.h:56
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Factor Graph Base Class.
GaussianBayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
Construct from iterator over conditionals.
Definition: GaussianBayesNet.h:48
Definition: Ordering.h:34