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