From 6a6468c04d9b639fb3917a5225961891246fd664 Mon Sep 17 00:00:00 2001 From: "Jadebeck, Johann Fredrik" Date: Mon, 22 Jan 2024 00:51:41 +0100 Subject: [PATCH] fix if-case for linear trafo revert --- src/hops/Transformation/LinearTransformation.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hops/Transformation/LinearTransformation.hpp b/src/hops/Transformation/LinearTransformation.hpp index 6642cb9c..505bc4b7 100644 --- a/src/hops/Transformation/LinearTransformation.hpp +++ b/src/hops/Transformation/LinearTransformation.hpp @@ -31,9 +31,9 @@ namespace hops { } VectorType revert(const VectorType &vector) const override { - if (matrix.isLowerTriangular()) { + if (matrix.cols() == matrix.rows() && matrix.isLowerTriangular()) { return matrix.template triangularView().solve(vector - shift); - } else if (matrix.isUpperTriangular()) { + } else if (matrix.cols() == matrix.rows() && matrix.isUpperTriangular()) { return matrix.template triangularView().solve(vector - shift); } else { VectorType rhs = vector-shift;