From de85dcff9760b77ad0d2cd06682f44b3f3c9716c Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 26 Nov 2019 13:46:45 +0100 Subject: [PATCH] Vector: switch read only functions to const (#108) --- matrix/Vector.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/matrix/Vector.hpp b/matrix/Vector.hpp index 4af611542f..fe83505af9 100644 --- a/matrix/Vector.hpp +++ b/matrix/Vector.hpp @@ -92,7 +92,7 @@ public: return (*this) / norm(); } - Vector unit_or_zero(const Type eps = Type(1e-5)) { + Vector unit_or_zero(const Type eps = Type(1e-5)) const { const Type n = norm(); if (n > eps) { return (*this) / n; @@ -104,8 +104,7 @@ public: return unit(); } - bool longerThan(Type testVal) - { + bool longerThan(Type testVal) const { return norm_squared() > testVal*testVal; }