#include <EliminateableFactorGraph.h>
Public Types | |
typedef EliminationTraitsType::BayesNetType | BayesNetType |
Bayes net type produced by sequential elimination. More... | |
typedef EliminationTraitsType::BayesTreeType | BayesTreeType |
Bayes tree type produced by multifrontal elimination. More... | |
typedef EliminationTraitsType::ConditionalType | ConditionalType |
Conditional type stored in the Bayes net produced by elimination. More... | |
typedef std::function< EliminationResult(const FactorGraphType &, const Ordering &)> | Eliminate |
The function type that does a single dense elimination step on a subgraph. More... | |
typedef std::pair< std::shared_ptr< ConditionalType >, std::shared_ptr< _FactorType > > | EliminationResult |
typedef EliminationTraits< FactorGraphType > | EliminationTraitsType |
Typedef to the specific EliminationTraits for this graph. More... | |
typedef EliminationTraitsType::EliminationTreeType | EliminationTreeType |
Elimination tree type that can do sequential elimination of this graph. More... | |
typedef EliminationTraitsType::JunctionTreeType | JunctionTreeType |
Junction tree type that can do multifrontal elimination of this graph. More... | |
typedef std::optional< Ordering::OrderingType > | OptionalOrderingType |
Typedef for an optional ordering type. More... | |
typedef std::optional< std::reference_wrapper< const VariableIndex > > | OptionalVariableIndex |
Public Member Functions | |
std::shared_ptr< BayesTreeType > | eliminateMultifrontal (OptionalOrderingType orderingType={}, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesTreeType > | eliminateMultifrontal (const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::pair< std::shared_ptr< BayesTreeType >, std::shared_ptr< FactorGraphType > > | eliminatePartialMultifrontal (const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::pair< std::shared_ptr< BayesTreeType >, std::shared_ptr< FactorGraphType > > | eliminatePartialMultifrontal (const KeyVector &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::pair< std::shared_ptr< BayesNetType >, std::shared_ptr< FactorGraphType > > | eliminatePartialSequential (const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::pair< std::shared_ptr< BayesNetType >, std::shared_ptr< FactorGraphType > > | eliminatePartialSequential (const KeyVector &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesNetType > | eliminateSequential (OptionalOrderingType orderingType={}, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesNetType > | eliminateSequential (const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< FactorGraphType > | marginal (const KeyVector &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesNetType > | marginalMultifrontalBayesNet (const Ordering &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesNetType > | marginalMultifrontalBayesNet (const KeyVector &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesNetType > | marginalMultifrontalBayesNet (const Ordering &variables, const Ordering &marginalizedVariableOrdering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesNetType > | marginalMultifrontalBayesNet (const KeyVector &variables, const Ordering &marginalizedVariableOrdering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesTreeType > | marginalMultifrontalBayesTree (const Ordering &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesTreeType > | marginalMultifrontalBayesTree (const KeyVector &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesTreeType > | marginalMultifrontalBayesTree (const Ordering &variables, const Ordering &marginalizedVariableOrdering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
std::shared_ptr< BayesTreeType > | marginalMultifrontalBayesTree (const KeyVector &variables, const Ordering &marginalizedVariableOrdering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const |
Private Types | |
typedef EliminationTraits< FactorGraphType >::FactorType | _FactorType |
typedef FACTORGRAPH | FactorGraphType |
Typedef to factor graph type. More... | |
typedef EliminateableFactorGraph< FACTORGRAPH > | This |
Typedef to this class. More... | |
Private Member Functions | |
const FactorGraphType & | asDerived () const |
FactorGraphType & | asDerived () |
EliminateableFactorGraph is a base class for factor graphs that contains elimination algorithms. Any factor graph holding eliminateable factors can derive from this class to expose functions for computing marginals, conditional marginals, doing multifrontal and sequential elimination, etc.
Definition at line 55 of file EliminateableFactorGraph.h.
|
private |
Definition at line 62 of file EliminateableFactorGraph.h.
typedef EliminationTraitsType::BayesNetType gtsam::EliminateableFactorGraph< FACTORGRAPH >::BayesNetType |
Bayes net type produced by sequential elimination.
Definition at line 72 of file EliminateableFactorGraph.h.
typedef EliminationTraitsType::BayesTreeType gtsam::EliminateableFactorGraph< FACTORGRAPH >::BayesTreeType |
Bayes tree type produced by multifrontal elimination.
Definition at line 78 of file EliminateableFactorGraph.h.
typedef EliminationTraitsType::ConditionalType gtsam::EliminateableFactorGraph< FACTORGRAPH >::ConditionalType |
Conditional type stored in the Bayes net produced by elimination.
Definition at line 69 of file EliminateableFactorGraph.h.
typedef std::function<EliminationResult(const FactorGraphType&, const Ordering&)> gtsam::EliminateableFactorGraph< FACTORGRAPH >::Eliminate |
The function type that does a single dense elimination step on a subgraph.
Definition at line 88 of file EliminateableFactorGraph.h.
typedef std::pair<std::shared_ptr<ConditionalType>, std::shared_ptr<_FactorType> > gtsam::EliminateableFactorGraph< FACTORGRAPH >::EliminationResult |
The pair of conditional and remaining factor produced by a single dense elimination step on a subgraph.
Definition at line 85 of file EliminateableFactorGraph.h.
typedef EliminationTraits<FactorGraphType> gtsam::EliminateableFactorGraph< FACTORGRAPH >::EliminationTraitsType |
Typedef to the specific EliminationTraits for this graph.
Definition at line 66 of file EliminateableFactorGraph.h.
typedef EliminationTraitsType::EliminationTreeType gtsam::EliminateableFactorGraph< FACTORGRAPH >::EliminationTreeType |
Elimination tree type that can do sequential elimination of this graph.
Definition at line 75 of file EliminateableFactorGraph.h.
|
private |
Typedef to factor graph type.
Definition at line 59 of file EliminateableFactorGraph.h.
typedef EliminationTraitsType::JunctionTreeType gtsam::EliminateableFactorGraph< FACTORGRAPH >::JunctionTreeType |
Junction tree type that can do multifrontal elimination of this graph.
Definition at line 81 of file EliminateableFactorGraph.h.
typedef std::optional<Ordering::OrderingType> gtsam::EliminateableFactorGraph< FACTORGRAPH >::OptionalOrderingType |
Typedef for an optional ordering type.
Definition at line 95 of file EliminateableFactorGraph.h.
typedef std::optional<std::reference_wrapper<const VariableIndex> > gtsam::EliminateableFactorGraph< FACTORGRAPH >::OptionalVariableIndex |
Typedef for an optional variable index as an argument to elimination functions It is an optional to a constant reference
Definition at line 92 of file EliminateableFactorGraph.h.
|
private |
Typedef to this class.
Definition at line 58 of file EliminateableFactorGraph.h.
|
inlineprivate |
Definition at line 333 of file EliminateableFactorGraph.h.
|
inlineprivate |
Definition at line 336 of file EliminateableFactorGraph.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesTreeType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::eliminateMultifrontal | ( | OptionalOrderingType | orderingType = {} , |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Do multifrontal elimination of all variables to produce a Bayes tree. If an ordering is not provided, the ordering will be computed using either COLAMD or METIS, depending on the parameter orderingType (Ordering::COLAMD or Ordering::METIS)
Example - Full Cholesky elimination in COLAMD order:
Example - Reusing an existing VariableIndex to improve performance, and using COLAMD ordering:
Definition at line 88 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesTreeType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::eliminateMultifrontal | ( | const Ordering & | ordering, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Do multifrontal elimination of all variables to produce a Bayes tree. If an ordering is not provided, the ordering will be computed using either COLAMD or METIS, depending on the parameter orderingType (Ordering::COLAMD or Ordering::METIS)
Example - Full QR elimination in specified order:
Definition at line 124 of file EliminateableFactorGraph-inst.h.
std::pair< std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesTreeType >, std::shared_ptr< FACTORGRAPH > > gtsam::EliminateableFactorGraph< FACTORGRAPH >::eliminatePartialMultifrontal | ( | const Ordering & | ordering, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Do multifrontal elimination of some variables, in ordering
provided, to produce a Bayes tree and a remaining factor graph. This computes the factorization , where variables
, is all the variables in the factor graph, and .
Definition at line 188 of file EliminateableFactorGraph-inst.h.
std::pair< std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesTreeType >, std::shared_ptr< FACTORGRAPH > > gtsam::EliminateableFactorGraph< FACTORGRAPH >::eliminatePartialMultifrontal | ( | const KeyVector & | variables, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Do multifrontal elimination of the given variables
in an ordering computed by COLAMD to produce a Bayes tree and a remaining factor graph. This computes the factorization , where variables
, is all the variables in the factor graph, and .
Definition at line 207 of file EliminateableFactorGraph-inst.h.
std::pair< std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesNetType >, std::shared_ptr< FACTORGRAPH > > gtsam::EliminateableFactorGraph< FACTORGRAPH >::eliminatePartialSequential | ( | const Ordering & | ordering, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Do sequential elimination of some variables, in ordering
provided, to produce a Bayes net and a remaining factor graph. This computes the factorization , where variables
, is all the variables in the factor graph, and .
Definition at line 149 of file EliminateableFactorGraph-inst.h.
std::pair< std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesNetType >, std::shared_ptr< FACTORGRAPH > > gtsam::EliminateableFactorGraph< FACTORGRAPH >::eliminatePartialSequential | ( | const KeyVector & | variables, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Do sequential elimination of the given variables
in an ordering computed by COLAMD to produce a Bayes net and a remaining factor graph. This computes the factorization , where variables
, is all the variables in the factor graph, and .
Definition at line 167 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesNetType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::eliminateSequential | ( | OptionalOrderingType | orderingType = {} , |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Do sequential elimination of all variables to produce a Bayes net. If an ordering is not provided, the ordering provided by COLAMD will be used.
Example - Full Cholesky elimination in COLAMD order:
Example - METIS ordering for elimination
Example - Reusing an existing VariableIndex to improve performance, and using COLAMD ordering:
Definition at line 29 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesNetType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::eliminateSequential | ( | const Ordering & | ordering, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Do sequential elimination of all variables to produce a Bayes net.
Example - Full QR elimination in specified order:
Example - Reusing an existing VariableIndex to improve performance:
Definition at line 63 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< FACTORGRAPH > gtsam::EliminateableFactorGraph< FACTORGRAPH >::marginal | ( | const KeyVector & | variables, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Compute the marginal factor graph of the requested variables.
Definition at line 438 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesNetType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::marginalMultifrontalBayesNet | ( | const Ordering & | variables, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Compute the marginal of the requested variables and return the result as a Bayes net. Uses COLAMD marginalization ordering by default
variables | Determines the ordered variables whose marginal to compute, will be ordered in the returned BayesNet as specified. |
function | Optional dense elimination function. |
variableIndex | Optional pre-computed VariableIndex for the factor graph, if not provided one will be computed. |
Definition at line 228 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesNetType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::marginalMultifrontalBayesNet | ( | const KeyVector & | variables, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Compute the marginal of the requested variables and return the result as a Bayes net. Uses COLAMD marginalization ordering by default
variables | Determines the variables whose marginal to compute, will be ordered using COLAMD; use Ordering(variables) to specify the variable ordering. |
function | Optional dense elimination function. |
variableIndex | Optional pre-computed VariableIndex for the factor graph, if not provided one will be computed. |
Definition at line 256 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesNetType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::marginalMultifrontalBayesNet | ( | const Ordering & | variables, |
const Ordering & | marginalizedVariableOrdering, | ||
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Compute the marginal of the requested variables and return the result as a Bayes net.
variables | Determines the ordered variables whose marginal to compute, will be ordered in the returned BayesNet as specified. |
marginalizedVariableOrdering | Ordering for the variables being marginalized out, i.e. all variables not in variables . |
function | Optional dense elimination function. |
variableIndex | Optional pre-computed VariableIndex for the factor graph, if not provided one will be computed. |
Definition at line 284 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesNetType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::marginalMultifrontalBayesNet | ( | const KeyVector & | variables, |
const Ordering & | marginalizedVariableOrdering, | ||
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Compute the marginal of the requested variables and return the result as a Bayes net.
variables | Determines the variables whose marginal to compute, will be ordered using COLAMD; use Ordering(variables) to specify the variable ordering. |
marginalizedVariableOrdering | Ordering for the variables being marginalized out, i.e. all variables not in variables . |
function | Optional dense elimination function. |
variableIndex | Optional pre-computed VariableIndex for the factor graph, if not provided one will be computed. |
Definition at line 309 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesTreeType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::marginalMultifrontalBayesTree | ( | const Ordering & | variables, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Compute the marginal of the requested variables and return the result as a Bayes tree. Uses COLAMD marginalization order by default
variables | Determines the ordered variables whose marginal to compute, will be ordered in the returned BayesNet as specified. |
function | Optional dense elimination function.. |
variableIndex | Optional pre-computed VariableIndex for the factor graph, if not provided one will be computed. |
Definition at line 333 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesTreeType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::marginalMultifrontalBayesTree | ( | const KeyVector & | variables, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Compute the marginal of the requested variables and return the result as a Bayes tree. Uses COLAMD marginalization order by default
variables | Determines the variables whose marginal to compute, will be ordered using COLAMD; use Ordering(variables) to specify the variable ordering. |
function | Optional dense elimination function.. |
variableIndex | Optional pre-computed VariableIndex for the factor graph, if not provided one will be computed. |
Definition at line 361 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesTreeType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::marginalMultifrontalBayesTree | ( | const Ordering & | variables, |
const Ordering & | marginalizedVariableOrdering, | ||
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Compute the marginal of the requested variables and return the result as a Bayes tree.
variables | Determines the ordered variables whose marginal to compute, will be ordered in the returned BayesNet as specified. |
marginalizedVariableOrdering | Ordering for the variables being marginalized out, i.e. all variables not in variables . |
function | Optional dense elimination function.. |
variableIndex | Optional pre-computed VariableIndex for the factor graph, if not provided one will be computed. |
Definition at line 389 of file EliminateableFactorGraph-inst.h.
std::shared_ptr< typename EliminateableFactorGraph< FACTORGRAPH >::BayesTreeType > gtsam::EliminateableFactorGraph< FACTORGRAPH >::marginalMultifrontalBayesTree | ( | const KeyVector & | variables, |
const Ordering & | marginalizedVariableOrdering, | ||
const Eliminate & | function = EliminationTraitsType::DefaultEliminate , |
||
OptionalVariableIndex | variableIndex = {} |
||
) | const |
Compute the marginal of the requested variables and return the result as a Bayes tree.
variables | Determines the variables whose marginal to compute, will be ordered using COLAMD; use Ordering(variables) to specify the variable ordering. |
marginalizedVariableOrdering | Ordering for the variables being marginalized out, i.e. all variables not in variables . |
function | Optional dense elimination function.. |
variableIndex | Optional pre-computed VariableIndex for the factor graph, if not provided one will be computed. |
Definition at line 414 of file EliminateableFactorGraph-inst.h.