wrap Symbol class and methods

release/4.3a0
Varun Agrawal 2020-12-26 17:14:09 -05:00
parent 6c85850147
commit f91f7facb4
2 changed files with 18 additions and 0 deletions

View File

@ -1936,6 +1936,21 @@ class KalmanFilter {
//*************************************************************************
#include <gtsam/inference/Symbol.h>
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);

View File

@ -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_);