diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h index a23004458..5955e496f 100644 --- a/Eigen/src/Core/ProductEvaluators.h +++ b/Eigen/src/Core/ProductEvaluators.h @@ -1264,6 +1264,14 @@ struct generic_product_impl +struct generic_product_impl + : generic_product_impl {}; + +template +struct generic_product_impl + : generic_product_impl {}; + } // end namespace internal } // end namespace Eigen diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h index 795af0d8d..4159dc6d0 100644 --- a/Eigen/src/Geometry/Homogeneous.h +++ b/Eigen/src/Geometry/Homogeneous.h @@ -80,14 +80,12 @@ class Homogeneous : public MatrixBase >, int template EIGEN_DEVICE_FUNC inline const Product operator*(const MatrixBase& rhs) const { - eigen_assert(int(Direction) == Horizontal); return Product(*this, rhs.derived()); } template friend EIGEN_DEVICE_FUNC inline const Product operator*(const MatrixBase& lhs, const Homogeneous& rhs) { - eigen_assert(int(Direction) == Vertical); return Product(lhs.derived(), rhs); } diff --git a/test/geo_homogeneous.cpp b/test/geo_homogeneous.cpp index cb14413f7..638fbec1e 100644 --- a/test/geo_homogeneous.cpp +++ b/test/geo_homogeneous.cpp @@ -112,6 +112,18 @@ void homogeneous(void) { VERIFY_IS_APPROX((t2.template triangularView() * v0.homogeneous()).eval(), (t2.template triangularView() * hv0)); + + { + const MatrixType points = MatrixType::Random(); + const VectorType center = VectorType::Random(); + + const auto pts3 = points.rowwise() - center.transpose(); + const auto pts_xy1 = pts3.template leftCols().rowwise().homogeneous(); + const auto pts_xy2 = pts3.template topRows().colwise().homogeneous(); + + VERIFY_IS_APPROX(pts_xy1.transpose() * pts_xy1, pts_xy1.transpose() * pts_xy1.eval()); + VERIFY_IS_APPROX(pts_xy2 * pts_xy2.transpose(), pts_xy2.eval() * pts_xy2.transpose()); + } } EIGEN_DECLARE_TEST(geo_homogeneous) {