From cf3e886d84aeb1b98be879a98c093a8525327c8f Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 17 Mar 2020 15:20:54 -0400 Subject: [PATCH] move print() and iostream to .cpp file for SO --- gtsam/geometry/SOn-inl.h | 9 +++++++++ gtsam/geometry/SOn.cpp | 1 + gtsam/geometry/SOn.h | 5 +---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gtsam/geometry/SOn-inl.h b/gtsam/geometry/SOn-inl.h index 344822c1f..0d7f3e108 100644 --- a/gtsam/geometry/SOn-inl.h +++ b/gtsam/geometry/SOn-inl.h @@ -20,6 +20,10 @@ #include +#include + +using namespace std; + namespace gtsam { // Implementation for N>5 just uses dynamic version @@ -109,4 +113,9 @@ typename SO::VectorN2 SO::vec( return X; } +template +void SO::print(const std::string& s) const { + cout << s << matrix_ << endl; +} + } // namespace gtsam diff --git a/gtsam/geometry/SOn.cpp b/gtsam/geometry/SOn.cpp index be5acc23b..0676b4a67 100644 --- a/gtsam/geometry/SOn.cpp +++ b/gtsam/geometry/SOn.cpp @@ -13,6 +13,7 @@ * @file SOn.cpp * @brief Definitions of dynamic specializations of SO(n) * @author Frank Dellaert + * @author Varun Agrawal * @date March 2019 */ diff --git a/gtsam/geometry/SOn.h b/gtsam/geometry/SOn.h index 8b37f443a..117c2336e 100644 --- a/gtsam/geometry/SOn.h +++ b/gtsam/geometry/SOn.h @@ -24,7 +24,6 @@ #include -#include // TODO(frank): how to avoid? #include #include #include @@ -148,9 +147,7 @@ class SO : public LieGroup, internal::DimensionSO(N)> { /// @name Testable /// @{ - void print(const std::string& s) const { - std::cout << s << matrix_ << std::endl; - } + void print(const std::string& s = std::string()) const; bool equals(const SO& other, double tol) const { return equal_with_abs_tol(matrix_, other.matrix_, tol);