diff --git a/matrix/Matrix.hpp b/matrix/Matrix.hpp index a910d4fb04d..97e1ebf76fb 100644 --- a/matrix/Matrix.hpp +++ b/matrix/Matrix.hpp @@ -94,7 +94,7 @@ public: */ - inline Type operator()(size_t i, size_t j) const + inline const Type &operator()(size_t i, size_t j) const { assert(i >= 0); assert(i < M); diff --git a/matrix/Slice.hpp b/matrix/Slice.hpp index a6e093aca8d..faf211ca73f 100644 --- a/matrix/Slice.hpp +++ b/matrix/Slice.hpp @@ -34,7 +34,7 @@ public: assert(y0 + Q <= N); } - Type operator()(size_t i, size_t j) const + const Type &operator()(size_t i, size_t j) const { assert(i >= 0); assert(i < P); diff --git a/matrix/Vector.hpp b/matrix/Vector.hpp index 40803ba8cce..e9c0d1f1ab5 100644 --- a/matrix/Vector.hpp +++ b/matrix/Vector.hpp @@ -40,7 +40,7 @@ public: { } - inline Type operator()(size_t i) const + inline const Type &operator()(size_t i) const { assert(i >= 0); assert(i < M);