Public Member Functions | Private Member Functions | Private Attributes | List of all members
gtsam::HybridSmoother Class Reference

#include <HybridSmoother.h>

Public Member Functions

std::pair< HybridGaussianFactorGraph, HybridBayesNetaddConditionals (const HybridGaussianFactorGraph &graph, const HybridBayesNet &hybridBayesNet) const
 Add conditionals from previous timestep as part of liquefication. More...
 
HybridNonlinearFactorGraph allFactors () const
 Return all the recorded nonlinear factors. More...
 
const DiscreteValuesfixedValues () const
 Return fixed values: More...
 
HybridGaussianConditional::shared_ptr gaussianMixture (size_t index) const
 Get the hybrid Gaussian conditional from the Bayes Net posterior at index. More...
 
Ordering getOrdering (const HybridGaussianFactorGraph &factors, const KeySet &newFactorKeys)
 Get an elimination ordering which eliminates continuous and then discrete. More...
 
const HybridBayesNethybridBayesNet () const
 Return the Bayes Net posterior. More...
 
 HybridSmoother (const std::optional< double > marginalThreshold={})
 Constructor. More...
 
Values linearizationPoint () const
 Return the current linearization point. More...
 
HybridValues optimize () const
 Optimize the hybrid Bayes Net, taking into accound fixed values. More...
 
void reInitialize (HybridBayesNet &&hybridBayesNet)
 
void reInitialize (HybridBayesNet &hybridBayesNet)
 
void relinearize ()
 
void update (const HybridNonlinearFactorGraph &graph, const Values &initial, std::optional< size_t > maxNrLeaves={}, const std::optional< Ordering > givenOrdering={})
 

Private Member Functions

Ordering maybeComputeOrdering (const HybridGaussianFactorGraph &updatedGraph, const std::optional< Ordering > givenOrdering)
 Helper to compute the ordering if ordering is not given. More...
 
void removeFixedValues (const HybridGaussianFactorGraph &newFactors)
 Remove fixed discrete values for discrete keys introduced in newFactors. More...
 

Private Attributes

HybridNonlinearFactorGraph allFactors_
 
DiscreteValues fixedValues_
 
HybridBayesNet hybridBayesNet_
 
Values linearizationPoint_
 
std::optional< double > marginalThreshold_
 The threshold above which we make a decision about a mode. More...
 

Detailed Description

Definition at line 28 of file HybridSmoother.h.

Constructor & Destructor Documentation

◆ HybridSmoother()

gtsam::HybridSmoother::HybridSmoother ( const std::optional< double >  marginalThreshold = {})
inline

Constructor.

Parameters
removeDeadModesFlag indicating whether to remove dead modes.
marginalThresholdThe threshold above which a mode gets assigned a value and is considered "dead". 0.99 is a good starting value.

Definition at line 46 of file HybridSmoother.h.

Member Function Documentation

◆ addConditionals()

std::pair< HybridGaussianFactorGraph, HybridBayesNet > gtsam::HybridSmoother::addConditionals ( const HybridGaussianFactorGraph graph,
const HybridBayesNet hybridBayesNet 
) const

Add conditionals from previous timestep as part of liquefication.

Parameters
graphThe new factor graph for the current time step.
hybridBayesNetThe hybrid bayes net containing all conditionals so far.
orderingThe elimination ordering.
Returns
std::pair<HybridGaussianFactorGraph, HybridBayesNet>

Definition at line 198 of file HybridSmoother.cpp.

◆ allFactors()

HybridNonlinearFactorGraph gtsam::HybridSmoother::allFactors ( ) const

Return all the recorded nonlinear factors.

Definition at line 311 of file HybridSmoother.cpp.

◆ fixedValues()

const DiscreteValues& gtsam::HybridSmoother::fixedValues ( ) const
inline

Return fixed values:

Definition at line 50 of file HybridSmoother.h.

◆ gaussianMixture()

HybridGaussianConditional::shared_ptr gtsam::HybridSmoother::gaussianMixture ( size_t  index) const

Get the hybrid Gaussian conditional from the Bayes Net posterior at index.

Parameters
indexIndexing value.
Returns
HybridGaussianConditional::shared_ptr

Definition at line 267 of file HybridSmoother.cpp.

◆ getOrdering()

Ordering gtsam::HybridSmoother::getOrdering ( const HybridGaussianFactorGraph factors,
const KeySet newFactorKeys 
)

