Hi, When using Eigen's Matrix on std::complex<double> scalar type I got compilation issue on computeInverseWithCheck function on Eigen 3.3.4. Here is the compilation log: /home/localuser/PROJECTS/UNISON_GENERIC_MODULE/MatrixForRF/Eigen/Eigen/src/LU/InverseImpl.h: In instantiation of ‘void Eigen::MatrixBase<Derived>::computeInverseWithCheck(ResultType&, bool&, const RealScalar&) const [with ResultType = Eigen::Matrix<std::complex<double>, 2, 2, 1>; Derived = Eigen::Matrix<std::complex<double>, 2, 2, 1>; Eigen::MatrixBase<Derived>::RealScalar = double]’: INTERNAL/MatrixForRF/TParameter.cpp:299:72: required from here /home/localuser/PROJECTS/UNISON_GENERIC_MODULE/MatrixForRF/Eigen/Eigen/src/LU/InverseImpl.h:410:87: error: no matching function for call to ‘Eigen::MatrixBase<Eigen::Matrix<std::complex<double>, 2, 2, 1> >::computeInverseAndDetWithCheck(Eigen::Matrix<std::complex<double>, 2, 2, 1>&, Eigen::MatrixBase<Eigen::Matrix<std::complex<double>, 2, 2, 1> >::RealScalar&, bool&, const RealScalar&) const’ computeInverseAndDetWithCheck(inverse,determinant,invertible,absDeterminantThreshold); ^ /home/localuser/PROJECTS/UNISON_GENERIC_MODULE/MatrixForRF/Eigen/Eigen/src/LU/InverseImpl.h:410:87: note: candidate is: In file included from /home/localuser/PROJECTS/UNISON_GENERIC_MODULE/MatrixForRF/Eigen/Eigen/LU:35:0, from /home/localuser/PROJECTS/UNISON_GENERIC_MODULE/MatrixForRF/Eigen/Eigen/Dense:2, from /home/localuser/PROJECTS/UNISON_GENERIC_MODULE/MatrixForRF/UnisonComplexMatrix.h:21, from INTERNAL/MatrixForRF/TParameter.cpp:1: /home/localuser/PROJECTS/UNISON_GENERIC_MODULE/MatrixForRF/Eigen/Eigen/src/LU/InverseImpl.h:362:13: note: void Eigen::MatrixBase<Derived>::computeInverseAndDetWithCheck(ResultType&, typename ResultType::Scalar&, bool&, const RealScalar&) const [with ResultType = Eigen::Matrix<std::complex<double>, 2, 2, 1>; Derived = Eigen::Matrix<std::complex<double>, 2, 2, 1>; typename ResultType::Scalar = std::complex<double>; Eigen::MatrixBase<Derived>::RealScalar = double] inline void MatrixBase<Derived>::computeInverseAndDetWithCheck( ^ /home/localuser/PROJECTS/UNISON_GENERIC_MODULE/MatrixForRF/Eigen/Eigen/src/LU/InverseImpl.h:362:13: note: no known conversion for argument 2 from ‘Eigen::MatrixBase<Eigen::Matrix<std::complex<double>, 2, 2, 1> >::RealScalar {aka double}’ to ‘Eigen::Matrix<std::complex<double>, 2, 2, 1>::Scalar& {aka std::complex<double>&}’ I guess the issue is coming from the file Eigen/src/LU/InverseImpl.h where the function is defined this way: template<typename Derived> template<typename ResultType> inline void MatrixBase<Derived>::computeInverseWithCheck( ResultType& inverse, bool& invertible, const RealScalar& absDeterminantThreshold ) const { RealScalar 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); } My assumption is that the determinant variable shouldn't be defined as "RealScalar" type but more as "typename ResultType::Scalar". For type like double, int, etc... it will make no difference, for std::complex<double> it doesn't work. I hope my analysis is correct. Regards,
Sorry for the delay. It is working well for me regardless of the compiler. I'm closing it as "worksforme". If you still has the issue, please re-open with a reproducible code snippet.
Sorry, I've too fast reading our inverse.cpp unit test. You are perfectly right! https://bitbucket.org/eigen/eigen/commits/87636bcbdf125029 (default) https://bitbucket.org/eigen/eigen/commits/8be258ef0b6d09f1 (3.3)
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1509.