Go to the documentation of this file.
22 #include <unordered_set>
37 const KeySet newFactorKeys = newFactors.
keys();
39 for (
auto &k : newFactorKeys) {
40 if (!allDiscrete.
exists(k)) {
41 newKeysDiscreteLast.push_back(k);
46 std::copy(allDiscrete.begin(), allDiscrete.end(),
47 std::back_inserter(newKeysDiscreteLast));
53 index,
KeyVector(newKeysDiscreteLast.begin(), newKeysDiscreteLast.end()),
60 std::optional<size_t> maxNrLeaves,
61 const std::optional<Ordering> given_ordering) {
64 if (!given_ordering.has_value()) {
83 bayesNetFragment->
prune(*maxNrLeaves);
85 bayesNetFragment = std::make_shared<HybridBayesNet>(prunedBayesNetFragment);
93 std::pair<HybridGaussianFactorGraph, HybridBayesNet>
108 std::vector<HybridConditional::shared_ptr> conditionals_to_erase;
118 for (
auto &
key : conditional->frontals()) {
122 conditionals_to_erase.push_back(conditional);
130 for (
auto &&conditional : conditionals_to_erase) {
135 graph.push_back(newConditionals);
142 size_t index)
const {
const HybridBayesNet & hybridBayesNet() const
Return the Bayes Net posterior.
static Ordering ColamdConstrainedLast(const FACTOR_GRAPH &graph, const KeyVector &constrainLast, bool forceOrder=false)
void update(HybridGaussianFactorGraph graph, std::optional< size_t > maxNrLeaves={}, const std::optional< Ordering > given_ordering={})
bool exists(const VALUE &e) const
const GaussianFactorGraph factors
std::pair< HybridGaussianFactorGraph, HybridBayesNet > addConditionals(const HybridGaussianFactorGraph &graph, const HybridBayesNet &hybridBayesNet, const Ordering &ordering) const
Add conditionals from previous timestep as part of liquefication.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
An incremental smoother for hybrid factor graphs.
iterator erase(iterator item)
const sharedFactor at(size_t i) const
GaussianMixture::shared_ptr gaussianMixture(size_t index) const
Get the Gaussian Mixture from the Bayes Net posterior at index.
std::shared_ptr< GaussianMixture > shared_ptr
Ordering getOrdering(const HybridGaussianFactorGraph &newFactors)
static enum @1096 ordering
HybridBayesNet prune(size_t maxNrLeaves)
Prune the Hybrid Bayes Net such that we have at most maxNrLeaves leaves.
const gtsam::Symbol key('X', 0)
HybridBayesNet hybridBayesNet_
void push_back(std::shared_ptr< HybridConditional > conditional)
Add a hybrid conditional using a shared_ptr.
const_iterator end() const
const_iterator begin() const
std::shared_ptr< HybridBayesNet > shared_ptr
IsDerived< DERIVEDFACTOR > add(std::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
NonlinearFactorGraph graph
gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:01:00