diff --git a/gtsam/nonlinear/GaussianISAM2.cpp b/gtsam/nonlinear/GaussianISAM2.cpp index 72d567067..ada2f82f6 100644 --- a/gtsam/nonlinear/GaussianISAM2.cpp +++ b/gtsam/nonlinear/GaussianISAM2.cpp @@ -15,7 +15,7 @@ using namespace gtsam; namespace gtsam { /* ************************************************************************* */ -void optimize2(const typename BayesTree::sharedClique& clique, double threshold, +void optimize2(const BayesTree::sharedClique& clique, double threshold, vector& changed, const vector& replaced, Permuted& delta, int& count) { // if none of the variables in this clique (frontal and separator!) changed // significantly, then by the running intersection property, none of the @@ -85,7 +85,7 @@ void optimize2(const typename BayesTree::sharedClique& cliq } // Recurse to children - BOOST_FOREACH(const typename BayesTree::sharedClique& child, clique->children_) { + BOOST_FOREACH(const BayesTree::sharedClique& child, clique->children_) { optimize2(child, threshold, changed, replaced, delta, count); } } @@ -93,14 +93,14 @@ void optimize2(const typename BayesTree::sharedClique& cliq /* ************************************************************************* */ // fast full version without threshold -void optimize2(const typename BayesTree::sharedClique& clique, VectorValues& delta) { +void optimize2(const BayesTree::sharedClique& clique, VectorValues& delta) { // parents are assumed to already be solved and available in result (*clique)->rhs(delta); (*clique)->solveInPlace(delta); // Solve chilren recursively - BOOST_FOREACH(const typename BayesTree::sharedClique& child, clique->children_) { + BOOST_FOREACH(const BayesTree::sharedClique& child, clique->children_) { optimize2(child, delta); } } @@ -115,7 +115,7 @@ void optimize2(const typename BayesTree::sharedClique& cliq //} /* ************************************************************************* */ -int optimize2(const typename BayesTree::sharedClique& root, double threshold, const vector& keys, Permuted& delta) { +int optimize2(const BayesTree::sharedClique& root, double threshold, const vector& keys, Permuted& delta) { vector changed(keys.size(), false); int count = 0; // starting from the root, call optimize on each conditional @@ -124,18 +124,18 @@ int optimize2(const typename BayesTree::sharedClique& root, } /* ************************************************************************* */ -void nnz_internal(const typename BayesTree::sharedClique& clique, int& result) { +void nnz_internal(const BayesTree::sharedClique& clique, int& result) { int dimR = (*clique)->dim(); int dimSep = (*clique)->get_S().cols() - dimR; result += ((dimR+1)*dimR)/2 + dimSep*dimR; // traverse the children - BOOST_FOREACH(const typename BayesTree::sharedClique& child, clique->children_) { + BOOST_FOREACH(const BayesTree::sharedClique& child, clique->children_) { nnz_internal(child, result); } } /* ************************************************************************* */ -int calculate_nnz(const typename BayesTree::sharedClique& clique) { +int calculate_nnz(const BayesTree::sharedClique& clique) { int result = 0; // starting from the root, add up entries of frontal and conditional matrices of each conditional nnz_internal(clique, result); diff --git a/gtsam/nonlinear/GaussianISAM2.h b/gtsam/nonlinear/GaussianISAM2.h index f454a6af4..7a66eeaf2 100644 --- a/gtsam/nonlinear/GaussianISAM2.h +++ b/gtsam/nonlinear/GaussianISAM2.h @@ -30,7 +30,7 @@ template class GaussianISAM2 : public ISAM2 {}; // optimize the BayesTree, starting from the root -void optimize2(const typename BayesTree::sharedClique& root, VectorValues& delta); +void optimize2(const BayesTree::sharedClique& root, VectorValues& delta); // optimize the BayesTree, starting from the root; "replaced" needs to contain // all variables that are contained in the top of the Bayes tree that has been @@ -40,10 +40,10 @@ void optimize2(const typename BayesTree::sharedClique& root // and recursive backsubstitution might eventually stop if none of the changed // variables are contained in the subtree. // returns the number of variables that were solved for -int optimize2(const typename BayesTree::sharedClique& root, +int optimize2(const BayesTree::sharedClique& root, double threshold, const std::vector& replaced, Permuted& delta); // calculate the number of non-zero entries for the tree starting at clique (use root for complete matrix) -int calculate_nnz(const typename BayesTree::sharedClique& clique); +int calculate_nnz(const BayesTree::sharedClique& clique); }/// namespace gtsam