diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h index eb8e79782..771335451 100644 --- a/Eigen/src/Core/PermutationMatrix.h +++ b/Eigen/src/Core/PermutationMatrix.h @@ -109,6 +109,9 @@ class PermutationBase : public EigenBase { */ DenseMatrixType toDenseMatrix() const { return derived(); } + /** \returns the plain matrix representation of the permutation. */ + DenseMatrixType eval() const { return toDenseMatrix(); } + /** const version of indices(). */ const IndicesType& indices() const { return derived().indices(); } /** \returns a reference to the stored array representing the permutation. */ diff --git a/test/geo_homogeneous.cpp b/test/geo_homogeneous.cpp index 21be26d25..1b515d73c 100644 --- a/test/geo_homogeneous.cpp +++ b/test/geo_homogeneous.cpp @@ -127,8 +127,8 @@ void homogeneous(void) { { const Eigen::PermutationMatrix P{Eigen::Vector::EqualSpaced(0, 1)}; - const auto right = Eigen::Vector::Random().homogeneous(); - const auto left = Eigen::RowVector::Random().homogeneous(); + const auto right = Eigen::Vector::Random().eval().homogeneous(); + const auto left = Eigen::RowVector::Random().eval().homogeneous(); VERIFY_IS_APPROX(P * right, P * right.eval()); VERIFY_IS_APPROX(left * P, left.eval() * P);