From ead2360f8ed0c426f38d3d522e5fa3c7d9c85980 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