20 #include <boost/format.hpp> 21 #include <boost/bind.hpp> 23 #include <boost/lexical_cast.hpp> 33 : c_(0), label_(0), j_(0) {}
46 const size_t chrBits =
sizeof(
unsigned char) * 8;
47 const size_t lblBits =
sizeof(
unsigned char) * 8;
48 const size_t indexBits = keyBits - chrBits - lblBits;
52 c_ = (
unsigned char)((key & chrMask) >> (indexBits + lblBits));
60 const size_t chrBits =
sizeof(
unsigned char) * 8;
61 const size_t lblBits =
sizeof(
unsigned char) * 8;
62 const size_t indexBits = keyBits - chrBits - lblBits;
67 throw std::invalid_argument(
"Symbol index is too large");
74 std::cout << s <<
": " << (std::string) (*
this) << std::endl;
78 LabeledSymbol::operator std::string()
const {
bool operator!=(const LabeledSymbol &comp) const
unsigned char label() const
static LabeledSymbol make(gtsam::Key key)
static const Key indexMask
static boost::function< bool(gtsam::Key)> TypeTest(unsigned char c)
static const size_t indexBits
unsigned char chr() const
unsigned __int64 uint64_t
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
static boost::function< bool(gtsam::Key)> TypeLabelTest(unsigned char c, unsigned char label)
static const size_t keyBits
ofstream os("timeSchurFactors.csv")
void print(const std::string &s="") const
bool operator==(const LabeledSymbol &comp) const
friend GTSAM_EXPORT std::ostream & operator<<(std::ostream &, const LabeledSymbol &)
Output stream operator that can be used with key_formatter (see Key.h).
bool operator<(const LabeledSymbol &comp) const
std::uint64_t Key
Integer nonlinear key type.
static boost::function< bool(gtsam::Key)> LabelTest(unsigned char label)