DiscreteKeys::print method

release/4.3a0
Varun Agrawal 2022-08-31 12:30:36 -04:00
parent 5bc7d3333f
commit 2c4866e6e6
1 changed files with 10 additions and 0 deletions

View File

@ -69,6 +69,16 @@ namespace gtsam {
push_back(key);
return *this;
}
/// Print the keys and cardinalities.
void print(const std::string& s = "",
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
for (auto&& dkey : *this) {
std::cout << DefaultKeyFormatter(dkey.first) << " " << dkey.second
<< std::endl;
}
}
}; // DiscreteKeys
/// Create a list from two keys