mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-11 08:53:14 +08:00
Relaxed fastmath unit test: if std::foo fails, then let's only trigger a warning is numext::foo fails too.
A true error will triggered only if std::foo works but our numext::foo fails.
This commit is contained in:
parent
1d5a6363ea
commit
2ef1b39674
@ -43,11 +43,11 @@ void check_inf_nan(bool dryrun) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VERIFY( !(numext::isfinite)(m(3)) );
|
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !(numext::isfinite)(m(3)) ); g_test_level=0;
|
||||||
VERIFY( !(numext::isinf)(m(3)) );
|
if( (std::isinf) (m(3))) g_test_level=1; VERIFY( !(numext::isinf)(m(3)) ); g_test_level=0;
|
||||||
VERIFY( (numext::isnan)(m(3)) );
|
if(!(std::isnan) (m(3))) g_test_level=1; VERIFY( (numext::isnan)(m(3)) ); g_test_level=0;
|
||||||
VERIFY( !m.allFinite() );
|
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !m.allFinite() ); g_test_level=0;
|
||||||
VERIFY( m.hasNaN() );
|
if(!(std::isnan) (m(3))) g_test_level=1; VERIFY( m.hasNaN() ); g_test_level=0;
|
||||||
}
|
}
|
||||||
T hidden_zero = (std::numeric_limits<T>::min)()*(std::numeric_limits<T>::min)();
|
T hidden_zero = (std::numeric_limits<T>::min)()*(std::numeric_limits<T>::min)();
|
||||||
m(4) /= hidden_zero;
|
m(4) /= hidden_zero;
|
||||||
@ -62,11 +62,11 @@ void check_inf_nan(bool dryrun) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VERIFY( !(numext::isfinite)(m(4)) );
|
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !(numext::isfinite)(m(4)) ); g_test_level=0;
|
||||||
VERIFY( (numext::isinf)(m(4)) );
|
if(!(std::isinf) (m(3))) g_test_level=1; VERIFY( (numext::isinf)(m(4)) ); g_test_level=0;
|
||||||
VERIFY( !(numext::isnan)(m(4)) );
|
if( (std::isnan) (m(3))) g_test_level=1; VERIFY( !(numext::isnan)(m(4)) ); g_test_level=0;
|
||||||
VERIFY( !m.allFinite() );
|
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !m.allFinite() ); g_test_level=0;
|
||||||
VERIFY( m.hasNaN() );
|
if(!(std::isnan) (m(3))) g_test_level=1; VERIFY( m.hasNaN() ); g_test_level=0;
|
||||||
}
|
}
|
||||||
m(3) = 0;
|
m(3) = 0;
|
||||||
if(dryrun)
|
if(dryrun)
|
||||||
@ -80,11 +80,11 @@ void check_inf_nan(bool dryrun) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VERIFY( (numext::isfinite)(m(3)) );
|
if(!(std::isfinite)(m(3))) g_test_level=1; VERIFY( (numext::isfinite)(m(3)) ); g_test_level=0;
|
||||||
VERIFY( !(numext::isinf)(m(3)) );
|
if( (std::isinf) (m(3))) g_test_level=1; VERIFY( !(numext::isinf)(m(3)) ); g_test_level=0;
|
||||||
VERIFY( !(numext::isnan)(m(3)) );
|
if( (std::isnan) (m(3))) g_test_level=1; VERIFY( !(numext::isnan)(m(3)) ); g_test_level=0;
|
||||||
VERIFY( !m.allFinite() );
|
if( (std::isfinite)(m(3))) g_test_level=1; VERIFY( !m.allFinite() ); g_test_level=0;
|
||||||
VERIFY( !m.hasNaN() );
|
if( (std::isnan) (m(3))) g_test_level=1; VERIFY( !m.hasNaN() ); g_test_level=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user