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()) {
81 bayesNetFragment = bayesNetFragment.
prune(*maxNrLeaves);
89 std::pair<HybridGaussianFactorGraph, HybridBayesNet>
104 std::vector<HybridConditional::shared_ptr> conditionals_to_erase;
114 for (
auto &
key : conditional->frontals()) {
118 conditionals_to_erase.push_back(conditional);
126 for (
auto &&conditional : conditionals_to_erase) {
131 graph.push_back(newConditionals);
138 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={})
std::shared_ptr< This > shared_ptr
bool exists(const VALUE &e) const
const GaussianFactorGraph factors
HybridBayesNet prune(size_t maxNrLeaves) const
Prune the Bayes Net such that we have at most maxNrLeaves leaves.
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
Ordering getOrdering(const HybridGaussianFactorGraph &newFactors)
static enum @1096 ordering
const gtsam::Symbol key('X', 0)
HybridBayesNet hybridBayesNet_
void push_back(std::shared_ptr< HybridConditional > conditional)
Add a hybrid conditional using a shared_ptr.
HybridGaussianConditional::shared_ptr gaussianMixture(size_t index) const
Get the hybrid Gaussian conditional from the Bayes Net posterior at index.
const_iterator end() const
const_iterator begin() const
IsDerived< DERIVEDFACTOR > add(std::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
NonlinearFactorGraph graph
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:26