From 76e838b8d05349cdbae42cc40fdc1878c4c5743c Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sun, 25 Dec 2022 18:19:02 -0500 Subject: [PATCH] Implement printing rather than calling factor graph version --- gtsam/inference/BayesNet-inst.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtsam/inference/BayesNet-inst.h b/gtsam/inference/BayesNet-inst.h index e792b5c03..f43b4025e 100644 --- a/gtsam/inference/BayesNet-inst.h +++ b/gtsam/inference/BayesNet-inst.h @@ -31,7 +31,14 @@ namespace gtsam { template void BayesNet::print(const std::string& s, const KeyFormatter& formatter) const { - Base::print(s, formatter); + std::cout << (s.empty() ? "" : s + " ") << std::endl; + std::cout << "size: " << this->size() << std::endl; + for (size_t i = 0; i < this->size(); i++) { + const auto& conditional = this->at(i); + std::stringstream ss; + ss << "conditional " << i << ": "; + if (conditional) conditional->print(ss.str(), formatter); + } } /* ************************************************************************* */