RealQZ yields a wrong answer when there are zeros in the input matrices
Submitted by Ben Goodrich
Assigned to Nobody
Link to original bugzilla bug (#985)
Version: 3.3 (current stable)
Description
Created attachment 557
test case
In the attached test, the case the norms are very large when the the product of the factors is subtracted from the original input matrices. In the hessenbergTriangular() method, the code tests for whether an element of the input matrix is zero. If it is zero, then the Givens rotation is not applied to S or T. However, if m_computeQZ is true, it applies the Givens rotation to Q or Z regardless of whether S or T was rotated. The solution in the patch is to move the rotation for Q or Z inside the if(coeff(i,j) != 0) block. This makes the norms zero to machine precision.
Attachment 557, "test case":
test_QZ.cpp
Edited by Eigen Bugzilla