From 15865897d5615b0d525ba7339bb7648a65890856 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Fri, 26 Feb 2016 03:39:04 -0500 Subject: [PATCH] Added pow. --- matrix/Vector.hpp | 11 +++++++++++ test/vector.cpp | 3 +++ 2 files changed, 14 insertions(+) diff --git a/matrix/Vector.hpp b/matrix/Vector.hpp index 104742fd1c..5a8718a7e2 100644 --- a/matrix/Vector.hpp +++ b/matrix/Vector.hpp @@ -7,6 +7,9 @@ */ #pragma once + +#include + #include "math.hpp" namespace matrix @@ -67,6 +70,14 @@ public: (*this) /= norm(); } + Vector pow(Type v) const { + const Vector &a(*this); + Vector r; + for (size_t i = 0; i v3(v2); TEST(v2 == v3); + float data1_sq[] = {1,4,9,16,25}; + Vector v4(data1_sq); + TEST(v1 == v4.pow(0.5)); return 0; }