nicer formatting when printing values

release/4.3a0
Varun Agrawal 2020-07-21 18:41:14 -05:00
parent 61b1a9e88d
commit b8f9ab1d87
2 changed files with 3 additions and 2 deletions

View File

@ -84,7 +84,7 @@ public:
/// Virtual print function, uses traits
virtual void print(const std::string& str) const {
std::cout << "(" << demangle(typeid(T).name()) << ") ";
std::cout << "(" << demangle(typeid(T).name()) << ") " << std::endl;
traits<T>::Print(value_, str);
}

View File

@ -69,7 +69,8 @@ namespace gtsam {
/* ************************************************************************* */
void Values::print(const string& str, const KeyFormatter& keyFormatter) const {
cout << str << "Values with " << size() << " values:" << endl;
cout << str << endl;
cout << "Values with " << size() << " values:" << endl;
for(const_iterator key_value = begin(); key_value != end(); ++key_value) {
cout << "Value " << keyFormatter(key_value->key) << ": ";
key_value->value.print("");