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;