From 2f833b1c6438fb379e05f12e3111c30c0b2f3416 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 4 Apr 2018 15:47:46 +0200 Subject: bug #1509: fix computeInverseWithCheck for complexes --- Eigen/src/LU/InverseImpl.h | 2 +- test/inverse.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Eigen/src/LU/InverseImpl.h b/Eigen/src/LU/InverseImpl.h index 018f99b58..f49f23360 100644 --- a/Eigen/src/LU/InverseImpl.h +++ b/Eigen/src/LU/InverseImpl.h @@ -404,7 +404,7 @@ inline void MatrixBase::computeInverseWithCheck( const RealScalar& absDeterminantThreshold ) const { - RealScalar determinant; + Scalar determinant; // i'd love to put some static assertions there, but SFINAE means that they have no effect... eigen_assert(rows() == cols()); computeInverseAndDetWithCheck(inverse,determinant,invertible,absDeterminantThreshold); diff --git a/test/inverse.cpp b/test/inverse.cpp index 5c6777a18..97fe6ff92 100644 --- a/test/inverse.cpp +++ b/test/inverse.cpp @@ -47,7 +47,7 @@ template void inverse(const MatrixType& m) //computeInverseAndDetWithCheck tests //First: an invertible matrix bool invertible; - RealScalar det; + Scalar det; m2.setZero(); m1.computeInverseAndDetWithCheck(m2, det, invertible); @@ -113,5 +113,7 @@ void test_inverse() CALL_SUBTEST_7( inverse(Matrix4d()) ); CALL_SUBTEST_7( inverse(Matrix()) ); + + CALL_SUBTEST_8( inverse(Matrix4cd()) ); } } -- cgit v1.2.3