From a0d1dc4313a4df9618836b195ce6426c97501650 Mon Sep 17 00:00:00 2001 From: Orange Date: Tue, 29 Apr 2025 20:49:59 +0300 Subject: [PATCH] added test case --- include/omath/mat.hpp | 2 +- tests/general/unit_test_mat.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/omath/mat.hpp b/include/omath/mat.hpp index 93d3771..c418702 100644 --- a/include/omath/mat.hpp +++ b/include/omath/mat.hpp @@ -375,7 +375,7 @@ namespace omath result.At(row, column) = transposed.AlgComplement(row, column); result /= det; - + return {result}; } private: diff --git a/tests/general/unit_test_mat.cpp b/tests/general/unit_test_mat.cpp index ec60eb3..abf6f1e 100644 --- a/tests/general/unit_test_mat.cpp +++ b/tests/general/unit_test_mat.cpp @@ -206,3 +206,12 @@ TEST(UnitTestMatStandalone, Transpose_NonSquare) EXPECT_FLOAT_EQ(transposed.At(1, 1), 5.0f); EXPECT_FLOAT_EQ(transposed.At(2, 1), 6.0f); } + +TEST(UnitTestMatStandalone, Enverse) +{ + + constexpr Mat<2, 2> m{{1.0f, 3.0f}, {2.0f, 5.0f}}; + constexpr Mat<2,2> mv{{-5.0f, 3.0f}, {2.0f, -1.0f}}; + + EXPECT_EQ(mv, m.Inverted()); +}