From 08f30966dd4c4aaef6dd2c9f2f276b6ccfd3a3fe Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sat, 13 Jun 2015 11:03:12 -0700 Subject: [PATCH] Got rid of obsolete getSlots method --- gtsam/linear/Scatter.cpp | 12 ------------ gtsam/linear/Scatter.h | 11 +++++------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/gtsam/linear/Scatter.cpp b/gtsam/linear/Scatter.cpp index 21d20c14c..2602e08ba 100644 --- a/gtsam/linear/Scatter.cpp +++ b/gtsam/linear/Scatter.cpp @@ -75,18 +75,6 @@ Scatter::Scatter(const GaussianFactorGraph& gfg, } } -/* ************************************************************************* */ -FastVector Scatter::getSlotsForKeys( - const FastVector& keys) const { - gttic(getSlotsForKeys); - FastVector slots(keys.size() + 1); - DenseIndex slot = 0; - BOOST_FOREACH (Key key, keys) - slots[slot++] = at(key).slot; - slots.back() = size(); - return slots; -} - /* ************************************************************************* */ } // gtsam diff --git a/gtsam/linear/Scatter.h b/gtsam/linear/Scatter.h index 1d6c546b8..e1df2d658 100644 --- a/gtsam/linear/Scatter.h +++ b/gtsam/linear/Scatter.h @@ -30,7 +30,7 @@ namespace gtsam { class GaussianFactorGraph; class Ordering; -/// One SlotEntry stores the slot index for a variable, as well its dimension. +/// One SlotEntry stores the slot index for a variable, as well its dim. struct GTSAM_EXPORT SlotEntry { DenseIndex slot; size_t dimension; @@ -47,16 +47,15 @@ struct GTSAM_EXPORT SlotEntry { */ class Scatter : public FastMap { public: + /// Constructor Scatter(const GaussianFactorGraph& gfg, boost::optional ordering = boost::none); + /// Get the slot corresponding to the given key DenseIndex slot(Key key) const { return at(key).slot; } - /** - * For the subset of keys given, return the slots in the same order, - * terminated by the a RHS slot equal to N, the size of the Scatter - */ - FastVector getSlotsForKeys(const FastVector& keys) const; + /// Get the dimension corresponding to the given key + DenseIndex dim(Key key) const { return at(key).dimension; } }; } // \ namespace gtsam