diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-03-11 14:32:03 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-03-11 14:32:03 +0000 |
commit | c6264d9b7e238740885cbc16b01964a9f1930487 (patch) | |
tree | f3230661fe3ac534ab3702c1e14bccbbcdf48cb4 /Eigen/src/Geometry | |
parent | 02e97ac0ae8dabba3167b2fdc503633ae2c8f5e3 (diff) |
add affine * homogeneous vector for backward compatibility (e.g.,
kgllib)
Diffstat (limited to 'Eigen/src/Geometry')
-rw-r--r-- | Eigen/src/Geometry/Transform.h | 23 |
1 files changed, 23 insertions, 0 deletions
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<Other,Mode, Dim,HDim, Dim,1> { 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<typename Other, int Mode, int Dim, int HDim> +struct ei_transform_right_product_impl<Other,Mode, Dim,HDim, HDim,1> +{ + typedef Transform<typename Other::Scalar,Dim,Mode> TransformType; + typedef Matrix<typename Other::Scalar,HDim,1> ResultType; + static ResultType run(const TransformType& tr, const Other& other) + { return tr.matrix() * other; } +}; +template<typename Other, int Dim, int HDim> +struct ei_transform_right_product_impl<Other,AffineCompact, Dim,HDim, HDim,1> +{ + typedef Transform<typename Other::Scalar,Dim,AffineCompact> TransformType; + typedef Matrix<typename Other::Scalar,HDim,1> ResultType; + static ResultType run(const TransformType& tr, const Other& other) + { + ResultType res; + res.template start<HDim>() = tr.matrix() * other; + res.coeffRef(Dim) = other.coeff(Dim); + } +}; + // T * linear matrix => T template<typename Other, int Mode, int Dim, int HDim> struct ei_transform_right_product_impl<Other,Mode, Dim,HDim, Dim,Dim> |