MCPcopy Create free account
hub / github.com/Derious/cuMPC / isLowerTriangular

Method isLowerTriangular

dependence/eigen-3.4.0/Eigen/src/Core/TriangularMatrix.h:690–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688 */
689template<typename Derived>
690bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const
691{
692 RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
693 for(Index j = 0; j < cols(); ++j)
694 for(Index i = j; i < rows(); ++i)
695 {
696 RealScalar absValue = numext::abs(coeff(i,j));
697 if(absValue > maxAbsOnLowerPart) maxAbsOnLowerPart = absValue;
698 }
699 RealScalar threshold = maxAbsOnLowerPart * prec;
700 for(Index j = 1; j < cols(); ++j)
701 {
702 Index maxi = numext::mini(j, rows()-1);
703 for(Index i = 0; i < maxi; ++i)
704 if(numext::abs(coeff(i, j)) > threshold) return false;
705 }
706 return true;
707}
708
709
710/***************************************************************************

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 2

triangular_squareFunction · 0.64
triangular_rectFunction · 0.64