Skip to content

Commit

Permalink
fix if-case for linear trafo revert
Browse files Browse the repository at this point in the history
  • Loading branch information
qacwnfq committed Jan 21, 2024
1 parent 4d7c108 commit 6a6468c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hops/Transformation/LinearTransformation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Eigen::Lower>().solve(vector - shift);
} else if (matrix.isUpperTriangular()) {
} else if (matrix.cols() == matrix.rows() && matrix.isUpperTriangular()) {
return matrix.template triangularView<Eigen::Upper>().solve(vector - shift);
} else {
VectorType rhs = vector-shift;
Expand Down

0 comments on commit 6a6468c

Please sign in to comment.