From b8f9ab1d87fce11085b3ed467fddc1c65c2c66e7 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 21 Jul 2020 18:41:14 -0500 Subject: [PATCH] nicer formatting when printing values --- gtsam/base/GenericValue.h | 2 +- gtsam/nonlinear/Values.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gtsam/base/GenericValue.h b/gtsam/base/GenericValue.h index 2ac3eb80c..11b610799 100644 --- a/gtsam/base/GenericValue.h +++ b/gtsam/base/GenericValue.h @@ -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::Print(value_, str); } diff --git a/gtsam/nonlinear/Values.cpp b/gtsam/nonlinear/Values.cpp index 98790ccd9..3ec1f3067 100644 --- a/gtsam/nonlinear/Values.cpp +++ b/gtsam/nonlinear/Values.cpp @@ -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("");