21 #include <boost/format.hpp> 22 #include <boost/bind.hpp> 31 static const size_t chrBits =
sizeof(
unsigned char) * 8;
37 c_((unsigned char) ((key & chrMask) >> indexBits)),
38 j_ (key & indexMask) {
43 boost::format
msg(
"Symbol index is too large, j=%d, indexMask=%d");
45 throw std::invalid_argument(msg.str());
52 std::cout << s << (std::string) (*
this) << std::endl;
59 Symbol::operator std::string()
const {
60 return str(boost::format(
"%c%d") %
c_ %
j_);
void print(const std::string &s="") const
Print.
static LabeledSymbol make(gtsam::Key key)
unsigned char chr() const
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).
bool equals(const Symbol &expected, double tol=0.0) const
Check equality.
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
static const size_t keyBits
ofstream os("timeSchurFactors.csv")
static boost::function< bool(Key)> ChrTest(unsigned char c)
std::uint64_t Key
Integer nonlinear key type.