diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-06-24 15:13:41 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-06-24 15:13:41 +0200 |
commit | 19f2f53e2c6cac602be479dae84837ab539329ce (patch) | |
tree | 3d6a540eabc3a7abc7ff709eec9fe5e8c2a34b85 /Eigen/src/Core | |
parent | d44fce501bf299692d578349b92c899c3f0d79cd (diff) |
fix compilation when default to row major
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r-- | Eigen/src/Core/MatrixBase.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/util/XprHelper.h | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index f481c19fb..6674bc65f 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -129,7 +129,7 @@ template<typename Derived> class MatrixBase Transpose<Derived> >::ret AdjointReturnType; /** \internal Return type of eigenvalues() */ - typedef Matrix<std::complex<RealScalar>, ei_traits<Derived>::ColsAtCompileTime, 1> EigenvaluesReturnType; + typedef Matrix<std::complex<RealScalar>, ei_traits<Derived>::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType; /** \internal the return type of identity */ typedef CwiseNullaryOp<ei_scalar_identity_op<Scalar>,Derived> IdentityReturnType; /** \internal the return type of unit vectors */ diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index 54f15712c..a9cbbfe50 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -91,6 +91,26 @@ template<typename T> struct ei_unpacket_traits enum {size=1}; }; +template<typename _Scalar, int _Rows, int _Cols, + int _Options = AutoAlign | + ( (_Rows==1 && _Cols!=1) ? RowMajor + : (_Cols==1 && _Rows!=1) ? ColMajor + : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ), + int _MaxRows = _Rows, + int _MaxCols = _Cols +> class ei_make_proper_matrix_type +{ + enum { + IsColVector = _Cols==1 && _Rows!=1, + IsRowVector = _Rows==1 && _Cols!=1, + Options = IsColVector ? (_Options | ColMajor) & ~RowMajor + : IsRowVector ? (_Options | RowMajor) & ~ColMajor + : _Options + }; + public: + typedef Matrix<_Scalar, _Rows, _Cols, Options, _MaxRows, _MaxCols> type; +}; + template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols> class ei_compute_matrix_flags { |