diff --git a/gtsam/discrete/DiscreteConditional.cpp b/gtsam/discrete/DiscreteConditional.cpp index 203f00f89..af4ad4495 100644 --- a/gtsam/discrete/DiscreteConditional.cpp +++ b/gtsam/discrete/DiscreteConditional.cpp @@ -317,7 +317,7 @@ std::string DiscreteConditional::markdown(const KeyFormatter& keyFormatter, ss << "|"; const_iterator it; for(Key parent: parents()) { - ss << keyFormatter(parent) << "|"; + ss << "*" << keyFormatter(parent) << "*|"; pairs.emplace_back(parent, cardinalities_.at(parent)); } diff --git a/gtsam/discrete/tests/testDiscreteBayesNet.cpp b/gtsam/discrete/tests/testDiscreteBayesNet.cpp index 1de45905a..de8e05edc 100644 --- a/gtsam/discrete/tests/testDiscreteBayesNet.cpp +++ b/gtsam/discrete/tests/testDiscreteBayesNet.cpp @@ -187,12 +187,13 @@ TEST(DiscreteBayesNet, markdown) { "|1|0.01|\n" "\n" " *P(Smoking|Asia)*:\n\n" - "|Asia|0|1|\n" + "|*Asia*|0|1|\n" "|:-:|:-:|:-:|\n" "|0|0.8|0.2|\n" "|1|0.7|0.3|\n\n"; auto formatter = [](Key key) { return key == 0 ? "Asia" : "Smoking"; }; string actual = fragment.markdown(formatter); + cout << actual << endl; EXPECT(actual == expected); } diff --git a/gtsam/discrete/tests/testDiscreteConditional.cpp b/gtsam/discrete/tests/testDiscreteConditional.cpp index 90da07cdc..b498b0541 100644 --- a/gtsam/discrete/tests/testDiscreteConditional.cpp +++ b/gtsam/discrete/tests/testDiscreteConditional.cpp @@ -143,7 +143,7 @@ TEST(DiscreteConditional, markdown_multivalued) { A | B = "2/88/10 2/20/78 33/33/34 33/33/34 95/2/3"); string expected = " *P(a1|b1)*:\n\n" - "|b1|0|1|2|\n" + "|*b1*|0|1|2|\n" "|:-:|:-:|:-:|:-:|\n" "|0|0.02|0.88|0.1|\n" "|1|0.02|0.2|0.78|\n" @@ -161,7 +161,7 @@ TEST(DiscreteConditional, markdown) { DiscreteConditional conditional(A, {B, C}, "0/1 1/3 1/1 3/1 0/1 1/0"); string expected = " *P(A|B,C)*:\n\n" - "|B|C|T|F|\n" + "|*B*|*C*|T|F|\n" "|:-:|:-:|:-:|:-:|\n" "|-|Zero|0|1|\n" "|-|One|0.25|0.75|\n"