30 static const size_t chrBits =
sizeof(
unsigned char) * 8;
36 c_((unsigned char) ((key & chrMask) >> indexBits)),
37 j_ (key & indexMask) {
42 std::stringstream
msg;
43 msg <<
"Symbol index is too large, j=" <<
j_ <<
", indexMask=" <<
indexMask;
44 throw std::invalid_argument(msg.str());
51 std::cout << s << (std::string) (*
this) << std::endl;
58 Symbol::operator std::string()
const {
60 snprintf(buffer, 10,
"%c%llu",
c_, static_cast<unsigned long long>(
j_));
61 return std::string(buffer);
67 auto equals = [](
unsigned char s,
unsigned char c) {
return s ==
c; };
const gtsam::Symbol key('X', 0)
static LabeledSymbol make(gtsam::Key key)
static const Key indexMask
GTSAM_EXPORT friend std::ostream & operator<<(std::ostream &, const Symbol &)
Output stream operator that can be used with key_formatter (see Key.h).
void print(const std::string &s="") const
Print.
static const size_t indexBits
To use the key_formatter on Keys, they must be wrapped in a StreamedKey.
Key symbol(unsigned char c, std::uint64_t j)
static const size_t chrBits
bool equals(const Symbol &expected, double tol=0.0) const
Check equality.
unsigned char chr() const
static const size_t keyBits
ofstream os("timeSchurFactors.csv")
static std::function< bool(Key)> ChrTest(unsigned char c)
std::uint64_t Key
Integer nonlinear key type.