27 for (
size_t i = 0;
i < cs.size();
i++) {
28 string name =
"v" + std::to_string(
i);
41 cs.insert(begin(),
end());
52 for (
auto&& dkey : *
this) {
59 if (this->
size() != other.size()) {
63 for (
size_t i = 0;
i < this->
size();
i++) {
64 if (this->at(
i).first != other.at(
i).first ||
65 this->at(
i).second != other.at(
i).second) {
const gtsam::Symbol key('X', 0)
DiscreteKeys()
Constructor for serialization.
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Print the keys and cardinalities.
DiscreteKeys operator &(const DiscreteKey &key1, const DiscreteKey &key2)
Create a list from two keys.
static const KeyFormatter DefaultKeyFormatter
const Symbol key1('v', 1)
bool equals(const DiscreteKeys &other, double tol=0) const
Check equality to another DiscreteKeys object.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
specialized key for discrete variables
static EIGEN_DEPRECATED const end_t end
std::pair< Key, size_t > DiscreteKey
Annotation for function names.
KeyVector indices() const
Return a vector of indices.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
std::map< Key, size_t > cardinalities() const
Return a map from index to cardinality.
const Symbol key2('v', 2)
DiscreteKeys is a set of keys that can be assembled using the & operator.