diff --git a/gtsam/geometry/Unit3.cpp b/gtsam/geometry/Unit3.cpp index db4c8da83..ad6a41bde 100644 --- a/gtsam/geometry/Unit3.cpp +++ b/gtsam/geometry/Unit3.cpp @@ -58,7 +58,7 @@ Unit3 Unit3::Random(boost::mt19937 & rng) { } /* ************************************************************************* */ -Matrix Unit3::basis() const { +const Matrix& Unit3::basis() const { // Return cached version if exists if (B_.rows() == 3) diff --git a/gtsam/geometry/Unit3.h b/gtsam/geometry/Unit3.h index 39e2c9799..8d2c024c0 100644 --- a/gtsam/geometry/Unit3.h +++ b/gtsam/geometry/Unit3.h @@ -84,7 +84,7 @@ public: * It is a 3*2 matrix [b1 b2] composed of two orthogonal directions * tangent to the sphere at the current direction. */ - Matrix basis() const; + const Matrix& basis() const; /// Return skew-symmetric associated with 3D point on unit sphere Matrix skew() const;