mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-10 18:59:01 +08:00
one bugfix and one optimization
This commit is contained in:
parent
bcf7b29185
commit
e05a1aba1d
@ -120,11 +120,15 @@ bool MatrixBase<Scalar, Derived>::isIdentity
|
|||||||
for(int i = 0; i < rows(); i++)
|
for(int i = 0; i < rows(); i++)
|
||||||
{
|
{
|
||||||
if(i == j)
|
if(i == j)
|
||||||
|
{
|
||||||
if(!Eigen::isApprox(coeff(i, j), static_cast<Scalar>(1), prec))
|
if(!Eigen::isApprox(coeff(i, j), static_cast<Scalar>(1), prec))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if(!Eigen::isMuchSmallerThan(coeff(i, j), static_cast<Scalar>(1), prec))
|
{
|
||||||
|
if(!Eigen::isMuchSmallerThan(coeff(i, j), static_cast<RealScalar>(1), prec))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user