diff --git a/vector.cpp b/vector.cpp index aa69f764..62d0ece4 100644 --- a/vector.cpp +++ b/vector.cpp @@ -30,28 +30,6 @@ using util::vector3f; using util::vector3d; -/////////////////////////////////////////////////////////////////////////////// -template -T -util::vector::difference (vector rhs) const -{ - // TODO: change the signature to ensure it does not truncate - return static_cast (std::sqrt (difference2 (rhs))); -} - - -//----------------------------------------------------------------------------- -template -T -util::vector::difference2 (vector rhs) const -{ - T sum {0}; - for (size_t i = 0; i < S; ++i) - sum += pow2 (this->data[i] - rhs.data[i]); - return sum; -} - - /////////////////////////////////////////////////////////////////////////////// template vector<2,T> @@ -160,12 +138,13 @@ const util::vector util::vector::UNIT (T{1}); +//----------------------------------------------------------------------------- template const util::vector util::vector::ZERO (T{0}); -//----------------------------------------------------------------------------- +/////////////////////////////////////////////////////////////////////////////// template void util::vector::sanity (void) const diff --git a/vector.hpp b/vector.hpp index d3760406..715540f1 100644 --- a/vector.hpp +++ b/vector.hpp @@ -29,9 +29,6 @@ namespace util { { using coord::base::base; - T difference (vector) const; - T difference2 (vector) const; - // representations template vector homog (void) const; @@ -55,7 +52,8 @@ namespace util { // output and serialisation operators template - const json::tree::node& operator>> (const json::tree::node&, vector&); + const json::tree::node& + operator>> (const json::tree::node&, vector&); // convenience typedefs template using vector2 = vector<2,T>;