Renamed all typedefs of specific EliminationTraits to EliminationTraitsType to avoid name problem on GCC
parent
0fb15c7ec6
commit
1424c01fa9
|
|
@ -63,7 +63,7 @@ namespace gtsam {
|
||||||
typedef typename CLIQUE::FactorGraphType FactorGraphType;
|
typedef typename CLIQUE::FactorGraphType FactorGraphType;
|
||||||
typedef boost::shared_ptr<FactorGraphType> sharedFactorGraph;
|
typedef boost::shared_ptr<FactorGraphType> sharedFactorGraph;
|
||||||
typedef typename FactorGraphType::Eliminate Eliminate;
|
typedef typename FactorGraphType::Eliminate Eliminate;
|
||||||
typedef typename CLIQUE::EliminationTraits EliminationTraits;
|
typedef typename CLIQUE::EliminationTraitsType EliminationTraitsType;
|
||||||
|
|
||||||
/** A convenience class for a list of shared cliques */
|
/** A convenience class for a list of shared cliques */
|
||||||
typedef FastList<sharedClique> Cliques;
|
typedef FastList<sharedClique> Cliques;
|
||||||
|
|
@ -161,19 +161,19 @@ namespace gtsam {
|
||||||
* Alternatively, it may be directly used as its factor base class. For example, for Gaussian
|
* Alternatively, it may be directly used as its factor base class. For example, for Gaussian
|
||||||
* systems, this returns a GaussianConditional, which inherits from JacobianFactor and
|
* systems, this returns a GaussianConditional, which inherits from JacobianFactor and
|
||||||
* GaussianFactor. */
|
* GaussianFactor. */
|
||||||
sharedConditional marginalFactor(Key j, const Eliminate& function = EliminationTraits::DefaultEliminate) const;
|
sharedConditional marginalFactor(Key j, const Eliminate& function = EliminationTraitsType::DefaultEliminate) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return joint on two variables
|
* return joint on two variables
|
||||||
* Limitation: can only calculate joint if cliques are disjoint or one of them is root
|
* Limitation: can only calculate joint if cliques are disjoint or one of them is root
|
||||||
*/
|
*/
|
||||||
sharedFactorGraph joint(Index j1, Index j2, const Eliminate& function = EliminationTraits::DefaultEliminate) const;
|
sharedFactorGraph joint(Index j1, Index j2, const Eliminate& function = EliminationTraitsType::DefaultEliminate) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return joint on two variables as a BayesNet
|
* return joint on two variables as a BayesNet
|
||||||
* Limitation: can only calculate joint if cliques are disjoint or one of them is root
|
* Limitation: can only calculate joint if cliques are disjoint or one of them is root
|
||||||
*/
|
*/
|
||||||
sharedBayesNet jointBayesNet(Index j1, Index j2, const Eliminate& function = EliminationTraits::DefaultEliminate) const;
|
sharedBayesNet jointBayesNet(Index j1, Index j2, const Eliminate& function = EliminationTraitsType::DefaultEliminate) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read only with side effects
|
* Read only with side effects
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ namespace gtsam {
|
||||||
private:
|
private:
|
||||||
typedef BayesTreeCliqueBase<DERIVED, FACTORGRAPH> This;
|
typedef BayesTreeCliqueBase<DERIVED, FACTORGRAPH> This;
|
||||||
typedef DERIVED DerivedType;
|
typedef DERIVED DerivedType;
|
||||||
typedef EliminationTraits<FACTORGRAPH> EliminationTraits;
|
typedef EliminationTraits<FACTORGRAPH> EliminationTraitsType;
|
||||||
typedef boost::shared_ptr<This> shared_ptr;
|
typedef boost::shared_ptr<This> shared_ptr;
|
||||||
typedef boost::weak_ptr<This> weak_ptr;
|
typedef boost::weak_ptr<This> weak_ptr;
|
||||||
typedef boost::shared_ptr<DerivedType> derived_ptr;
|
typedef boost::shared_ptr<DerivedType> derived_ptr;
|
||||||
|
|
@ -52,7 +52,7 @@ namespace gtsam {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef FACTORGRAPH FactorGraphType;
|
typedef FACTORGRAPH FactorGraphType;
|
||||||
typedef typename EliminationTraits::BayesNetType BayesNetType;
|
typedef typename EliminationTraitsType::BayesNetType BayesNetType;
|
||||||
typedef typename BayesNetType::ConditionalType ConditionalType;
|
typedef typename BayesNetType::ConditionalType ConditionalType;
|
||||||
typedef boost::shared_ptr<ConditionalType> sharedConditional;
|
typedef boost::shared_ptr<ConditionalType> sharedConditional;
|
||||||
typedef typename FactorGraphType::FactorType FactorType;
|
typedef typename FactorGraphType::FactorType FactorType;
|
||||||
|
|
@ -112,13 +112,13 @@ namespace gtsam {
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/** return the conditional P(S|Root) on the separator given the root */
|
/** return the conditional P(S|Root) on the separator given the root */
|
||||||
BayesNetType shortcut(const derived_ptr& root, Eliminate function = EliminationTraits::DefaultEliminate) const;
|
BayesNetType shortcut(const derived_ptr& root, Eliminate function = EliminationTraitsType::DefaultEliminate) const;
|
||||||
|
|
||||||
/** return the marginal P(S) on the separator */
|
/** return the marginal P(S) on the separator */
|
||||||
FactorGraphType separatorMarginal(Eliminate function = EliminationTraits::DefaultEliminate) const;
|
FactorGraphType separatorMarginal(Eliminate function = EliminationTraitsType::DefaultEliminate) const;
|
||||||
|
|
||||||
/** return the marginal P(C) of the clique, using marginal caching */
|
/** return the marginal P(C) of the clique, using marginal caching */
|
||||||
FactorGraphType marginal2(Eliminate function = EliminationTraits::DefaultEliminate) const;
|
FactorGraphType marginal2(Eliminate function = EliminationTraitsType::DefaultEliminate) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This deletes the cached shortcuts of all cliques (subtree) below this clique.
|
* This deletes the cached shortcuts of all cliques (subtree) below this clique.
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ namespace gtsam {
|
||||||
EliminateableFactorGraph<FACTORGRAPH>::marginalMultifrontalBayesNet(
|
EliminateableFactorGraph<FACTORGRAPH>::marginalMultifrontalBayesNet(
|
||||||
boost::variant<const Ordering&, const std::vector<Key>&> variables,
|
boost::variant<const Ordering&, const std::vector<Key>&> variables,
|
||||||
OptionalOrdering marginalizedVariableOrdering,
|
OptionalOrdering marginalizedVariableOrdering,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const
|
OptionalVariableIndex variableIndex = boost::none) const
|
||||||
{
|
{
|
||||||
if(variableIndex)
|
if(variableIndex)
|
||||||
|
|
@ -200,7 +200,7 @@ namespace gtsam {
|
||||||
EliminateableFactorGraph<FACTORGRAPH>::marginalMultifrontalBayesTree(
|
EliminateableFactorGraph<FACTORGRAPH>::marginalMultifrontalBayesTree(
|
||||||
boost::variant<const Ordering&, const std::vector<Key>&> variables,
|
boost::variant<const Ordering&, const std::vector<Key>&> variables,
|
||||||
OptionalOrdering marginalizedVariableOrdering,
|
OptionalOrdering marginalizedVariableOrdering,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const
|
OptionalVariableIndex variableIndex = boost::none) const
|
||||||
{
|
{
|
||||||
if(variableIndex)
|
if(variableIndex)
|
||||||
|
|
@ -256,7 +256,7 @@ namespace gtsam {
|
||||||
boost::shared_ptr<FACTORGRAPH>
|
boost::shared_ptr<FACTORGRAPH>
|
||||||
EliminateableFactorGraph<FACTORGRAPH>::marginal(
|
EliminateableFactorGraph<FACTORGRAPH>::marginal(
|
||||||
const std::vector<Key>& variables,
|
const std::vector<Key>& variables,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const
|
OptionalVariableIndex variableIndex = boost::none) const
|
||||||
{
|
{
|
||||||
if(variableIndex)
|
if(variableIndex)
|
||||||
|
|
|
||||||
|
|
@ -63,22 +63,22 @@ namespace gtsam {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Typedef to the specific EliminationTraits for this graph
|
/// Typedef to the specific EliminationTraits for this graph
|
||||||
typedef EliminationTraits<FactorGraphType> EliminationTraits;
|
typedef EliminationTraits<FactorGraphType> EliminationTraitsType;
|
||||||
|
|
||||||
/// Conditional type stored in the Bayes net produced by elimination
|
/// Conditional type stored in the Bayes net produced by elimination
|
||||||
typedef typename EliminationTraits::ConditionalType ConditionalType;
|
typedef typename EliminationTraitsType::ConditionalType ConditionalType;
|
||||||
|
|
||||||
/// Bayes net type produced by sequential elimination
|
/// Bayes net type produced by sequential elimination
|
||||||
typedef typename EliminationTraits::BayesNetType BayesNetType;
|
typedef typename EliminationTraitsType::BayesNetType BayesNetType;
|
||||||
|
|
||||||
/// Elimination tree type that can do sequential elimination of this graph
|
/// Elimination tree type that can do sequential elimination of this graph
|
||||||
typedef typename EliminationTraits::EliminationTreeType EliminationTreeType;
|
typedef typename EliminationTraitsType::EliminationTreeType EliminationTreeType;
|
||||||
|
|
||||||
/// Bayes tree type produced by multifrontal elimination
|
/// Bayes tree type produced by multifrontal elimination
|
||||||
typedef typename EliminationTraits::BayesTreeType BayesTreeType;
|
typedef typename EliminationTraitsType::BayesTreeType BayesTreeType;
|
||||||
|
|
||||||
/// Junction tree type that can do multifrontal elimination of this graph
|
/// Junction tree type that can do multifrontal elimination of this graph
|
||||||
typedef typename EliminationTraits::JunctionTreeType JunctionTreeType;
|
typedef typename EliminationTraitsType::JunctionTreeType JunctionTreeType;
|
||||||
|
|
||||||
/// The pair of conditional and remaining factor produced by a single dense elimination step on
|
/// The pair of conditional and remaining factor produced by a single dense elimination step on
|
||||||
/// a subgraph.
|
/// a subgraph.
|
||||||
|
|
@ -115,7 +115,7 @@ namespace gtsam {
|
||||||
* */
|
* */
|
||||||
boost::shared_ptr<BayesNetType> eliminateSequential(
|
boost::shared_ptr<BayesNetType> eliminateSequential(
|
||||||
OptionalOrdering ordering = boost::none,
|
OptionalOrdering ordering = boost::none,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const;
|
OptionalVariableIndex variableIndex = boost::none) const;
|
||||||
|
|
||||||
/** Do multifrontal elimination of all variables to produce a Bayes tree. If an ordering is not
|
/** Do multifrontal elimination of all variables to produce a Bayes tree. If an ordering is not
|
||||||
|
|
@ -140,7 +140,7 @@ namespace gtsam {
|
||||||
* */
|
* */
|
||||||
boost::shared_ptr<BayesTreeType> eliminateMultifrontal(
|
boost::shared_ptr<BayesTreeType> eliminateMultifrontal(
|
||||||
OptionalOrdering ordering = boost::none,
|
OptionalOrdering ordering = boost::none,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const;
|
OptionalVariableIndex variableIndex = boost::none) const;
|
||||||
|
|
||||||
/** Do sequential elimination of some variables in the given \c ordering to produce a Bayes net
|
/** Do sequential elimination of some variables in the given \c ordering to produce a Bayes net
|
||||||
|
|
@ -150,7 +150,7 @@ namespace gtsam {
|
||||||
std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
|
std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
|
||||||
eliminatePartialSequential(
|
eliminatePartialSequential(
|
||||||
const Ordering& ordering,
|
const Ordering& ordering,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const;
|
OptionalVariableIndex variableIndex = boost::none) const;
|
||||||
|
|
||||||
/** Do sequential elimination of the given \c variables in an ordering computed by COLAMD to
|
/** Do sequential elimination of the given \c variables in an ordering computed by COLAMD to
|
||||||
|
|
@ -160,7 +160,7 @@ namespace gtsam {
|
||||||
std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
|
std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
|
||||||
eliminatePartialSequential(
|
eliminatePartialSequential(
|
||||||
const std::vector<Key>& variables,
|
const std::vector<Key>& variables,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const;
|
OptionalVariableIndex variableIndex = boost::none) const;
|
||||||
|
|
||||||
/** Do multifrontal elimination of the given \c variables in an ordering computed by COLAMD to
|
/** Do multifrontal elimination of the given \c variables in an ordering computed by COLAMD to
|
||||||
|
|
@ -170,7 +170,7 @@ namespace gtsam {
|
||||||
std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
|
std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
|
||||||
eliminatePartialMultifrontal(
|
eliminatePartialMultifrontal(
|
||||||
const Ordering& ordering,
|
const Ordering& ordering,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const;
|
OptionalVariableIndex variableIndex = boost::none) const;
|
||||||
|
|
||||||
/** Do multifrontal elimination of some variables in the given \c ordering to produce a Bayes
|
/** Do multifrontal elimination of some variables in the given \c ordering to produce a Bayes
|
||||||
|
|
@ -180,7 +180,7 @@ namespace gtsam {
|
||||||
std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
|
std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
|
||||||
eliminatePartialMultifrontal(
|
eliminatePartialMultifrontal(
|
||||||
const std::vector<Key>& variables,
|
const std::vector<Key>& variables,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const;
|
OptionalVariableIndex variableIndex = boost::none) const;
|
||||||
|
|
||||||
/** Compute the marginal of the requested variables and return the result as a Bayes net.
|
/** Compute the marginal of the requested variables and return the result as a Bayes net.
|
||||||
|
|
@ -197,7 +197,7 @@ namespace gtsam {
|
||||||
boost::shared_ptr<BayesNetType> marginalMultifrontalBayesNet(
|
boost::shared_ptr<BayesNetType> marginalMultifrontalBayesNet(
|
||||||
boost::variant<const Ordering&, const std::vector<Key>&> variables,
|
boost::variant<const Ordering&, const std::vector<Key>&> variables,
|
||||||
OptionalOrdering marginalizedVariableOrdering = boost::none,
|
OptionalOrdering marginalizedVariableOrdering = boost::none,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const;
|
OptionalVariableIndex variableIndex = boost::none) const;
|
||||||
|
|
||||||
/** Compute the marginal of the requested variables and return the result as a Bayes tree.
|
/** Compute the marginal of the requested variables and return the result as a Bayes tree.
|
||||||
|
|
@ -214,13 +214,13 @@ namespace gtsam {
|
||||||
boost::shared_ptr<BayesTreeType> marginalMultifrontalBayesTree(
|
boost::shared_ptr<BayesTreeType> marginalMultifrontalBayesTree(
|
||||||
boost::variant<const Ordering&, const std::vector<Key>&> variables,
|
boost::variant<const Ordering&, const std::vector<Key>&> variables,
|
||||||
OptionalOrdering marginalizedVariableOrdering = boost::none,
|
OptionalOrdering marginalizedVariableOrdering = boost::none,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const;
|
OptionalVariableIndex variableIndex = boost::none) const;
|
||||||
|
|
||||||
/** Compute the marginal factor graph of the requested variables. */
|
/** Compute the marginal factor graph of the requested variables. */
|
||||||
boost::shared_ptr<FactorGraphType> marginal(
|
boost::shared_ptr<FactorGraphType> marginal(
|
||||||
const std::vector<Key>& variables,
|
const std::vector<Key>& variables,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
OptionalVariableIndex variableIndex = boost::none) const;
|
OptionalVariableIndex variableIndex = boost::none) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace gtsam {
|
||||||
typedef typename Base::FactorGraphType FactorGraphType;
|
typedef typename Base::FactorGraphType FactorGraphType;
|
||||||
typedef typename Base::Cliques Cliques;
|
typedef typename Base::Cliques Cliques;
|
||||||
typedef typename Base::Eliminate Eliminate;
|
typedef typename Base::Eliminate Eliminate;
|
||||||
typedef typename Base::EliminationTraits EliminationTraits;
|
typedef typename Base::EliminationTraitsType EliminationTraitsType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -56,11 +56,11 @@ namespace gtsam {
|
||||||
* @param newFactors is a factor graph that contains the new factors
|
* @param newFactors is a factor graph that contains the new factors
|
||||||
* @param function an elimination routine
|
* @param function an elimination routine
|
||||||
*/
|
*/
|
||||||
void update(const FactorGraphType& newFactors, const Eliminate& function = EliminationTraits::DefaultEliminate);
|
void update(const FactorGraphType& newFactors, const Eliminate& function = EliminationTraitsType::DefaultEliminate);
|
||||||
|
|
||||||
/** update_internal provides access to list of orphans for drawing purposes */
|
/** update_internal provides access to list of orphans for drawing purposes */
|
||||||
void update_internal(const FactorGraphType& newFactors, Cliques& orphans,
|
void update_internal(const FactorGraphType& newFactors, Cliques& orphans,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate);
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ namespace gtsam {
|
||||||
* followed by back-substitution in the Bayes tree resulting from elimination. Is equivalent
|
* followed by back-substitution in the Bayes tree resulting from elimination. Is equivalent
|
||||||
* to calling graph.eliminateMultifrontal()->optimize(). */
|
* to calling graph.eliminateMultifrontal()->optimize(). */
|
||||||
VectorValues optimize(OptionalOrdering ordering = boost::none,
|
VectorValues optimize(OptionalOrdering ordering = boost::none,
|
||||||
const Eliminate& function = EliminationTraits::DefaultEliminate) const;
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute the gradient of the energy function,
|
* Compute the gradient of the energy function,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue