From 359bc161a67798a79e60ccff593107aef2952aba Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 18 Mar 2020 10:44:21 -0400 Subject: [PATCH] updated transpose signature for Rot3Q --- gtsam/geometry/Rot3Q.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gtsam/geometry/Rot3Q.cpp b/gtsam/geometry/Rot3Q.cpp index 8af9a7144..377cc4a5f 100644 --- a/gtsam/geometry/Rot3Q.cpp +++ b/gtsam/geometry/Rot3Q.cpp @@ -79,11 +79,9 @@ namespace gtsam { } /* ************************************************************************* */ - // TODO: Could we do this? It works in Rot3M but not here, probably because - // here we create an intermediate value by calling matrix() - // const Eigen::Transpose Rot3::transpose() const { - Matrix3 Rot3::transpose() const { - return matrix().transpose(); + const Eigen::Transpose Rot3::transpose() const { + // `.eval()` to avoid aliasing effect due to transpose (allows compilation). + return matrix().eval().transpose(); } /* ************************************************************************* */