From b48456b871f5de53c7996a154303c49dbb5508b0 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 3 Apr 2020 21:52:21 -0400 Subject: [PATCH 1/2] better matrix printing without space wastage, fixed notation in comment --- gtsam/base/Matrix.cpp | 4 ++-- gtsam/geometry/Pose3.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtsam/base/Matrix.cpp b/gtsam/base/Matrix.cpp index f9a2e83a9..e2d8f71d1 100644 --- a/gtsam/base/Matrix.cpp +++ b/gtsam/base/Matrix.cpp @@ -144,10 +144,10 @@ void print(const Matrix& A, const string &s, ostream& stream) { 0, // flags ", ", // coeffSeparator ";\n", // rowSeparator - " \t", // rowPrefix + "\t", // rowPrefix "", // rowSuffix "[\n", // matPrefix - "\n ]" // matSuffix + "\n]" // matSuffix ); cout << s << A.format(matlab) << endl; } diff --git a/gtsam/geometry/Pose3.h b/gtsam/geometry/Pose3.h index e90f91127..fa55f98de 100644 --- a/gtsam/geometry/Pose3.h +++ b/gtsam/geometry/Pose3.h @@ -44,7 +44,7 @@ public: private: Rot3 R_; ///< Rotation gRp, between global and pose frame - Point3 t_; ///< Translation gTp, from global origin to pose frame origin + Point3 t_; ///< Translation gPp, from global origin to pose frame origin public: From 4e564f1abaaedb149a75d353b507938c069b0d2b Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Thu, 7 May 2020 02:32:09 -0400 Subject: [PATCH 2/2] fixed pose3 test for new print format --- gtsam/geometry/tests/testPose3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtsam/geometry/tests/testPose3.cpp b/gtsam/geometry/tests/testPose3.cpp index ec0450abb..b19555321 100644 --- a/gtsam/geometry/tests/testPose3.cpp +++ b/gtsam/geometry/tests/testPose3.cpp @@ -1021,7 +1021,7 @@ TEST(Pose3, print) { std::cout.rdbuf(oldbuf); // Get substring corresponding to translation part - std::string actual = redirectStream.str().substr(47, 11); + std::string actual = redirectStream.str().substr(38, 11); CHECK_EQUAL(expected.str(), actual); }