mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-24 19:40:45 +08:00
Log position of first difference for easier debugging.
This commit is contained in:
parent
cf82186416
commit
28c7c1a629
@ -90,6 +90,7 @@ template<typename Scalar> bool areApproxAbs(const Scalar* a, const Scalar* b, in
|
||||
if (!isApproxAbs(a[i],b[i],refvalue))
|
||||
{
|
||||
print_mismatch(a, b, size);
|
||||
std::cout << "Values differ in position " << i << ": " << a[i] << " vs " << b[i] << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -104,6 +105,7 @@ template<typename Scalar> bool areApprox(const Scalar* a, const Scalar* b, int s
|
||||
&& !((numext::isnan)(a[i]) && (numext::isnan)(b[i])) )
|
||||
{
|
||||
print_mismatch(a, b, size);
|
||||
std::cout << "Values differ in position " << i << ": " << a[i] << " vs " << b[i] << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -117,6 +119,7 @@ template<typename Scalar> bool areEqual(const Scalar* a, const Scalar* b, int si
|
||||
if ( numext::not_equal_strict(a[i], b[i]) && !((numext::isnan)(a[i]) && (numext::isnan)(b[i])) )
|
||||
{
|
||||
print_mismatch(a, b, size);
|
||||
std::cout << "Values differ in position " << i << ": " << a[i] << " vs " << b[i] << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user