New method merge (mainly for MATLAB)

release/4.3a0
dellaert 2014-05-06 11:08:33 -04:00
parent 9373711a85
commit 3f125b46df
2 changed files with 6 additions and 0 deletions

View File

@ -1725,6 +1725,7 @@ class KeySet {
// structure specific methods
void insert(size_t key);
void merge(gtsam::KeySet& other);
bool erase(size_t key); // returns true if value was removed
bool count(size_t key) const; // returns true if value exists

View File

@ -103,6 +103,11 @@ public:
/** Check for equality within tolerance to implement Testable */
bool equals(const FastSet<VALUE>& other, double tol = 1e-9) const { return FastSetTestableHelper<VALUE>::equals(*this, other, tol); }
/** insert another set: handy for MATLAB access */
void merge(const FastSet& other) {
Base::insert(other.begin(),other.end());
}
private:
/** Serialization function */
friend class boost::serialization::access;