diff --git a/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.cpp b/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.cpp index f0c7212c8..1b7f86d5c 100644 --- a/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.cpp +++ b/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.cpp @@ -43,7 +43,7 @@ bool ConcurrentIncrementalFilter::equals(const ConcurrentFilter& rhs, double tol /* ************************************************************************* */ ConcurrentIncrementalFilter::Result ConcurrentIncrementalFilter::update(const NonlinearFactorGraph& newFactors, const Values& newTheta, - const boost::optional >& keysToMove, const boost::optional< std::vector >& removeFactorIndices) { + const boost::optional >& keysToMove, const boost::optional< FactorIndices >& removeFactorIndices) { gttic(update); @@ -117,7 +117,7 @@ ConcurrentIncrementalFilter::Result ConcurrentIncrementalFilter::update(const No gttic(cache_smoother_factors); // Find the set of factors that will be removed - std::vector removedFactorSlots = FindAdjacentFactors(isam2_, *keysToMove, currentSmootherSummarizationSlots_); + FactorIndices removedFactorSlots = FindAdjacentFactors(isam2_, *keysToMove, currentSmootherSummarizationSlots_); // Cache these factors for later transmission to the smoother NonlinearFactorGraph removedFactors; BOOST_FOREACH(size_t slot, removedFactorSlots) { @@ -134,8 +134,8 @@ ConcurrentIncrementalFilter::Result ConcurrentIncrementalFilter::update(const No gttoc(cache_smoother_factors); gttic(marginalize); - std::vector marginalFactorsIndices; - std::vector deletedFactorsIndices; + FactorIndices marginalFactorsIndices; + FactorIndices deletedFactorsIndices; isam2_.marginalizeLeaves(*keysToMove, marginalFactorsIndices, deletedFactorsIndices); currentSmootherSummarizationSlots_.insert(currentSmootherSummarizationSlots_.end(), marginalFactorsIndices.begin(), marginalFactorsIndices.end()); BOOST_FOREACH(size_t index, deletedFactorsIndices) { @@ -285,10 +285,10 @@ void ConcurrentIncrementalFilter::RecursiveMarkAffectedKeys(const Key& key, cons } /* ************************************************************************* */ -std::vector ConcurrentIncrementalFilter::FindAdjacentFactors(const ISAM2& isam2, const FastList& keys, const std::vector& factorsToIgnore) { +FactorIndices ConcurrentIncrementalFilter::FindAdjacentFactors(const ISAM2& isam2, const FastList& keys, const FactorIndices& factorsToIgnore) { // Identify any new factors to be sent to the smoother (i.e. any factor involving keysToMove) - std::vector removedFactorSlots; + FactorIndices removedFactorSlots; const VariableIndex& variableIndex = isam2.getVariableIndex(); BOOST_FOREACH(Key key, keys) { const FastVector& slots = variableIndex[key]; diff --git a/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.h b/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.h index 11012674e..c28b3bcd1 100644 --- a/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.h +++ b/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.h @@ -46,7 +46,7 @@ public: * factors passed as \c newFactors update(). These indices may be * used later to refer to the factors in order to remove them. */ - std::vector newFactorsIndices; + FactorIndices newFactorsIndices; double error; ///< The final factor graph error @@ -124,7 +124,7 @@ public: */ Result update(const NonlinearFactorGraph& newFactors = NonlinearFactorGraph(), const Values& newTheta = Values(), const boost::optional >& keysToMove = boost::none, - const boost::optional< std::vector >& removeFactorIndices = boost::none); + const boost::optional< FactorIndices >& removeFactorIndices = boost::none); /** * Perform any required operations before the synchronization process starts. @@ -170,7 +170,7 @@ protected: // ??? NonlinearFactorGraph previousSmootherSummarization_; ///< The smoother summarization on the old separator sent by the smoother during the last synchronization - std::vector currentSmootherSummarizationSlots_; ///< The slots in factor graph that correspond to the current smoother summarization on the current separator + FactorIndices currentSmootherSummarizationSlots_; ///< The slots in factor graph that correspond to the current smoother summarization on the current separator NonlinearFactorGraph smootherShortcut_; ///< A set of conditional factors from the old separator to the current separator (recursively calculated during each filter update) // Storage for information to be sent to the smoother @@ -183,7 +183,7 @@ private: static void RecursiveMarkAffectedKeys(const Key& key, const ISAM2Clique::shared_ptr& clique, std::set& additionalKeys); /** Find the set of iSAM2 factors adjacent to 'keys' */ - static std::vector FindAdjacentFactors(const ISAM2& isam2, const FastList& keys, const std::vector& factorsToIgnore); + static FactorIndices FindAdjacentFactors(const ISAM2& isam2, const FastList& keys, const FactorIndices& factorsToIgnore); /** Update the shortcut marginal between the current separator keys and the previous separator keys */ // TODO: Make this a static function