fix bug #478: RealSchur failed on a zero matrix.

This commit is contained in:
Gael Guennebaud 2012-06-20 10:08:32 +02:00
parent c8346abcdd
commit b96b429aa2

View File

@ -239,6 +239,8 @@ RealSchur<MatrixType>& RealSchur<MatrixType>::compute(const MatrixType& matrix,
Scalar exshift(0); // sum of exceptional shifts Scalar exshift(0); // sum of exceptional shifts
Scalar norm = computeNormOfT(); Scalar norm = computeNormOfT();
if(norm!=0)
{
while (iu >= 0) while (iu >= 0)
{ {
Index il = findSmallSubdiagEntry(iu, norm); Index il = findSmallSubdiagEntry(iu, norm);
@ -270,7 +272,7 @@ RealSchur<MatrixType>& RealSchur<MatrixType>::compute(const MatrixType& matrix,
performFrancisQRStep(il, im, iu, computeU, firstHouseholderVector, workspace); performFrancisQRStep(il, im, iu, computeU, firstHouseholderVector, workspace);
} }
} }
}
if(iter <= m_maxIterations) if(iter <= m_maxIterations)
m_info = Success; m_info = Success;
else else