add Ordering.exists

release/4.3a0
Kai Ni 2010-04-08 22:16:08 +00:00
parent 3120d6842f
commit 13a05e8671
1 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,9 @@ namespace gtsam {
/** Copy constructor */
Ordering(const std::list<Symbol>& keys_in) : std::list<Symbol>(keys_in) {}
/** whether a key exists */
bool exists(const Symbol& key) { return std::find(begin(), end(), key) != end(); }
// Testable
void print(const std::string& s = "Ordering") const;
bool equals(const Ordering &ord, double tol=0) const;