diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h index a230044583f40ee21bf607cc147d406677a3703d..5955e496f659bd9f8273e08e627148accb55fabf 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 795af0d8d6e8fa9ba7dad71322d18c19bd07b62d..4159dc6d0cea999692aa3eda3a190dc1110dc00c 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 cb14413f71e6c256986f1c7c4a63dcea6bf69690..638fbec1ee839dbde3d3ebd11bff68803f9c21a0 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) {