fix LU and QR solve when rank==0, fix LLT when the matrix is purely 0

This commit is contained in:
Gael Guennebaud
2010-07-12 16:42:38 +02:00
parent 468863f3a0
commit c44bbabdcc
3 changed files with 8 additions and 4 deletions

View File

@@ -515,9 +515,10 @@ bool LU<MatrixType>::solve(
if(!ei_isMuchSmallerThan(c.coeff(row,col), biggest_in_c, m_precision))
return false;
}
m_lu.corner(TopLeft, m_rank, m_rank)
.template marked<UpperTriangular>()
.solveTriangularInPlace(c.corner(TopLeft, m_rank, c.cols()));
if(m_rank>0)
m_lu.corner(TopLeft, m_rank, m_rank)
.template marked<UpperTriangular>()
.solveTriangularInPlace(c.corner(TopLeft, m_rank, c.cols()));
// Step 4
result->resize(m_lu.cols(), b.cols());