mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 02:33:59 +08:00
workaround clang's broken complex division
This commit is contained in:
parent
ab5db86fe9
commit
40f326ef2e
@ -346,7 +346,18 @@ template<typename ArrayType> void array_complex(const ArrayType& m)
|
||||
|
||||
std::complex<RealScalar> zero(0.0,0.0);
|
||||
VERIFY(isnan(m1*zero/zero).all());
|
||||
#if EIGEN_COMP_CLANG
|
||||
// clang's complex division is notoriously broken
|
||||
if(numext::isinf(m1(0,0)/Scalar(0))) {
|
||||
#endif
|
||||
VERIFY(isinf(m1/zero).all());
|
||||
#if EIGEN_COMP_CLANG
|
||||
}
|
||||
else
|
||||
{
|
||||
VERIFY(isinf(m1.real()/zero.real()).all());
|
||||
}
|
||||
#endif
|
||||
VERIFY((isfinite(m1) && !isfinite(m1*zero/zero) && !isfinite(m1/zero)).all());
|
||||
|
||||
VERIFY_IS_APPROX(inverse(inverse(m1)),m1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user