Workarounf nvcc not being able to find RowMajor when declaring a Matrix<...> inside another namespace.

This commit is contained in:
Gael Guennebaud 2013-06-25 10:08:50 +02:00
parent 64054ee396
commit 231d4a6fda
2 changed files with 10 additions and 10 deletions

View File

@ -57,12 +57,12 @@ template<typename _Scalar, int _Rows, int _Cols,
// differently and this makes gcc 3.4.6 happy, but it's ugly. // differently and this makes gcc 3.4.6 happy, but it's ugly.
// The error would only show up with EIGEN_DEFAULT_TO_ROW_MAJOR is defined // The error would only show up with EIGEN_DEFAULT_TO_ROW_MAJOR is defined
// (when EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION is RowMajor) // (when EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION is RowMajor)
( (_Rows==1 && _Cols!=1) ? RowMajor ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
: !(_Cols==1 && _Rows!=1) ? EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION : !(_Cols==1 && _Rows!=1) ? EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
: ColMajor ), : Eigen::ColMajor ),
#else #else
( (_Rows==1 && _Cols!=1) ? RowMajor ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
: (_Cols==1 && _Rows!=1) ? ColMajor : (_Cols==1 && _Rows!=1) ? Eigen::ColMajor
: EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ), : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ),
#endif #endif
int _MaxRows = _Rows, int _MaxRows = _Rows,
@ -198,12 +198,12 @@ template<typename _Scalar, int _Rows, int _Cols,
// differently and this makes gcc 3.4.6 happy, but it's ugly. // differently and this makes gcc 3.4.6 happy, but it's ugly.
// The error would only show up with EIGEN_DEFAULT_TO_ROW_MAJOR is defined // The error would only show up with EIGEN_DEFAULT_TO_ROW_MAJOR is defined
// (when EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION is RowMajor) // (when EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION is RowMajor)
( (_Rows==1 && _Cols!=1) ? RowMajor ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
: !(_Cols==1 && _Rows!=1) ? EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION : !(_Cols==1 && _Rows!=1) ? EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
: ColMajor ), : Eigen::ColMajor ),
#else #else
( (_Rows==1 && _Cols!=1) ? RowMajor ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
: (_Cols==1 && _Rows!=1) ? ColMajor : (_Cols==1 && _Rows!=1) ? Eigen::ColMajor
: EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ), : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ),
#endif #endif
int _MaxRows = _Rows, int _MaxCols = _Cols> class Array; int _MaxRows = _Rows, int _MaxCols = _Cols> class Array;

View File

@ -87,9 +87,9 @@
#endif #endif
#ifdef EIGEN_DEFAULT_TO_ROW_MAJOR #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
#define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION RowMajor #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::RowMajor
#else #else
#define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ColMajor #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::ColMajor
#endif #endif
#ifndef EIGEN_DEFAULT_DENSE_INDEX_TYPE #ifndef EIGEN_DEFAULT_DENSE_INDEX_TYPE