hops
Transformation.hpp
Go to the documentation of this file.
1 #ifndef HOPS_TRANSFORMATION_HPP
2 #define HOPS_TRANSFORMATION_HPP
3 
4 #include <utility>
5 
6 namespace hops {
7 
12  template<typename MatrixType, typename VectorType>
14  public:
15  Transformation() = default;
16 
18 
23  return matrix * vector + shift;
24  }
25 
27  if (!matrix.isLowerTriangular()) {
28  return matrix.inverse() * (vector - shift);
29  }
30  return matrix.template triangularView<Eigen::Lower>().solve(vector - shift);
31  }
32 
35  };
36 }
37 
38 #endif //HOPS_TRANSFORMATION_HPP
hops::Transformation
Definition: Transformation.hpp:13
hops::MatrixType
Eigen::MatrixXd MatrixType
Definition: MatrixType.hpp:7
hops::Transformation::shift
VectorType shift
Definition: Transformation.hpp:34
hops::Transformation::applyInverse
VectorType applyInverse(VectorType vector)
Definition: Transformation.hpp:26
hops::Transformation::matrix
MatrixType matrix
Definition: Transformation.hpp:33
hops::Transformation::Transformation
Transformation(MatrixType matrix, VectorType shift)
Definition: Transformation.hpp:17
hops
Definition: CsvReader.hpp:8
hops::Transformation::Transformation
Transformation()=default
hops::VectorType
Eigen::VectorXd VectorType
Definition: VectorType.hpp:7
hops::Transformation::apply
VectorType apply(VectorType vector)
Transforms vector from rounded space to unrounded space.
Definition: Transformation.hpp:22