From ec39a39cb6fb0e3b1863e26b955087f0d8bbe560 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 15 Jul 2010 20:00:34 +0200 Subject: [PATCH] fix LLT for zero matrix --- Eigen/src/Cholesky/LLT.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h index b7bf58e63..ffee76012 100644 --- a/Eigen/src/Cholesky/LLT.h +++ b/Eigen/src/Cholesky/LLT.h @@ -132,7 +132,8 @@ void LLT::compute(const MatrixType& a) m_isInitialized = true; return; } - m_matrix.col(0).end(size-1) = a.row(0).end(size-1).adjoint() / ei_real(m_matrix.coeff(0,0)); + if(ei_real(m_matrix.coeff(0,0))>0) + m_matrix.col(0).end(size-1) = a.row(0).end(size-1).adjoint() / ei_real(m_matrix.coeff(0,0)); for (int j = 1; j < size; ++j) { x = ei_real(a.coeff(j,j)) - m_matrix.row(j).start(j).squaredNorm();