40 using Assignment::Assignment;
49 DiscreteValues(std::initializer_list<std::pair<const Key, size_t>> init)
57 void print(
const std::string& s =
"",
58 const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const;
68 std::pair<iterator, bool> insert(
const value_type& value ){
69 return Base::insert(value);
87 return Base::CartesianProduct<DiscreteValues>(keys);
95 using Names = std::map<Key, std::vector<std::string>>;
98 static std::string Translate(
const Names& names,
Key key,
size_t index);
108 const Names& names = {})
const;
118 const Names& names = {})
const;
std::string markdown(const DiscreteValues &values, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteValues::Names &names={})
Free version of markdown.
An assignment from labels to a discrete value index (size_t)
Definition: Testable.h:152
static std::vector< DiscreteValues > CartesianProduct(const DiscreteKeys &keys)
Return a vector of DiscreteValues, one for each possible combination of values.
Definition: DiscreteValues.h:85
Definition: Testable.h:112
GTSAM_EXPORT void print(const Matrix &A, const std::string &s, std::ostream &stream)
Definition: DiscreteValues.h:34
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
Definition: Assignment.h:37
Definition: chartTesting.h:28
specialized key for discrete variables
std::string html(const DiscreteValues &values, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteValues::Names &names={})
Free version of html.
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
std::map< Key, std::vector< std::string > > Names
Translation table from values to strings.
Definition: DiscreteValues.h:95
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition: DiscreteKey.h:41