From 702a3c17db753b4ceaa234eac6591d0d1737015a Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 31 Jul 2014 14:54:00 +0200 Subject: [PATCH] Make Transform exposes sizes: Dim+1 x Dim+1 for projective transform, and Dim x Dim+1 for all others --- Eigen/src/Geometry/Transform.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 54d05f9cf..a62548f12 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -70,10 +70,11 @@ struct traits > typedef DenseIndex Index; typedef Dense StorageKind; enum { - RowsAtCompileTime = _Dim, - ColsAtCompileTime = _Dim, - MaxRowsAtCompileTime = _Dim, - MaxColsAtCompileTime = _Dim, + Dim1 = _Dim==Dynamic ? _Dim : _Dim + 1, + RowsAtCompileTime = _Mode==Projective ? Dim1 : _Dim, + ColsAtCompileTime = Dim1, + MaxRowsAtCompileTime = RowsAtCompileTime, + MaxColsAtCompileTime = ColsAtCompileTime, Flags = 0 }; }; @@ -374,7 +375,7 @@ public: #endif #ifdef EIGEN_TEST_EVALUATORS - Index rows() const { return m_matrix.cols(); } + Index rows() const { return Mode==Projective ? m_matrix.cols() : m_matrix.cols()-1; } Index cols() const { return m_matrix.cols(); } #endif