25 using namespace gtsam;
51 auto keyFormatter = [](
Key key) {
return key == 12 ?
"A" :
"B"; };
52 DiscreteValues::Names
names{{12, {
"Zero",
"One",
"Two"}}, {5, {
"-",
"+"}}};
54 EXPECT(actual == expected);
62 "<table class='DiscreteValues'>\n" 64 " <tr><th>Variable</th><th>value</th></tr>\n" 67 " <tr><th>B</th><td>-</td></tr>\n" 68 " <tr><th>A</th><td>One</td></tr>\n" 72 auto keyFormatter = [](
Key key) {
return key == 12 ?
"A" :
"B"; };
73 DiscreteValues::Names
names{{12, {
"Zero",
"One",
"Two"}}, {5, {
"-",
"+"}}};
75 EXPECT(actual == expected);
const gtsam::Symbol key('X', 0)
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
signatures for conditional densities
std::string markdown(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const
Output as a markdown table.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const
Output as a html table.
#define EXPECT(condition)
DiscreteValues & update(const DiscreteValues &values)
TEST(DiscreteValues, Insert)
static const DiscreteValues kExample
std::pair< iterator, bool > insert(const value_type &value)
std::uint64_t Key
Integer nonlinear key type.