From fe813911f2fc3b5679c769a3624349a3e053ac63 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sun, 9 Aug 2009 00:06:53 +0200 Subject: [PATCH] make LU::solve() not to crash when rank=0 --- Eigen/src/LU/LU.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/LU/LU.h b/Eigen/src/LU/LU.h index 43154b769..f36951fda 100644 --- a/Eigen/src/LU/LU.h +++ b/Eigen/src/LU/LU.h @@ -561,7 +561,7 @@ bool LU::solve( if(!isSurjective()) { // is c is in the image of U ? - RealScalar biggest_in_c = c.corner(TopLeft, m_rank, c.cols()).cwise().abs().maxCoeff(); + RealScalar biggest_in_c = m_rank>0 ? c.corner(TopLeft, m_rank, c.cols()).cwise().abs().maxCoeff() : 0; for(int col = 0; col < c.cols(); ++col) for(int row = m_rank; row < c.rows(); ++row) if(!ei_isMuchSmallerThan(c.coeff(row,col), biggest_in_c, m_precision))