diff --git a/src/algebra/TinyMatrix.hpp b/src/algebra/TinyMatrix.hpp index 1bb3a3a4488819923b81faea28c5d9ff9f649205..027c7c191e2c0174effd9bb2e17ace72c213ae6c 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)); }