Got rid of obsolete getSlots method

release/4.3a0
Frank Dellaert 2015-06-13 11:03:12 -07:00
parent 6f78e00812
commit 08f30966dd
2 changed files with 5 additions and 18 deletions

View File

@ -75,18 +75,6 @@ Scatter::Scatter(const GaussianFactorGraph& gfg,
} }
} }
/* ************************************************************************* */
FastVector<DenseIndex> Scatter::getSlotsForKeys(
const FastVector<Key>& keys) const {
gttic(getSlotsForKeys);
FastVector<DenseIndex> slots(keys.size() + 1);
DenseIndex slot = 0;
BOOST_FOREACH (Key key, keys)
slots[slot++] = at(key).slot;
slots.back() = size();
return slots;
}
/* ************************************************************************* */ /* ************************************************************************* */
} // gtsam } // gtsam

View File

@ -30,7 +30,7 @@ namespace gtsam {
class GaussianFactorGraph; class GaussianFactorGraph;
class Ordering; 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 { struct GTSAM_EXPORT SlotEntry {
DenseIndex slot; DenseIndex slot;
size_t dimension; size_t dimension;
@ -47,16 +47,15 @@ struct GTSAM_EXPORT SlotEntry {
*/ */
class Scatter : public FastMap<Key, SlotEntry> { class Scatter : public FastMap<Key, SlotEntry> {
public: public:
/// Constructor
Scatter(const GaussianFactorGraph& gfg, Scatter(const GaussianFactorGraph& gfg,
boost::optional<const Ordering&> ordering = boost::none); boost::optional<const Ordering&> ordering = boost::none);
/// Get the slot corresponding to the given key
DenseIndex slot(Key key) const { return at(key).slot; } DenseIndex slot(Key key) const { return at(key).slot; }
/** /// Get the dimension corresponding to the given key
* For the subset of keys given, return the slots in the same order, DenseIndex dim(Key key) const { return at(key).dimension; }
* terminated by the a RHS slot equal to N, the size of the Scatter
*/
FastVector<DenseIndex> getSlotsForKeys(const FastVector<Key>& keys) const;
}; };
} // \ namespace gtsam } // \ namespace gtsam