MCPcopy Create free account
hub / github.com/PX4/eigen / isLowerTriangular

Method isLowerTriangular

Eigen/src/Core/TriangularMatrix.h:673–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671 */
672template<typename Derived>
673bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const
674{
675 RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
676 for(Index j = 0; j < cols(); ++j)
677 for(Index i = j; i < rows(); ++i)
678 {
679 RealScalar absValue = numext::abs(coeff(i,j));
680 if(absValue > maxAbsOnLowerPart) maxAbsOnLowerPart = absValue;
681 }
682 RealScalar threshold = maxAbsOnLowerPart * prec;
683 for(Index j = 1; j < cols(); ++j)
684 {
685 Index maxi = numext::mini(j, rows()-1);
686 for(Index i = 0; i < maxi; ++i)
687 if(numext::abs(coeff(i, j)) > threshold) return false;
688 }
689 return true;
690}
691
692
693/***************************************************************************

Callers 2

triangular_squareFunction · 0.80
triangular_rectFunction · 0.80

Calls 5

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

Tested by

no test coverage detected