From c6264d9b7e238740885cbc16b01964a9f1930487 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 11 Mar 2009 14:32:03 +0000 Subject: [PATCH] add affine * homogeneous vector for backward compatibility (e.g., kgllib) --- Eigen/src/Geometry/Transform.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 47e4b2925..186580ab4 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -1013,6 +1013,29 @@ struct ei_transform_right_product_impl { return tr.linear() * other + tr.translation(); } }; +// Affine * homogeneous column vector +// FIXME added for backward compatibility, but I'm not sure we should keep it +template +struct ei_transform_right_product_impl +{ + typedef Transform TransformType; + typedef Matrix ResultType; + static ResultType run(const TransformType& tr, const Other& other) + { return tr.matrix() * other; } +}; +template +struct ei_transform_right_product_impl +{ + typedef Transform TransformType; + typedef Matrix ResultType; + static ResultType run(const TransformType& tr, const Other& other) + { + ResultType res; + res.template start() = tr.matrix() * other; + res.coeffRef(Dim) = other.coeff(Dim); + } +}; + // T * linear matrix => T template struct ei_transform_right_product_impl