checking if print is the problem

release/4.3a0
Varun Agrawal 2024-10-09 11:11:05 -04:00
parent 205eb18f47
commit 4f74735328
1 changed files with 13 additions and 12 deletions

View File

@ -70,18 +70,19 @@ HybridGaussianProductFactor& HybridGaussianProductFactor::operator+=(
/* *******************************************************************************/
void HybridGaussianProductFactor::print(const std::string& s,
const KeyFormatter& formatter) const {
KeySet keys;
auto printer = [&](const Y& y) {
if (keys.empty()) keys = y.first.keys();
return "Graph of size " + std::to_string(y.first.size()) +
", scalar sum: " + std::to_string(y.second);
};
Base::print(s, formatter, printer);
if (!keys.empty()) {
std::cout << s << " Keys:";
for (auto&& key : keys) std::cout << " " << formatter(key);
std::cout << "." << std::endl;
}
// KeySet keys;
// auto printer = [&](const Y& y) {
// if (keys.empty()) keys = y.first.keys();
// return "Graph of size " + std::to_string(y.first.size()) +
// ", scalar sum: " + std::to_string(y.second);
// };
// Base::print(s, formatter, printer);
// if (!keys.empty()) {
// std::cout << s << " Keys:";
// for (auto&& key : keys) std::cout << " " << formatter(key);
// std::cout << "." << std::endl;
// }
std::cout << "HybridGaussianProductFactor" << std::endl;
}
/* *******************************************************************************/