From d6ffef89e6d23c884e0925819353ffa51769820e Mon Sep 17 00:00:00 2001 From: dellaert Date: Tue, 1 Jul 2014 11:21:43 -0400 Subject: [PATCH] Return pointer to cached basis --- gtsam/geometry/Unit3.cpp | 2 +- gtsam/geometry/Unit3.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;