aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Geometry
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-09-23 13:41:21 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-09-23 13:41:21 +0200
commit86caba838db00ed977ed160a893d0a749856a215 (patch)
treefe2ee2a836e931e97ac245ed65eb2f744df064c4 /Eigen/src/Geometry
parentb9f7a17e47b88bb2b63909e9863148b42e8d8c15 (diff)
bug #1304: fix Projective * scaling and Projective *= scaling
Diffstat (limited to 'Eigen/src/Geometry')
-rw-r--r--Eigen/src/Geometry/Transform.h6
-rw-r--r--Eigen/src/Geometry/Translation.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h
index db5fd07c3..8f6c62d63 100644
--- a/Eigen/src/Geometry/Transform.h
+++ b/Eigen/src/Geometry/Transform.h
@@ -464,7 +464,7 @@ public:
operator * (const DiagonalBase<DiagonalDerived> &b) const
{
TransformTimeDiagonalReturnType res(*this);
- res.linear() *= b;
+ res.linearExt() *= b;
return res;
}
@@ -578,7 +578,7 @@ public:
return res;
}
- inline Transform& operator*=(const DiagonalMatrix<Scalar,Dim>& s) { linear() *= s; return *this; }
+ inline Transform& operator*=(const DiagonalMatrix<Scalar,Dim>& s) { linearExt() *= s; return *this; }
template<typename Derived>
inline Transform& operator=(const RotationBase<Derived,Dim>& r);
@@ -853,7 +853,7 @@ Transform<Scalar,Dim,Mode,Options>::prescale(const MatrixBase<OtherDerived> &oth
{
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim))
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
- m_matrix.template block<Dim,HDim>(0,0).noalias() = (other.asDiagonal() * m_matrix.template block<Dim,HDim>(0,0));
+ affine().noalias() = (other.asDiagonal() * affine());
return *this;
}
diff --git a/Eigen/src/Geometry/Translation.h b/Eigen/src/Geometry/Translation.h
index 82d7777f0..b9b9a590c 100644
--- a/Eigen/src/Geometry/Translation.h
+++ b/Eigen/src/Geometry/Translation.h
@@ -130,8 +130,10 @@ public:
}
/** Applies translation to vector */
- inline VectorType operator* (const VectorType& other) const
- { return m_coeffs + other; }
+ template<typename Derived>
+ inline typename internal::enable_if<Derived::IsVectorAtCompileTime,VectorType>::type
+ operator* (const MatrixBase<Derived>& vec) const
+ { return m_coeffs + vec.derived(); }
/** \returns the inverse translation (opposite) */
Translation inverse() const { return Translation(-m_coeffs); }