mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-09 18:29:03 +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++)
|
||||
{
|
||||
if(i == j)
|
||||
{
|
||||
if(!Eigen::isApprox(coeff(i, j), static_cast<Scalar>(1), prec))
|
||||
return false;
|
||||
}
|
||||
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 true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user