MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / isLowerTriangular

Method isLowerTriangular

include/Eigen/src/Core/TriangularMatrix.h:607–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605 */
606template <typename Derived>
607bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const {
608 RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
609 for (Index j = 0; j < cols(); ++j)
610 for (Index i = j; i < rows(); ++i) {
611 RealScalar absValue = numext::abs(coeff(i, j));
612 if (absValue > maxAbsOnLowerPart) maxAbsOnLowerPart = absValue;
613 }
614 RealScalar threshold = maxAbsOnLowerPart * prec;
615 for (Index j = 1; j < cols(); ++j) {
616 Index maxi = numext::mini(j, rows() - 1);
617 for (Index i = 0; i < maxi; ++i)
618 if (numext::abs(coeff(i, j)) > threshold) return false;
619 }
620 return true;
621}
622
623/***************************************************************************
624****************************************************************************

Callers

nothing calls this directly

Calls 5

miniFunction · 0.85
colsFunction · 0.70
rowsFunction · 0.70
absFunction · 0.70
coeffFunction · 0.70

Tested by

no test coverage detected