24#if GTSAM_ENABLE_BOOST_SERIALIZATION
25#include <boost/serialization/vector.hpp>
41 struct GTSAM_EXPORT
DiscreteKeys:
public std::vector<DiscreteKey> {
66 std::map<Key,size_t> cardinalities()
const;
76 this->insert(this->end(), keys.begin(), keys.end());
81 void print(
const std::string& s =
"",
87#if GTSAM_ENABLE_BOOST_SERIALIZATION
89 friend class boost::serialization::access;
90 template <
class ARCHIVE>
91 void serialize(ARCHIVE& ar,
const unsigned int ) {
92 ar& boost::serialization::make_nvp(
94 boost::serialization::base_object<std::vector<DiscreteKey>>(*
this));
Included from all GTSAM files.
std::pair< Key, size_t > DiscreteKey
Key type for discrete variables.
Definition DiscreteKey.h:38
Global functions in a separate testing namespace.
Definition chartTesting.h:28
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition Key.cpp:30
DiscreteKeys operator&(const DiscreteKey &key1, const DiscreteKey &key2)
Create a list from two keys.
Definition DiscreteKey.cpp:45
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition Key.h:91
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition Key.h:35
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
Template to create a binary predicate.
Definition Testable.h:112
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition DiscreteKey.h:41
DiscreteKeys & operator&(const DiscreteKeys &keys)
Add multiple keys (non-const!).
Definition DiscreteKey.h:75
DiscreteKeys & operator&(const DiscreteKey &key)
Add a key (non-const!).
Definition DiscreteKey.h:69
std::map< Key, size_t > cardinalities() const
Return a map from index to cardinality.
Definition DiscreteKey.cpp:39
DiscreteKeys(const DiscreteKey &key)
Construct from a key.
Definition DiscreteKey.h:47
DiscreteKeys(const std::vector< DiscreteKey > &keys)
Construct from a vector of keys.
Definition DiscreteKey.h:55
DiscreteKeys(std::map< Key, size_t > cardinalities)
Construct from cardinalities.
Definition DiscreteKey.h:50