From 13a05e8671ec6b79d711822b6f16a16017653f08 Mon Sep 17 00:00:00 2001 From: Kai Ni Date: Thu, 8 Apr 2010 22:16:08 +0000 Subject: [PATCH] add Ordering.exists --- cpp/Ordering.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/Ordering.h b/cpp/Ordering.h index 0d7e54240..0fad87708 100644 --- a/cpp/Ordering.h +++ b/cpp/Ordering.h @@ -28,6 +28,9 @@ namespace gtsam { /** Copy constructor */ Ordering(const std::list& keys_in) : std::list(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;