From 3f24dbf6f53325b3317a59187fb4697f72e52512 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 19 Nov 2010 14:45:45 +0100 Subject: [PATCH] fix compilation of transform * scaling --- Eigen/src/Core/DiagonalMatrix.h | 1 + Eigen/src/Geometry/Transform.h | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index af16cf563..7b105b299 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -46,6 +46,7 @@ class DiagonalBase : public EigenBase }; typedef Matrix DenseMatrixType; + typedef DiagonalMatrix PlainObject; inline const Derived& derived() const { return *static_cast(this); } inline Derived& derived() { return *static_cast(this); } diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index dfcb4a3f7..8bc2f41bd 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -380,10 +380,11 @@ public: * product results in a Transform of the same type (mode) as the lhs only if the lhs * mode is no isometry. In that case, the returned transform is an affinity. */ - friend inline const Transform - operator * (const Transform &a, const DiagonalMatrix &b) + template + inline const Transform + operator * (const DiagonalBase &b) const { - Transform res(a); + Transform res(*this); res.linear() *= b; return res; } @@ -394,8 +395,9 @@ public: * product results in a Transform of the same type (mode) as the lhs only if the lhs * mode is no isometry. In that case, the returned transform is an affinity. */ + template friend inline const Transform - operator * (const DiagonalMatrix &a, const Transform &b) + operator * (const DiagonalBase &a, const Transform &b) { Transform res; res.linear().noalias() = a*b.linear();