From 3238c59a39b423f8b2365a729b2495497e02a821 Mon Sep 17 00:00:00 2001 From: dellaert Date: Fri, 12 Dec 2014 13:56:50 +0100 Subject: [PATCH] Fixed printing --- gtsam/nonlinear/Expression-inl.h | 6 ++++-- gtsam/nonlinear/Expression.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gtsam/nonlinear/Expression-inl.h b/gtsam/nonlinear/Expression-inl.h index c5a4aaeaa..6c8561650 100644 --- a/gtsam/nonlinear/Expression-inl.h +++ b/gtsam/nonlinear/Expression-inl.h @@ -251,8 +251,10 @@ public: /// Streaming GTSAM_EXPORT friend std::ostream &operator<<(std::ostream &os, const ExpressionNode& node) { - os << "Expression of type " << typeid(int).name() << std::endl; - if (node.traceSize_>0) os << node.traceSize_ << std::endl; + os << "Expression of type " << typeid(T).name(); + if (node.traceSize_>0) os << ", trace size = " << node.traceSize_; + os << "\n"; + return os; } /// Return keys that play in this expression as a set diff --git a/gtsam/nonlinear/Expression.h b/gtsam/nonlinear/Expression.h index 0bd07b97d..6b68c7de2 100644 --- a/gtsam/nonlinear/Expression.h +++ b/gtsam/nonlinear/Expression.h @@ -54,7 +54,7 @@ public: /// Print void print(const std::string& s) const { - std::cout << s << root_ << std::endl; + std::cout << s << *root_ << std::endl; } // Construct a constant expression