DiscreteKeys is a set of keys that can be assembled using the & operator. More...
#include <DiscreteKey.h>
Public Member Functions | |
std::map< Key, size_t > | cardinalities () const |
Return a map from index to cardinality. More... | |
DiscreteKeys () | |
Constructor for serialization. More... | |
DiscreteKeys (const DiscreteKey &key) | |
Construct from a key. More... | |
DiscreteKeys (const std::vector< DiscreteKey > &keys) | |
Construct from a vector of keys. More... | |
DiscreteKeys (const std::vector< int > &cs) | |
Construct from cardinalities with default names. More... | |
DiscreteKeys (std::map< Key, size_t > cardinalities) | |
Construct from cardinalities. More... | |
bool | equals (const DiscreteKeys &other, double tol=0) const |
Check equality to another DiscreteKeys object. More... | |
KeyVector | indices () const |
Return a vector of indices. More... | |
DiscreteKeys & | operator& (const DiscreteKey &key) |
Add a key (non-const!) More... | |
DiscreteKeys & | operator& (const DiscreteKeys &keys) |
Add multiple keys (non-const!) More... | |
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
Print the keys and cardinalities. More... | |
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition at line 41 of file DiscreteKey.h.
|
inline |
Constructor for serialization.
Definition at line 47 of file DiscreteKey.h.
|
inlineexplicit |
Construct from a key.
Definition at line 50 of file DiscreteKey.h.
Construct from cardinalities.
Definition at line 53 of file DiscreteKey.h.
|
inline |
Construct from a vector of keys.
Definition at line 58 of file DiscreteKey.h.
gtsam::DiscreteKeys::DiscreteKeys | ( | const std::vector< int > & | cs | ) |
Construct from cardinalities with default names.
Definition at line 26 of file DiscreteKey.cpp.
Return a map from index to cardinality.
Definition at line 39 of file DiscreteKey.cpp.
bool gtsam::DiscreteKeys::equals | ( | const DiscreteKeys & | other, |
double | tol = 0 |
||
) | const |
Check equality to another DiscreteKeys object.
Definition at line 59 of file DiscreteKey.cpp.
KeyVector gtsam::DiscreteKeys::indices | ( | ) | const |
Return a vector of indices.
Definition at line 33 of file DiscreteKey.cpp.
|
inline |
Add a key (non-const!)
Definition at line 72 of file DiscreteKey.h.
|
inline |
Add multiple keys (non-const!)
Definition at line 78 of file DiscreteKey.h.
void gtsam::DiscreteKeys::print | ( | const std::string & | s = "" , |
const KeyFormatter & | keyFormatter = DefaultKeyFormatter |
||
) | const |
Print the keys and cardinalities.
Definition at line 50 of file DiscreteKey.cpp.