Skip to content

Commit

Permalink
Merge branch '49-fix-case-indetification-in-linear-transformation-rev…
Browse files Browse the repository at this point in the history
…ert' into 'main'

Resolve "fix case indetification in linear transformation revert"

Closes #49

See merge request IBG-1/ModSim/hops!56
  • Loading branch information
qacwnfq committed Jan 21, 2024
2 parents 4d7c108 + 6a6468c commit f1d4a35
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 f1d4a35

Please sign in to comment.