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

(transplanted from b96b429aa28837a6e1c779afea906bd4c7a2c20d
)
This commit is contained in:
Gael Guennebaud 2012-06-20 10:08:32 +02:00
parent 45e1bb5ea5
commit a1a0cccd4e

View File

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