gtsam
Loading...
Searching...
No Matches
gtsam::HybridSmoother Class Reference

Public Member Functions

 HybridSmoother (const std::optional< double > marginalThreshold={})
 Constructor.
const DiscreteValues & fixedValues () const
 Return fixed values:
void reInitialize (HybridBayesNet &&hybridBayesNet)
 Re-initialize the smoother from a new hybrid Bayes Net.
void reInitialize (HybridBayesNet &hybridBayesNet)
 Re-initialize the smoother from a new hybrid Bayes Net (non rvalue version).
void update (const HybridNonlinearFactorGraph &graph, const Values &initial, std::optional< size_t > maxNrLeaves={}, const std::optional< Ordering > givenOrdering={})
 Given new factors, perform an incremental update.
Ordering getOrdering (const HybridGaussianFactorGraph &factors, const KeySet &newFactorKeys)
 Get an elimination ordering which eliminates continuous and then discrete.
std::pair< HybridGaussianFactorGraph, HybridBayesNet > addConditionals (const HybridGaussianFactorGraph &graph, const HybridBayesNet &hybridBayesNet) const
 Add conditionals from previous timestep as part of liquefication.
HybridGaussianConditional::shared_ptr gaussianMixture (size_t index) const
 Get the hybrid Gaussian conditional from the Bayes Net posterior at index.
const HybridBayesNet & hybridBayesNet () const
 Return the Bayes Net posterior.
HybridValues optimize () const
 Optimize the hybrid Bayes Net, taking into accound fixed values.
void relinearize (const std::optional< Ordering > givenOrdering={})
 Relinearize the nonlinear factor graph with the latest stored linearization point.
Values linearizationPoint () const
 Return the current linearization point.
HybridNonlinearFactorGraph allFactors () const
 Return all the recorded nonlinear factors.
double error (const HybridValues &x) const
 Compute the linear error using the underlying solver for the explicitly provided discrete assignment.
double error (const VectorValues &x) const
 Compute the linear error using the underlying solver.

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.

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>

◆ error() [1/2]

double gtsam::HybridSmoother::error ( const HybridValues & x) const

Compute the linear error using the underlying solver for the explicitly provided discrete assignment.

Parameters
xThe vector and discrete values to compute the error for.
Returns
double The error value.

◆ error() [2/2]

double gtsam::HybridSmoother::error ( const VectorValues & x) const

Compute the linear error using the underlying solver.

The error is computed using the computed Most-Probable Explanation (MPE) of the discrete variables.

Parameters
xThe vector values to compute the error for.
Returns
double The error value.

◆ 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

◆ 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

◆ relinearize()

void gtsam::HybridSmoother::relinearize ( const std::optional< Ordering > givenOrdering = {})

Relinearize the nonlinear factor graph with the latest stored linearization point.

Parameters
givenOrderingAn optional elimination ordering.

◆ 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


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