From 03ffd696a690e3d1c8f41040579650363f7aa471 Mon Sep 17 00:00:00 2001 From: Julian Kent Date: Mon, 9 Sep 2019 09:37:43 +0200 Subject: [PATCH] Replace pow with sqrt --- matrix/Vector.hpp | 6 +++--- test/vector.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/matrix/Vector.hpp b/matrix/Vector.hpp index 4c5bd915f8..09ad18ca69 100644 --- a/matrix/Vector.hpp +++ b/matrix/Vector.hpp @@ -66,7 +66,7 @@ public: Type norm() const { const Vector &a(*this); - return Type(sqrt(a.dot(a))); + return Type(::sqrt(a.dot(a))); } Type norm_squared() const { @@ -98,11 +98,11 @@ public: return unit(); } - Vector pow(Type v) const { + Vector sqrt() const { const Vector &a(*this); Vector r; for (size_t i = 0; i v4(data1_sq); - TEST(isEqual(v1, v4.pow(0.5))); + TEST(isEqual(v1, v4.sqrt())); return 0; }