This bugzilla service is closed. All entries have been migrated to
Bug 264 - [GCC3.4/4.0] Eigen::internal::sqrt() in ComplexSchur.h clashes with std::sqrt()
Summary: [GCC3.4/4.0] Eigen::internal::sqrt() in ComplexSchur.h clashes with std::sqrt()
Alias: None
Product: Eigen
Classification: Unclassified
Component: Eigenvalues (show other bugs)
Version: 3.0
Hardware: All All
: --- Unknown
Assignee: Nobody
Depends on:
Reported: 2011-05-11 15:03 UTC by Jitse Niesen
Modified: 2019-12-04 10:43 UTC (History)
3 users (show)


Description Jitse Niesen 2011-05-11 15:03:15 UTC
The tests for matrix_square_root that I recently added do not compile under GCC 3.4 and 4.0 on Gael's computer. It's not clear to me what the problem is as I don't have access to this compiler, but the first error message is "call of overloaded 'sqrt(const std::complex<float>&)' is ambiguous" ( ). The possibilities are the sqrt() in ComplexSchur.h and the sqrt() in the standard library.

I wonder whether we need the sqrt() function in ComplexSchur.h. The one in the standard library is presumably perfectly fine, handles complex numbers and puts the branch cut in the same place as our own sqrt() function. I'd guess that whatever implementation which our implementation is based on, had to include its own square root function for complex numbers because it's not in the standard library (for FORTRAN?); we then simply copied the implementation without realizing that we could rely on the C++ standard library. 

Does anybody remember the reason behind the Eigen::internal::sqrt() function in ComplexSchur comes from? It was added in the revision which introduced the complex eigensolver. Can we remove it?
Comment 1 Gael Guennebaud 2011-05-11 22:23:53 UTC
I think you can safely remove it ;)
Comment 2 Jitse Niesen 2011-05-12 17:53:44 UTC
Done (changeset 29b3545f6f33).
Comment 3 Nobody 2019-12-04 10:43:29 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to'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:

Note You need to log in before you can comment on or make changes to this bug.