New method merge (mainly for MATLAB)
parent
9373711a85
commit
3f125b46df
1
gtsam.h
1
gtsam.h
|
@ -1725,6 +1725,7 @@ class KeySet {
|
||||||
|
|
||||||
// structure specific methods
|
// structure specific methods
|
||||||
void insert(size_t key);
|
void insert(size_t key);
|
||||||
|
void merge(gtsam::KeySet& other);
|
||||||
bool erase(size_t key); // returns true if value was removed
|
bool erase(size_t key); // returns true if value was removed
|
||||||
bool count(size_t key) const; // returns true if value exists
|
bool count(size_t key) const; // returns true if value exists
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,11 @@ public:
|
||||||
/** Check for equality within tolerance to implement Testable */
|
/** 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); }
|
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:
|
private:
|
||||||
/** Serialization function */
|
/** Serialization function */
|
||||||
friend class boost::serialization::access;
|
friend class boost::serialization::access;
|
||||||
|
|
Loading…
Reference in New Issue