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 
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  virtual ~GaussianBayesNet() {}
60 
62 
65 
67  bool equals(const This& bn, double tol = 1e-9) const;
68 
70 
73 
75  VectorValues optimize() const;
76 
78  VectorValues optimize(const VectorValues& solutionForMissing) const;
79 
86  Ordering ordering() const;
87 
89 
92 
98  std::pair<Matrix, Vector> matrix(const Ordering& ordering) const;
99 
105  std::pair<Matrix, Vector> matrix() const;
106 
132  VectorValues optimizeGradientSearch() const;
133 
139  VectorValues gradient(const VectorValues& x0) const;
140 
147  VectorValues gradientAtZero() const;
148 
150  double error(const VectorValues& x) const;
151 
159  double determinant() const;
160 
167  double logDeterminant() const;
168 
173  VectorValues backSubstitute(const VectorValues& gx) const;
174 
181  VectorValues backSubstituteTranspose(const VectorValues& gx) const;
182 
184  void print(
185  const std::string& s = "",
186  const KeyFormatter& formatter = DefaultKeyFormatter) const override {
188  }
189 
197  void saveGraph(const std::string& s, const KeyFormatter& keyFormatter =
198  DefaultKeyFormatter) const;
199 
201 
202  private:
204  friend class boost::serialization::access;
205  template<class ARCHIVE>
206  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
207  ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
208  }
209  };
210 
212  template<>
213  struct traits<GaussianBayesNet> : public Testable<GaussianBayesNet> {
214  };
215 
216 } //\ namespace gtsam
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:155
static enum @843 ordering
void determinant(const MatrixType &m)
Definition: determinant.cpp:14
double logDeterminant(const typename BAYESTREE::sharedClique &clique)
GaussianConditional ConditionalType
GaussianBayesNet(const CONTAINER &conditionals)
boost::shared_ptr< This > shared_ptr
NonlinearFactorGraph graph
static const KeyFormatter DefaultKeyFormatter
Definition: Key.h:43
const KeyFormatter & formatter
Included from all GTSAM files.
GaussianBayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
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
Conditional Gaussian Base class.
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print graph
virtual ~GaussianBayesNet()
Destructor.
static Symbol x0('x', 0)
traits
Definition: chartTesting.h:28
boost::shared_ptr< ConditionalType > sharedConditional
GaussianBayesNet(const FactorGraph< DERIVEDCONDITIONAL > &graph)
Factor Graph Base Class.
static double error
Definition: testRot3.cpp:39
const G double tol
Definition: Group.h:83
void serialize(ARCHIVE &ar, const unsigned int)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
FactorGraph< GaussianConditional > Base
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


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