diff options
-rw-r--r-- | Eigen/src/Core/util/StaticAssert.h | 3 | ||||
-rw-r--r-- | Eigen/src/Geometry/AngleAxis.h | 2 | ||||
-rw-r--r-- | Eigen/src/Geometry/Rotation2D.h | 2 | ||||
-rw-r--r-- | Eigen/src/Geometry/Transform.h | 16 |
4 files changed, 17 insertions, 6 deletions
diff --git a/Eigen/src/Core/util/StaticAssert.h b/Eigen/src/Core/util/StaticAssert.h index bf686975b..f1d9d7b3d 100644 --- a/Eigen/src/Core/util/StaticAssert.h +++ b/Eigen/src/Core/util/StaticAssert.h @@ -86,7 +86,8 @@ YOU_ALREADY_SPECIFIED_THIS_STRIDE, INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION, THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD, - PACKET_ACCESS_REQUIRES_TO_HAVE_INNER_STRIDE_FIXED_TO_1 + PACKET_ACCESS_REQUIRES_TO_HAVE_INNER_STRIDE_FIXED_TO_1, + THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS }; }; diff --git a/Eigen/src/Geometry/AngleAxis.h b/Eigen/src/Geometry/AngleAxis.h index af47cc27d..8319aa6f1 100644 --- a/Eigen/src/Geometry/AngleAxis.h +++ b/Eigen/src/Geometry/AngleAxis.h @@ -142,6 +142,8 @@ public: m_angle = Scalar(other.angle()); } + inline static const AngleAxis Identity() { return AngleAxis(0, Vector3::UnitX()); } + /** \returns \c true if \c *this is approximately equal to \a other, within the precision * determined by \a prec. * diff --git a/Eigen/src/Geometry/Rotation2D.h b/Eigen/src/Geometry/Rotation2D.h index 7872c003b..c65b4b6e0 100644 --- a/Eigen/src/Geometry/Rotation2D.h +++ b/Eigen/src/Geometry/Rotation2D.h @@ -117,6 +117,8 @@ public: m_angle = Scalar(other.angle()); } + inline static Rotation2D Identity() { return Rotation2D(0); } + /** \returns \c true if \c *this is approximately equal to \a other, within the precision * determined by \a prec. * diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 68fda1323..083491f7d 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -202,7 +202,7 @@ protected: public: - /** Default constructor without initialization of the meaningfull coefficients. + /** Default constructor without initialization of the meaningful coefficients. * If Mode==Affine, then the last row is set to [0 ... 0 1] */ inline Transform() { @@ -271,10 +271,10 @@ public: #endif /** shortcut for m_matrix(row,col); - * \sa MatrixBase::operaror(Index,Index) const */ + * \sa MatrixBase::operator(Index,Index) const */ inline Scalar operator() (Index row, Index col) const { return m_matrix(row,col); } /** shortcut for m_matrix(row,col); - * \sa MatrixBase::operaror(Index,Index) */ + * \sa MatrixBase::operator(Index,Index) */ inline Scalar& operator() (Index row, Index col) { return m_matrix(row,col); } /** \returns a read-only expression of the transformation matrix */ @@ -329,13 +329,13 @@ public: template<typename OtherDerived> inline Transform& operator*=(const EigenBase<OtherDerived>& other) { return *this = *this * other; } - /** Contatenates two transformations */ + /** Concatenates two transformations */ inline const Transform operator * (const Transform& other) const { return ei_transform_transform_product_impl<Transform,Transform>::run(*this,other); } - /** Contatenates two different transformations */ + /** Concatenates two different transformations */ template<int OtherMode> inline const typename ei_transform_transform_product_impl< Transform,Transform<Scalar,Dim,OtherMode> >::ResultType @@ -618,6 +618,7 @@ Transform<Scalar,Dim,Mode>& Transform<Scalar,Dim,Mode>::scale(const MatrixBase<OtherDerived> &other) { EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim)) + EIGEN_STATIC_ASSERT(Mode!=Isometry, THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS) linearExt().noalias() = (linearExt() * other.asDiagonal()); return *this; } @@ -629,6 +630,7 @@ Transform<Scalar,Dim,Mode>::scale(const MatrixBase<OtherDerived> &other) template<typename Scalar, int Dim, int Mode> inline Transform<Scalar,Dim,Mode>& Transform<Scalar,Dim,Mode>::scale(Scalar s) { + EIGEN_STATIC_ASSERT(Mode!=Isometry, THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS) linearExt() *= s; return *this; } @@ -643,6 +645,7 @@ Transform<Scalar,Dim,Mode>& Transform<Scalar,Dim,Mode>::prescale(const MatrixBase<OtherDerived> &other) { EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim)) + EIGEN_STATIC_ASSERT(Mode!=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)); return *this; } @@ -654,6 +657,7 @@ Transform<Scalar,Dim,Mode>::prescale(const MatrixBase<OtherDerived> &other) template<typename Scalar, int Dim, int Mode> inline Transform<Scalar,Dim,Mode>& Transform<Scalar,Dim,Mode>::prescale(Scalar s) { + EIGEN_STATIC_ASSERT(Mode!=Isometry, THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS) m_matrix.template topRows<Dim>() *= s; return *this; } @@ -742,6 +746,7 @@ Transform<Scalar,Dim,Mode>& Transform<Scalar,Dim,Mode>::shear(Scalar sx, Scalar sy) { EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE) + EIGEN_STATIC_ASSERT(Mode!=Isometry, THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS) VectorType tmp = linear().col(0)*sy + linear().col(1); linear() << linear().col(0) + linear().col(1)*sx, tmp; return *this; @@ -757,6 +762,7 @@ Transform<Scalar,Dim,Mode>& Transform<Scalar,Dim,Mode>::preshear(Scalar sx, Scalar sy) { EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE) + EIGEN_STATIC_ASSERT(Mode!=Isometry, THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS) m_matrix.template block<Dim,HDim>(0,0) = LinearMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0); return *this; } |