Get an elimination ordering which eliminates continuous and then discrete.

Expects factors to already have the necessary conditionals which were connected to the variables in the newly added factors. Those variables should be in newFactorKeys.

Parameters
factorsAll the new factors and connected conditionals.
newFactorKeysThe keys/variables in the newly added factors.
Returns
Ordering

Definition at line 38 of file HybridSmoother.cpp.

◆ hybridBayesNet()

const HybridBayesNet & gtsam::HybridSmoother::hybridBayesNet ( ) const

Return the Bayes Net posterior.

Definition at line 273 of file HybridSmoother.cpp.

◆ linearizationPoint()

Values gtsam::HybridSmoother::linearizationPoint ( ) const

Return the current linearization point.

Definition at line 306 of file HybridSmoother.cpp.

◆ maybeComputeOrdering()

Ordering gtsam::HybridSmoother::maybeComputeOrdering ( const HybridGaussianFactorGraph updatedGraph,
const std::optional< Ordering givenOrdering 
)
private

Helper to compute the ordering if ordering is not given.

Definition at line 65 of file HybridSmoother.cpp.

◆ optimize()

HybridValues gtsam::HybridSmoother::optimize ( ) const

Optimize the hybrid Bayes Net, taking into accound fixed values.

Definition at line 278 of file HybridSmoother.cpp.

◆ reInitialize() [1/2]

void gtsam::HybridSmoother::reInitialize ( HybridBayesNet &&  hybridBayesNet)

Re-initialize the smoother from a new hybrid Bayes Net.

Definition at line 28 of file HybridSmoother.cpp.

◆ reInitialize() [2/2]

void gtsam::HybridSmoother::reInitialize ( HybridBayesNet hybridBayesNet)

Re-initialize the smoother from a new hybrid Bayes Net (non rvalue version).

Definition at line 33 of file HybridSmoother.cpp.

◆ relinearize()

void gtsam::HybridSmoother::relinearize ( )

Relinearize the nonlinear factor graph with the latest linearization point.

Definition at line 295 of file HybridSmoother.cpp.

◆ removeFixedValues()

void gtsam::HybridSmoother::removeFixedValues ( const HybridGaussianFactorGraph newFactors)
private

Remove fixed discrete values for discrete keys introduced in newFactors.

Definition at line 89 of file HybridSmoother.cpp.

◆ update()

void gtsam::HybridSmoother::update ( const HybridNonlinearFactorGraph graph,
const Values initial,
std::optional< size_t maxNrLeaves = {},
const std::optional< Ordering givenOrdering = {} 
)

Given new factors, perform an incremental update. The relevant densities in the hybridBayesNet will be added to the input graph (fragment), and then eliminated according to the ordering presented. The remaining factor graph contains hybrid Gaussian factors that are not connected to the variables in the ordering, or a single discrete factor on all discrete keys, plus all discrete factors in the original graph.

Note
If maxNrLeaves is given, we look at the discrete factor resulting from this elimination, and prune it and the Gaussian components corresponding to the pruned choices.
Parameters
graphThe new factors, should be linear only
maxNrLeavesThe maximum number of leaves in the new discrete factor, if applicable
givenOrderingThe (optional) ordering for elimination, only continuous variables are allowed

Prune

Definition at line 99 of file HybridSmoother.cpp.

Member Data Documentation

◆ allFactors_

HybridNonlinearFactorGraph gtsam::HybridSmoother::allFactors_
private

Definition at line 30 of file HybridSmoother.h.

◆ fixedValues_

DiscreteValues gtsam::HybridSmoother::fixedValues_
private

Definition at line 36 of file HybridSmoother.h.

◆ hybridBayesNet_

HybridBayesNet gtsam::HybridSmoother::hybridBayesNet_
private

Definition at line 33 of file HybridSmoother.h.

◆ linearizationPoint_

Values gtsam::HybridSmoother::linearizationPoint_
private

Definition at line 31 of file HybridSmoother.h.

◆ marginalThreshold_

std::optional<double> gtsam::HybridSmoother::marginalThreshold_
private

The threshold above which we make a decision about a mode.

Definition at line 35 of file HybridSmoother.h.


The documentation for this class was generated from the following files:


gtsam
Author(s):
autogenerated on Wed Mar 19 2025 03:14:50