diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-11-19 14:45:45 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-11-19 14:45:45 +0100 |
commit | 3f24dbf6f53325b3317a59187fb4697f72e52512 (patch) | |
tree | eefafacbff52856d12b572cb072d09adba197a6f /Eigen | |
parent | 3e99356b59ea194599cb80adb7b10989d6f4a54a (diff) |
fix compilation of transform * scaling
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/DiagonalMatrix.h | 1 | ||||
-rw-r--r-- | 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<Derived> }; typedef Matrix<Scalar, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTime> DenseMatrixType; + typedef DiagonalMatrix<Scalar,DiagonalVectorType::SizeAtCompileTime,DiagonalVectorType::MaxSizeAtCompileTime> PlainObject; inline const Derived& derived() const { return *static_cast<const Derived*>(this); } inline Derived& derived() { return *static_cast<Derived*>(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<Scalar,Dim,((Mode==(int)Isometry)?Affine:(int)Mode)> - operator * (const Transform &a, const DiagonalMatrix<Scalar,Dim> &b) + template<typename DiagonalDerived> + inline const Transform<Scalar,Dim,((Mode==(int)Isometry)?Affine:(int)Mode)> + operator * (const DiagonalBase<DiagonalDerived> &b) const { - Transform<Scalar,Dim,((Mode==(int)Isometry)?Affine:(int)Mode)> res(a); + Transform<Scalar,Dim,((Mode==(int)Isometry)?Affine:(int)Mode)> 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<typename DiagonalDerived> friend inline const Transform<Scalar,Dim,((Mode==(int)Isometry)?Affine:(int)Mode)> - operator * (const DiagonalMatrix<Scalar,Dim> &a, const Transform &b) + operator * (const DiagonalBase<DiagonalDerived> &a, const Transform &b) { Transform<Scalar,Dim,((Mode==(int)Isometry)?Affine:(int)Mode)> res; res.linear().noalias() = a*b.linear(); |