aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Geometry/RotationBase.h
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-08-19 19:25:35 +0200
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-08-19 19:25:35 +0200
commit55c7848877bb7959e166af08980698d08bc57bc3 (patch)
tree419d930d49b6b5c816718cff99b95a431535f3ee /Eigen/src/Geometry/RotationBase.h
parentd4b664c4cdcbfd5d4fe4cfbb59c1d6e735b3e469 (diff)
Matrix product refactoring (rhs products only).
Added strong inlines required for MSVC for proper inlining. Added specializations for DiagonalMatrix products to RotationBase. Added left- and righ-hand-side products with DiagonalMatrix to Transform. RHS Transform products now return Matrix objects only. Split the geo_transformations unit test. Some tests were not made for projectivities. Removed unused variables from main.h that caused warnings.
Diffstat (limited to 'Eigen/src/Geometry/RotationBase.h')
-rw-r--r--Eigen/src/Geometry/RotationBase.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/Eigen/src/Geometry/RotationBase.h b/Eigen/src/Geometry/RotationBase.h
index 36f17584f..181e65be9 100644
--- a/Eigen/src/Geometry/RotationBase.h
+++ b/Eigen/src/Geometry/RotationBase.h
@@ -56,8 +56,8 @@ class RotationBase
inline RotationMatrixType toRotationMatrix() const { return derived().toRotationMatrix(); }
/** \returns an equivalent rotation matrix
- * This function is added to be conform with the Transform class' naming scheme.
- */
+ * This function is added to be conform with the Transform class' naming scheme.
+ */
inline RotationMatrixType matrix() const { return derived().toRotationMatrix(); }
/** \returns the inverse rotation */
@@ -87,6 +87,14 @@ class RotationBase
inline RotationMatrixType operator*(const EigenBase<OtherDerived>& l, const Derived& r)
{ return l.derived() * r.toRotationMatrix(); }
+ /** \returns the concatenation of a scaling \a l with the rotation \a r */
+ friend inline Transform<Scalar,Dim,Affine> operator*(const DiagonalMatrix<Scalar,Dim>& l, const Derived& r)
+ {
+ Transform<Scalar,Dim,Affine> res(r);
+ res.linear().applyOnTheLeft(l);
+ return res;
+ }
+
/** \returns the concatenation of the rotation \c *this with a transformation \a t */
template<int Mode>
inline Transform<Scalar,Dim,Mode> operator*(const Transform<Scalar,Dim,Mode>& t) const
@@ -107,6 +115,18 @@ struct ei_rotation_base_generic_product_selector<RotationDerived,MatrixType,fals
{ return r.toRotationMatrix() * m; }
};
+template<typename RotationDerived, typename Scalar, int Dim, int MaxDim>
+struct ei_rotation_base_generic_product_selector< RotationDerived, DiagonalMatrix<Scalar,Dim,MaxDim>, false >
+{
+ typedef Transform<Scalar,Dim,Affine> ReturnType;
+ inline static ReturnType run(const RotationDerived& r, const DiagonalMatrix<Scalar,Dim,MaxDim>& m)
+ {
+ ReturnType res(r);
+ res.linear() *= m;
+ return res;
+ }
+};
+
template<typename RotationDerived,typename OtherVectorType>
struct ei_rotation_base_generic_product_selector<RotationDerived,OtherVectorType,true>
{