43 typedef std::shared_ptr<This> shared_ptr;
44 typedef std::shared_ptr<ConditionalType> sharedConditional;
53 template <
typename ITERATOR>
55 : Base(firstConditional, lastConditional) {}
58 template <
class CONTAINER>
60 : Base(conditionals) {}
64 template <
class DERIVEDCONDITIONAL>
74 bool equals(
const This& bn,
double tol = 1e-9)
const;
90 template <
typename... Args>
91 void add(Args&&... args) {
100 return evaluate(values);
126 std::mt19937_64* rng =
nullptr)
const;
136 DiscreteBayesNet prune(
size_t maxNrLeaves,
137 const std::optional<double>& marginalThreshold = {},
138 DiscreteValues* fixedValues =
nullptr)
const;
148 DiscreteConditional joint()
const;
155 std::string
markdown(
const KeyFormatter& keyFormatter = DefaultKeyFormatter,
156 const DiscreteFactor::Names& names = {})
const;
159 std::string
html(
const KeyFormatter& keyFormatter = DefaultKeyFormatter,
160 const DiscreteFactor::Names& names = {})
const;
167 using Base::evaluate;
168 using Base::logProbability;
173#if GTSAM_ENABLE_BOOST_SERIALIZATION
175 friend class boost::serialization::access;
176 template<
class ARCHIVE>
177 void serialize(ARCHIVE & ar,
const unsigned int ) {
178 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
std::pair< Key, size_t > DiscreteKey
Key type for discrete variables.
Definition DiscreteKey.h:38
Global functions in a separate testing namespace.
Definition chartTesting.h:28
string html(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of html.
Definition DiscreteValues.cpp:160
string markdown(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of markdown.
Definition DiscreteValues.cpp:155
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
Template to create a binary predicate.
Definition Testable.h:112
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
A Bayes net made from discrete conditional distributions.
Definition DiscreteBayesNet.h:38
DiscreteBayesNet(ITERATOR firstConditional, ITERATOR lastConditional)
Construct from iterator over conditionals.
Definition DiscreteBayesNet.h:54
DiscreteBayesNet(const FactorGraph< DERIVEDCONDITIONAL > &graph)
Implicit copy/downcast constructor to override explicit template container constructor.
Definition DiscreteBayesNet.h:65
DiscreteBayesNet(const CONTAINER &conditionals)
Construct from container of factors (shared_ptr or plain objects).
Definition DiscreteBayesNet.h:59
DiscreteBayesNet()
Construct empty Bayes net.
Definition DiscreteBayesNet.h:50
void add(Args &&... args)
Add a DiscreteCondtional.
Definition DiscreteBayesNet.h:91
void add(const DiscreteKey &key, const std::string &spec)
Add a DiscreteDistribution using a table or a string.
Definition DiscreteBayesNet.h:85
Discrete Conditional Density Derives from DecisionTreeFactor.
Definition DiscreteConditional.h:40
A map from keys to values.
Definition DiscreteValues.h:34
BayesNet()
Definition BayesNet.h:48
A factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition FactorGraph.h:58
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
Definition FactorGraph.h:153
The Factor::error simply extracts the.