From 135faf5ba8bfd7927de560321ad95f97a27d9aba Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Tue, 3 Jul 2018 15:40:02 +0200
Subject: [PATCH] Fixed matrix inverse

---
 src/algebra/TinyMatrix.hpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/algebra/TinyMatrix.hpp b/src/algebra/TinyMatrix.hpp
index 1bb3a3a44..027c7c191 100644
--- a/src/algebra/TinyMatrix.hpp
+++ b/src/algebra/TinyMatrix.hpp
@@ -416,7 +416,8 @@ T cofactor(const TinyMatrix<N,T>& A,
            const size_t& j)
 {
   static_assert(std::is_arithmetic<T>::value, "cofactor is not defined for non arithmetic types");
-  const T sign = ((i+j)%2) ? 1 : -1;
+  const T sign = ((i+j)%2) ? -1 : 1;
+
   return sign * det(getMinor(A, i, j));
 }
 
-- 
GitLab