From a6aba5b595c645f3c8c356d228a8672b42231793 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Mon, 7 Dec 2020 15:38:56 +0700 Subject: [PATCH] remove operator / between matrices --- headers/vmath.hpp/vmath_mat_fun.hpp | 10 ---------- untests/vmath_mat_fun_tests.cpp | 9 --------- 2 files changed, 19 deletions(-) diff --git a/headers/vmath.hpp/vmath_mat_fun.hpp b/headers/vmath.hpp/vmath_mat_fun.hpp index 8a1cff7..ad03a96 100644 --- a/headers/vmath.hpp/vmath_mat_fun.hpp +++ b/headers/vmath.hpp/vmath_mat_fun.hpp @@ -326,11 +326,6 @@ namespace vmath_hpp return map_join([x](const vec& y){ return x / y; }, ys); } - template < typename T, std::size_t Size > - [[nodiscard]] constexpr mat operator/(const mat& xs, const mat& ys) { - return map_join([](const vec& x, const vec& y){ return x / y; }, xs, ys); - } - // operator/= template < typename T, std::size_t Size > @@ -338,11 +333,6 @@ namespace vmath_hpp return (xs = (xs / y)); } - template < typename T, std::size_t Size > - constexpr mat& operator/=(mat& xs, const mat& ys) { - return (xs = (xs / ys)); - } - // operator& template < typename T, std::size_t Size > diff --git a/untests/vmath_mat_fun_tests.cpp b/untests/vmath_mat_fun_tests.cpp index db4e2c3..cb34554 100644 --- a/untests/vmath_mat_fun_tests.cpp +++ b/untests/vmath_mat_fun_tests.cpp @@ -84,7 +84,6 @@ TEST_CASE("vmath/mat_fun") { STATIC_REQUIRE(int2x2(1,2,3,4) + int2x2(5,6,7,8) == int2x2(6,8,10,12)); STATIC_REQUIRE(int2x2(1,2,3,4) - int2x2(5,6,7,8) == int2x2(-4,-4,-4,-4)); - STATIC_REQUIRE(int2x2(5,6,7,8) / int2x2(1,2,3,4) == int2x2(5,3,2,2)); STATIC_REQUIRE(int2x2() * int2x2() == int2x2()); STATIC_REQUIRE(int3x3() * int3x3() == int3x3()); @@ -118,14 +117,6 @@ TEST_CASE("vmath/mat_fun") { REQUIRE(&v == &(v *= 3)); REQUIRE(v == int2x2{3,6,9,12}); } - { - int2x2 v{6,18,36,60}; - REQUIRE(&v == &(v /= 2)); - REQUIRE(v == int2x2{3,9,18,30}); - REQUIRE(&v == &(v /= int2x2{3,4,3,10})); - REQUIRE(v == int2x2{1,2,6,3}); - } - { int4 v{0, 0, 0, 1}; REQUIRE(&v == &(v *= translate(int3{1,2,3})));