From c550921bcfe3f3a0fb56863f5e948b8c9234530b Mon Sep 17 00:00:00 2001 From: daingun Date: Fri, 1 Nov 2019 22:12:59 +0100 Subject: [PATCH] Correct Schur decomposition for 2x2 matrices Due to rounding and possible loss of precision the lower left element of the 2x2 matrix may be different from zero. --- src/linalg/schur.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/linalg/schur.rs b/src/linalg/schur.rs index b31be9f6..2a2bb250 100644 --- a/src/linalg/schur.rs +++ b/src/linalg/schur.rs @@ -413,6 +413,7 @@ where let inv_rot = rot.inverse(); inv_rot.rotate(&mut m); rot.rotate_rows(&mut m); + m[(1, 0)] = N::zero(); if compute_q { // XXX: we have to build the matrix manually because