24 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 25 #include <boost/serialization/vector.hpp> 41 struct GTSAM_EXPORT
DiscreteKeys:
public std::vector<DiscreteKey> {
44 using std::vector<DiscreteKey>::vector;
54 for (
auto&& kv : cardinalities) emplace_back(kv);
69 std::map<Key,size_t> cardinalities()
const;
78 void print(
const std::string&
s =
"",
84 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 86 friend class boost::serialization::access;
87 template <
class ARCHIVE>
88 void serialize(ARCHIVE& ar,
const unsigned int ) {
89 ar& boost::serialization::make_nvp(
91 boost::serialization::base_object<std::vector<DiscreteKey>>(*
this));
void print(const Matrix &A, const string &s, ostream &stream)
const gtsam::Symbol key('X', 0)
DiscreteKeys(std::map< Key, size_t > cardinalities)
Construct from cardinalities.
DiscreteKeys()
Constructor for serialization.
std::string serialize(const T &input)
serializes to a string
DiscreteKeys operator &(const DiscreteKey &key1, const DiscreteKey &key2)
Create a list from two keys.
static const KeyFormatter DefaultKeyFormatter
Included from all GTSAM files.
const Symbol key1('v', 1)
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
DiscreteKeys(const std::vector< DiscreteKey > &keys)
Construct from a vector of keys.
std::pair< Key, size_t > DiscreteKey
DiscreteKeys(const DiscreteKey &key)
Construct from a key.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
const Symbol key2('v', 2)
DiscreteKeys is a set of keys that can be assembled using the & operator.