diff --git a/gtsam/inference/EliminationTree.h b/gtsam/inference/EliminationTree.h index 0848a4b53..e56da35ce 100644 --- a/gtsam/inference/EliminationTree.h +++ b/gtsam/inference/EliminationTree.h @@ -40,13 +40,13 @@ public: typedef typename FACTOR::shared_ptr sharedFactor; typedef boost::shared_ptr > shared_ptr; - typedef gtsam::BayesNet BayesNet; + typedef gtsam::BayesNet BayesNet; private: typedef FastList Factors; typedef FastList SubTrees; - typedef std::vector Conditionals; + typedef std::vector Conditionals; Index key_; /** index associated with root */ Factors factors_; /** factors associated with root */ diff --git a/gtsam/inference/FactorBase-inl.h b/gtsam/inference/FactorBase-inl.h index 5d61190ae..16587b6eb 100644 --- a/gtsam/inference/FactorBase-inl.h +++ b/gtsam/inference/FactorBase-inl.h @@ -35,7 +35,7 @@ FactorBase::FactorBase(const FactorBase& f) : keys_(f.keys_) {} /* ************************************************************************* */ template -FactorBase::FactorBase(const Conditional& c) : keys_(c.keys()) {} +FactorBase::FactorBase(const ConditionalType& c) : keys_(c.keys()) {} /* ************************************************************************* */ template diff --git a/gtsam/inference/FactorBase.h b/gtsam/inference/FactorBase.h index 6d1ace326..64a191900 100644 --- a/gtsam/inference/FactorBase.h +++ b/gtsam/inference/FactorBase.h @@ -44,7 +44,7 @@ template class ConditionalBase; * todo: Make NonlinearFactor derive from this too, which requires moving * Combine, eliminate*, permute* and the sorted key invariant to IndexFactor. * - * Note that derived classes *must* redefine the Conditional and shared_ptr + * Note that derived classes *must* redefine the ConditionalType and shared_ptr * typedefs to refer to the associated conditional and shared_ptr types of the * derived class. See IndexFactor, JacobianFactor, etc. for examples. */ @@ -60,7 +60,7 @@ public: * Typedef to the conditional type obtained by eliminating this factor. * Derived classes must redefine this. */ - typedef gtsam::ConditionalBase Conditional; + typedef gtsam::ConditionalBase ConditionalType; /** A shared_ptr to this class. Derived classes must redefine this. */ typedef boost::shared_ptr shared_ptr; @@ -86,7 +86,7 @@ public: FactorBase(const This& f); /** Construct from derived type */ - FactorBase(const Conditional& c); + FactorBase(const ConditionalType& c); /** Constructor from a collection of keys */ template FactorBase(KEYITERATOR beginKey, KEYITERATOR endKey) : diff --git a/gtsam/inference/GenericSequentialSolver-inl.h b/gtsam/inference/GenericSequentialSolver-inl.h index 0d26d6a6b..e885f39de 100644 --- a/gtsam/inference/GenericSequentialSolver-inl.h +++ b/gtsam/inference/GenericSequentialSolver-inl.h @@ -52,7 +52,7 @@ void GenericSequentialSolver::replaceFactors(const typename FactorGraph< /* ************************************************************************* */ template -typename BayesNet::shared_ptr GenericSequentialSolver::eliminate() const { +typename BayesNet::shared_ptr GenericSequentialSolver::eliminate() const { return eliminationTree_->eliminate(); } @@ -73,7 +73,7 @@ typename FactorGraph::shared_ptr GenericSequentialSolver::jointF } // Eliminate all variables - typename BayesNet::shared_ptr bayesNet( + typename BayesNet::shared_ptr bayesNet( EliminationTree::Create(*factors_)->eliminate()); // Undo the permuation on the original factors and on the structure. @@ -85,7 +85,7 @@ typename FactorGraph::shared_ptr GenericSequentialSolver::jointF // Take the joint marginal from the Bayes net. typename FactorGraph::shared_ptr joint(new FactorGraph); joint->reserve(js.size()); - typename BayesNet::const_reverse_iterator conditional = bayesNet->rbegin(); + typename BayesNet::const_reverse_iterator conditional = bayesNet->rbegin(); for(size_t i = 0; i < js.size(); ++i) { joint->push_back((*(conditional++))->toFactor()); } diff --git a/gtsam/inference/GenericSequentialSolver.h b/gtsam/inference/GenericSequentialSolver.h index 5f2fbc9a3..fda17197d 100644 --- a/gtsam/inference/GenericSequentialSolver.h +++ b/gtsam/inference/GenericSequentialSolver.h @@ -66,7 +66,7 @@ public: * Eliminate the factor graph sequentially. Uses a column elimination tree * to recursively eliminate. */ - typename BayesNet::shared_ptr eliminate() const; + typename BayesNet::shared_ptr eliminate() const; /** * Compute the marginal joint over a set of variables, by integrating out diff --git a/gtsam/inference/IndexFactor.cpp b/gtsam/inference/IndexFactor.cpp index 1f5f193ef..41d4773a5 100644 --- a/gtsam/inference/IndexFactor.cpp +++ b/gtsam/inference/IndexFactor.cpp @@ -41,7 +41,7 @@ pair::shared_ptr, IndexFactor::shared_ptr> IndexFacto if(variables.size() < 1) throw invalid_argument("IndexFactor::CombineAndEliminate called on factors with zero total variables."); - pair::shared_ptr, shared_ptr> result; + pair::shared_ptr, shared_ptr> result; result.first.reset(new BayesNet()); FastSet::const_iterator var; for(var = variables.begin(); result.first->size() < nrFrontals; ++var) diff --git a/gtsam/inference/IndexFactor.h b/gtsam/inference/IndexFactor.h index 2f2c7edff..166c93416 100644 --- a/gtsam/inference/IndexFactor.h +++ b/gtsam/inference/IndexFactor.h @@ -47,7 +47,7 @@ namespace gtsam { typedef FactorBase Base; /** Elimination produces an IndexConditional */ - typedef IndexConditional Conditional; + typedef IndexConditional ConditionalType; /** Overriding the shared_ptr typedef */ typedef boost::shared_ptr shared_ptr; @@ -83,7 +83,7 @@ namespace gtsam { /** * Combine and eliminate several factors. */ - static std::pair::shared_ptr, shared_ptr> CombineAndEliminate( + static std::pair::shared_ptr, shared_ptr> CombineAndEliminate( const FactorGraph& factors, size_t nrFrontals=1); /** Create a combined joint factor (new style for EliminationTree). */ @@ -94,12 +94,12 @@ namespace gtsam { * eliminate the first variable involved in this factor * @return a conditional on the eliminated variable */ - boost::shared_ptr eliminateFirst(); + boost::shared_ptr eliminateFirst(); /** * eliminate the first nrFrontals frontal variables. */ - boost::shared_ptr > eliminate(size_t nrFrontals = 1); + boost::shared_ptr > eliminate(size_t nrFrontals = 1); }; diff --git a/gtsam/inference/JunctionTree-inl.h b/gtsam/inference/JunctionTree-inl.h index 34c30b5ff..e155862db 100644 --- a/gtsam/inference/JunctionTree-inl.h +++ b/gtsam/inference/JunctionTree-inl.h @@ -171,7 +171,7 @@ namespace gtsam { // Now that we know which factors and variables, and where variables // come from and go to, create and eliminate the new joint factor. tic(2, "CombineAndEliminate"); - pair::shared_ptr, typename FG::sharedFactor> eliminated( + pair::shared_ptr, typename FG::sharedFactor> eliminated( FG::FactorType::CombineAndEliminate(fg, current->frontal.size())); toc(2, "CombineAndEliminate"); diff --git a/gtsam/inference/JunctionTree.h b/gtsam/inference/JunctionTree.h index 97ec12430..fb5b1704b 100644 --- a/gtsam/inference/JunctionTree.h +++ b/gtsam/inference/JunctionTree.h @@ -46,7 +46,7 @@ namespace gtsam { typedef typename ClusterTree::Cluster Clique; typedef typename Clique::shared_ptr sharedClique; - typedef class BayesTree BayesTree; + typedef class BayesTree BayesTree; typedef boost::shared_ptr > shared_ptr; diff --git a/gtsam/linear/GaussianFactor.h b/gtsam/linear/GaussianFactor.h index 8aef1cd0a..436940d0c 100644 --- a/gtsam/linear/GaussianFactor.h +++ b/gtsam/linear/GaussianFactor.h @@ -74,7 +74,7 @@ namespace gtsam { enum SolveMethod { SOLVE_QR, SOLVE_PREFER_CHOLESKY }; - typedef GaussianConditional Conditional; + typedef GaussianConditional ConditionalType; typedef boost::shared_ptr shared_ptr; // Implementing Testable interface diff --git a/gtsam/linear/HessianFactor.cpp b/gtsam/linear/HessianFactor.cpp index 6c4aaf031..0c1327bf1 100644 --- a/gtsam/linear/HessianFactor.cpp +++ b/gtsam/linear/HessianFactor.cpp @@ -462,7 +462,7 @@ GaussianBayesNet::shared_ptr HessianFactor::splitEliminatedFactor(size_t nrFront tic(2, "construct cond"); const ublas::scalar_vector sigmas(varDim, 1.0); - conditionals->push_back(boost::make_shared(keys.begin()+j, keys.end(), 1, Ab, sigmas)); + conditionals->push_back(boost::make_shared(keys.begin()+j, keys.end(), 1, Ab, sigmas)); toc(2, "construct cond"); if(debug) conditionals->back()->print("Extracted conditional: "); Ab.rowStart() += varDim; diff --git a/gtsam/linear/JacobianFactor.cpp b/gtsam/linear/JacobianFactor.cpp index 0c66ace99..1f67e588c 100644 --- a/gtsam/linear/JacobianFactor.cpp +++ b/gtsam/linear/JacobianFactor.cpp @@ -449,7 +449,7 @@ namespace gtsam { size_t varDim = Ab_(0).size2(); Ab_.rowEnd() = Ab_.rowStart() + varDim; const ublas::vector_range sigmas(noiseModel->sigmas(), ublas::range(Ab_.rowStart(), Ab_.rowEnd())); - conditionals->push_back(boost::make_shared(keys_.begin()+j, keys_.end(), 1, Ab_, sigmas)); + conditionals->push_back(boost::make_shared(keys_.begin()+j, keys_.end(), 1, Ab_, sigmas)); if(debug) conditionals->back()->print("Extracted conditional: "); Ab_.rowStart() += varDim; Ab_.firstBlock() += 1;