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();