less verbose name path for SymbolGenerator

release/4.3a0
Jose Luis Blanco Claraco 2020-10-24 08:44:31 +02:00
parent e3a28767ed
commit 672635aad4
No known key found for this signature in database
GPG Key ID: D443304FBD70A641
2 changed files with 4 additions and 4 deletions

View File

@ -162,6 +162,7 @@ inline Key W(std::uint64_t j) { return Symbol('w', j); }
inline Key X(std::uint64_t j) { return Symbol('x', j); }
inline Key Y(std::uint64_t j) { return Symbol('y', j); }
inline Key Z(std::uint64_t j) { return Symbol('z', j); }
}
/** Generates symbol shorthands with alternative names different than the
* one-letter predefined ones. */
@ -171,7 +172,6 @@ public:
SymbolGenerator(const char c) : c_(c) {}
Symbol operator()(const std::uint64_t j) const { return Symbol(c_, j); }
};
}
/// traits
template<> struct traits<Symbol> : public Testable<Symbol> {};

View File

@ -46,9 +46,9 @@ TEST(Key, SymbolGenerator) {
const auto v1 = gtsam::symbol_shorthand::V(1);
const auto a1 = gtsam::symbol_shorthand::A(1);
const auto Z = gtsam::symbol_shorthand::SymbolGenerator('x');
const auto DZ = gtsam::symbol_shorthand::SymbolGenerator('v');
const auto DDZ = gtsam::symbol_shorthand::SymbolGenerator('a');
const auto Z = gtsam::SymbolGenerator('x');
const auto DZ = gtsam::SymbolGenerator('v');
const auto DDZ = gtsam::SymbolGenerator('a');
const auto z1 = Z(1);
const auto dz1 = DZ(1);