diff --git a/gtsam/gtsam.i b/gtsam/gtsam.i index 3a6c6edf1..3ebe71538 100644 --- a/gtsam/gtsam.i +++ b/gtsam/gtsam.i @@ -1936,6 +1936,21 @@ class KalmanFilter { //************************************************************************* #include + +class Symbol { + Symbol(); + Symbol(char c, uint64_t j); + Symbol(size_t key); + + size_t key() const; + void print(const string& s) const; + bool equals(const gtsam::Symbol& expected, double tol) const; + + char chr() const; + uint64_t index() const; + string string() const; +}; + size_t symbol(char chr, size_t index); char symbolChr(size_t key); size_t symbolIndex(size_t key); diff --git a/gtsam/inference/Symbol.h b/gtsam/inference/Symbol.h index 42cdbb1c3..d5699e7fe 100644 --- a/gtsam/inference/Symbol.h +++ b/gtsam/inference/Symbol.h @@ -80,6 +80,9 @@ public: /** Create a string from the key */ operator std::string() const; + /// Return string representation of the key + std::string string() const { return std::string(*this); }; + /** Comparison for use in maps */ bool operator<(const Symbol& comp) const { return c_ < comp.c_ || (comp.c_ == c_ && j_ < comp.j_);