diff --git a/Fastor/expressions/linalg_ops/unary_det_op.h b/Fastor/expressions/linalg_ops/unary_det_op.h index 8084967..2b53d14 100644 --- a/Fastor/expressions/linalg_ops/unary_det_op.h +++ b/Fastor/expressions/linalg_ops/unary_det_op.h @@ -25,7 +25,7 @@ template && DetType == DetCompType::Simple,bool> = false> FASTOR_INLINE T determinant(const Tensor &a) { // Dispatch to LU - determinant(a); + return determinant(a); } // For high order tensors diff --git a/tests/test_linalg/test_linalg.cpp b/tests/test_linalg/test_linalg.cpp index d15b31e..435dce1 100644 --- a/tests/test_linalg/test_linalg.cpp +++ b/tests/test_linalg/test_linalg.cpp @@ -123,6 +123,19 @@ void test_linalg() { FASTOR_EXIT_ASSERT(std::abs(det(A) - det(A) ) < HugeTol); } + // big determinant + { + Tensor M = {{1, 0, 3, 0, 0, 0}, + {0, -2, 4, 0, 5, 0}, + {0, 0, 3, 0, 0, 0}, + {0, 0, 0, 4, 0, 0}, + {0, 0, 0, 0, 9, 0}, + {-1, -1, -1, -1, -1, -1} + }; + + FASTOR_EXIT_ASSERT(std::abs(determinant(M) - 216) < Tol); + } + print(FGRN(BOLD("All tests passed successfully"))); }