Formatting, unused variable

release/4.3a0
Frank Dellaert 2021-12-23 12:44:52 -05:00
parent a27437690c
commit 1eb27ed90a
2 changed files with 4 additions and 6 deletions

View File

@ -135,15 +135,14 @@ namespace gtsam {
}
/* ************************************************************************* */
// Check markdown representation looks as expected.
std::string DecisionTreeFactor::_repr_markdown_() const {
std::stringstream ss;
// Print out header and calculate number of rows.
ss << "|";
size_t m = 1; // number of rows
for (auto& key : cardinalities_) {
size_t k = key.second;
m *= k;
ss << key.first << "(" << k << ")|";
}
ss << "value|\n";

View File

@ -83,9 +83,8 @@ TEST( DecisionTreeFactor, sum_max)
}
/* ************************************************************************* */
TEST( DecisionTreeFactor, markdown)
{
DiscreteKey v0(0,3), v1(1,2);
TEST(DecisionTreeFactor, markdown) {
DiscreteKey v0(0, 3), v1(1, 2);
DecisionTreeFactor f1(v0 & v1, "1 2 3 4 5 6");
string expected =
"|0(3)|1(2)|value|\n"
@ -98,7 +97,7 @@ TEST( DecisionTreeFactor, markdown)
"|2|1|6|\n";
string actual = f1._repr_markdown_();
EXPECT(actual == expected);
}
}
/* ************************************************************************* */
int main() {