slight improvement to GaussianMixtureFactor print

release/4.3a0
Varun Agrawal 2022-10-10 14:55:02 -04:00
parent 055df81dd3
commit 3e151846ca
1 changed files with 5 additions and 4 deletions

View File

@ -57,11 +57,12 @@ void GaussianMixtureFactor::print(const std::string &s,
[&](const GaussianFactor::shared_ptr &gf) -> std::string {
RedirectCout rd;
std::cout << ":\n";
if (gf)
if (gf && !gf->empty()) {
gf->print("", formatter);
else
return {"nullptr"};
return rd.str();
return rd.str();
} else {
return "nullptr";
}
});
std::cout << "}" << std::endl;
}