BayesNet.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 #pragma once
20 
22 
23 #include <memory>
24 #include <string>
25 
26 namespace gtsam {
27 
28 class HybridValues;
29 
34 template <class CONDITIONAL>
35 class BayesNet : public FactorGraph<CONDITIONAL> {
36  private:
38 
39  public:
40  typedef typename std::shared_ptr<CONDITIONAL>
42 
43  protected:
46 
48  BayesNet() {}
49 
51  template <typename ITERATOR>
52  BayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
53  : Base(firstConditional, lastConditional) {}
54 
60  BayesNet(std::initializer_list<sharedConditional> conditionals)
61  : Base(conditionals) {}
62 
64 
65  public:
68 
70  void print(
71  const std::string& s = "BayesNet",
72  const KeyFormatter& formatter = DefaultKeyFormatter) const override;
73 
77 
79  void dot(std::ostream& os,
80  const KeyFormatter& keyFormatter = DefaultKeyFormatter,
81  const DotWriter& writer = DotWriter()) const;
82 
84  std::string dot(const KeyFormatter& keyFormatter = DefaultKeyFormatter,
85  const DotWriter& writer = DotWriter()) const;
86 
88  void saveGraph(const std::string& filename,
89  const KeyFormatter& keyFormatter = DefaultKeyFormatter,
90  const DotWriter& writer = DotWriter()) const;
91 
95 
96  // Expose HybridValues version of logProbability.
97  double logProbability(const HybridValues& x) const;
98 
99  // Expose HybridValues version of evaluate.
100  double evaluate(const HybridValues& c) const;
101 
103 };
104 
105 } // namespace gtsam
106 
BayesNet(std::initializer_list< sharedConditional > conditionals)
Definition: BayesNet.h:60
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
void dot(std::ostream &os, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
Output to graphviz format, stream version.
Definition: BayesNet-inst.h:45
static const KeyFormatter DefaultKeyFormatter
Definition: Key.h:43
FactorGraph< CONDITIONAL > Base
Definition: BayesNet.h:37
const KeyFormatter & formatter
RealScalar s
BayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
Definition: BayesNet.h:52
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
DotWriter is a helper class for writing graphviz .dot files.
Definition: DotWriter.h:36
traits
Definition: chartTesting.h:28
std::shared_ptr< CONDITIONAL > sharedConditional
A shared pointer to a conditional.
Definition: BayesNet.h:41
ofstream os("timeSchurFactors.csv")
void saveGraph(const std::string &filename, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
output to file with graphviz format.
Definition: BayesNet-inst.h:84
double logProbability(const HybridValues &x) const
Definition: BayesNet-inst.h:94
Factor Graph Base Class.
const std::vector< GaussianConditional::shared_ptr > conditionals
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
void print(const std::string &s="BayesNet", const KeyFormatter &formatter=DefaultKeyFormatter) const override
Definition: BayesNet-inst.h:31
double evaluate(const HybridValues &c) const


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:33:57