From 1424c01fa961f728569e710cfb524f310acf2617 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Tue, 6 Aug 2013 17:09:20 +0000 Subject: [PATCH] Renamed all typedefs of specific EliminationTraits to EliminationTraitsType to avoid name problem on GCC --- gtsam/inference/BayesTree.h | 8 ++--- gtsam/inference/BayesTreeCliqueBase.h | 10 +++---- .../inference/EliminateableFactorGraph-inst.h | 6 ++-- gtsam/inference/EliminateableFactorGraph.h | 30 +++++++++---------- gtsam/inference/ISAM.h | 6 ++-- gtsam/linear/GaussianFactorGraph.h | 2 +- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/gtsam/inference/BayesTree.h b/gtsam/inference/BayesTree.h index 6defba438..0d9604082 100644 --- a/gtsam/inference/BayesTree.h +++ b/gtsam/inference/BayesTree.h @@ -63,7 +63,7 @@ namespace gtsam { typedef typename CLIQUE::FactorGraphType FactorGraphType; typedef boost::shared_ptr sharedFactorGraph; typedef typename FactorGraphType::Eliminate Eliminate; - typedef typename CLIQUE::EliminationTraits EliminationTraits; + typedef typename CLIQUE::EliminationTraitsType EliminationTraitsType; /** A convenience class for a list of shared cliques */ typedef FastList Cliques; @@ -161,19 +161,19 @@ namespace gtsam { * 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 * 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 * 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 * 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 diff --git a/gtsam/inference/BayesTreeCliqueBase.h b/gtsam/inference/BayesTreeCliqueBase.h index ef638b325..1e505f6cd 100644 --- a/gtsam/inference/BayesTreeCliqueBase.h +++ b/gtsam/inference/BayesTreeCliqueBase.h @@ -44,7 +44,7 @@ namespace gtsam { private: typedef BayesTreeCliqueBase This; typedef DERIVED DerivedType; - typedef EliminationTraits EliminationTraits; + typedef EliminationTraits EliminationTraitsType; typedef boost::shared_ptr shared_ptr; typedef boost::weak_ptr weak_ptr; typedef boost::shared_ptr derived_ptr; @@ -52,7 +52,7 @@ namespace gtsam { public: typedef FACTORGRAPH FactorGraphType; - typedef typename EliminationTraits::BayesNetType BayesNetType; + typedef typename EliminationTraitsType::BayesNetType BayesNetType; typedef typename BayesNetType::ConditionalType ConditionalType; typedef boost::shared_ptr sharedConditional; typedef typename FactorGraphType::FactorType FactorType; @@ -112,13 +112,13 @@ namespace gtsam { /// @{ /** 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 */ - 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 */ - 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. diff --git a/gtsam/inference/EliminateableFactorGraph-inst.h b/gtsam/inference/EliminateableFactorGraph-inst.h index 38b9c2205..33a5d7b47 100644 --- a/gtsam/inference/EliminateableFactorGraph-inst.h +++ b/gtsam/inference/EliminateableFactorGraph-inst.h @@ -143,7 +143,7 @@ namespace gtsam { EliminateableFactorGraph::marginalMultifrontalBayesNet( boost::variant&> variables, OptionalOrdering marginalizedVariableOrdering, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const { if(variableIndex) @@ -200,7 +200,7 @@ namespace gtsam { EliminateableFactorGraph::marginalMultifrontalBayesTree( boost::variant&> variables, OptionalOrdering marginalizedVariableOrdering, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const { if(variableIndex) @@ -256,7 +256,7 @@ namespace gtsam { boost::shared_ptr EliminateableFactorGraph::marginal( const std::vector& variables, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const { if(variableIndex) diff --git a/gtsam/inference/EliminateableFactorGraph.h b/gtsam/inference/EliminateableFactorGraph.h index 37ae6a27c..e7ef48460 100644 --- a/gtsam/inference/EliminateableFactorGraph.h +++ b/gtsam/inference/EliminateableFactorGraph.h @@ -63,22 +63,22 @@ namespace gtsam { public: /// Typedef to the specific EliminationTraits for this graph - typedef EliminationTraits EliminationTraits; + typedef EliminationTraits EliminationTraitsType; /// 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 - typedef typename EliminationTraits::BayesNetType BayesNetType; + typedef typename EliminationTraitsType::BayesNetType BayesNetType; /// 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 - typedef typename EliminationTraits::BayesTreeType BayesTreeType; + typedef typename EliminationTraitsType::BayesTreeType BayesTreeType; /// 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 /// a subgraph. @@ -115,7 +115,7 @@ namespace gtsam { * */ boost::shared_ptr eliminateSequential( OptionalOrdering ordering = boost::none, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const; /** 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 eliminateMultifrontal( OptionalOrdering ordering = boost::none, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const; /** 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 > eliminatePartialSequential( const Ordering& ordering, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const; /** 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 > eliminatePartialSequential( const std::vector& variables, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const; /** 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 > eliminatePartialMultifrontal( const Ordering& ordering, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const; /** 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 > eliminatePartialMultifrontal( const std::vector& variables, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const; /** Compute the marginal of the requested variables and return the result as a Bayes net. @@ -197,7 +197,7 @@ namespace gtsam { boost::shared_ptr marginalMultifrontalBayesNet( boost::variant&> variables, OptionalOrdering marginalizedVariableOrdering = boost::none, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const; /** Compute the marginal of the requested variables and return the result as a Bayes tree. @@ -214,13 +214,13 @@ namespace gtsam { boost::shared_ptr marginalMultifrontalBayesTree( boost::variant&> variables, OptionalOrdering marginalizedVariableOrdering = boost::none, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const; /** Compute the marginal factor graph of the requested variables. */ boost::shared_ptr marginal( const std::vector& variables, - const Eliminate& function = EliminationTraits::DefaultEliminate, + const Eliminate& function = EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex = boost::none) const; private: diff --git a/gtsam/inference/ISAM.h b/gtsam/inference/ISAM.h index e6837884b..057173e0f 100644 --- a/gtsam/inference/ISAM.h +++ b/gtsam/inference/ISAM.h @@ -34,7 +34,7 @@ namespace gtsam { typedef typename Base::FactorGraphType FactorGraphType; typedef typename Base::Cliques Cliques; typedef typename Base::Eliminate Eliminate; - typedef typename Base::EliminationTraits EliminationTraits; + typedef typename Base::EliminationTraitsType EliminationTraitsType; public: @@ -56,11 +56,11 @@ namespace gtsam { * @param newFactors is a factor graph that contains the new factors * @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 */ void update_internal(const FactorGraphType& newFactors, Cliques& orphans, - const Eliminate& function = EliminationTraits::DefaultEliminate); + const Eliminate& function = EliminationTraitsType::DefaultEliminate); /// @} diff --git a/gtsam/linear/GaussianFactorGraph.h b/gtsam/linear/GaussianFactorGraph.h index 2c8d487fe..319b407ae 100644 --- a/gtsam/linear/GaussianFactorGraph.h +++ b/gtsam/linear/GaussianFactorGraph.h @@ -209,7 +209,7 @@ namespace gtsam { * followed by back-substitution in the Bayes tree resulting from elimination. Is equivalent * to calling graph.eliminateMultifrontal()->optimize(). */ 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,