diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h index eb8e7978201f2846a7e6ff13b12cfbbe37bccff5..77133545165437c4eead58c272c64d272f3c58d8 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 21be26d25c8983bdc8e5ec9389e3518767585d43..1b515d73c1f08f9a5374d69b4ef2122f73bf39f1 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);