Fix a benign bug in ComplexQZ

ComplexQZ would try to apply a Jacobi rotation to an empty block, which triggers a warning in static analyzers, since the corresponding `Eigen::Map` object will contain a `nullptr`.

See merge request libeigen/eigen!2043
This commit is contained in:
Rasmus Munk Larsen
2025-10-24 20:54:54 +00:00
parent 1a5eecd45e
commit 2e91853adf
2 changed files with 15 additions and 15 deletions

View File

@@ -565,7 +565,9 @@ void ComplexQZ<MatrixType_>::push_down_zero_ST(Index k, Index l) {
for (Index j = k + 1; j <= l; j++) {
// Create a 0 at _T(j, j)
J.makeGivens(m_T(j - 1, j), m_T(j, j), &m_T.coeffRef(j - 1, j));
m_T.rightCols(m_n - j - 1).applyOnTheLeft(j - 1, j, J.adjoint());
if (m_n - j - 1 > 0) {
m_T.rightCols(m_n - j - 1).applyOnTheLeft(j - 1, j, J.adjoint());
}
m_T.coeffRef(j, j) = Scalar(0);
m_S.applyOnTheLeft(j - 1, j, J.adjoint());