diff --git a/gtsam/geometry/Rot3Q.cpp b/gtsam/geometry/Rot3Q.cpp index 377cc4a5f..64e8324b8 100644 --- a/gtsam/geometry/Rot3Q.cpp +++ b/gtsam/geometry/Rot3Q.cpp @@ -19,8 +19,8 @@ #ifdef GTSAM_USE_QUATERNIONS -#include #include +#include #include using namespace std; @@ -80,8 +80,8 @@ namespace gtsam { /* ************************************************************************* */ const Eigen::Transpose Rot3::transpose() const { - // `.eval()` to avoid aliasing effect due to transpose (allows compilation). - return matrix().eval().transpose(); + // `eval` for immediate evaluation (allows compilation). + return Rot3(matrix()).matrix().eval().transpose(); } /* ************************************************************************* */