|
19 | 19 |
|
20 | 20 | #include "eigenpy/fwd.hpp" |
21 | 21 |
|
| 22 | +// For old Eigen versions, EIGEN_DEVICE_FUNC is not defined. |
| 23 | +// We must define it just in the scope of this file. |
| 24 | +#if not EIGEN_VERSION_AT_LEAST(3,2,91) |
| 25 | +#define EIGEN_DEVICE_FUNC |
| 26 | +#endif |
| 27 | + |
22 | 28 | namespace eigenpy |
23 | 29 | { |
24 | 30 | template<typename MatType, int IsVectorAtCompileTime = MatType::IsVectorAtCompileTime> |
@@ -49,17 +55,21 @@ namespace eigenpy |
49 | 55 |
|
50 | 56 | typedef typename Eigen::internal::traits<Base>::Scalar Scalar; /*!< \brief Numeric type, e.g. float, double, int or std::complex<float>. */ \ |
51 | 57 | typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; /*!< \brief The underlying numeric type for composed scalar types. \details In cases where Scalar is e.g. std::complex<T>, T were corresponding to RealScalar. */ \ |
52 | | - typedef typename Base::CoeffReturnType CoeffReturnType; /*!< \brief The return type for coefficient access. \details Depending on whether the object allows direct coefficient access (e.g. for a MatrixXd), this type is either 'const Scalar&' or simply 'Scalar' for objects that do not allow direct coefficient access. */ \ |
53 | | - typedef typename Eigen::internal::ref_selector<Base>::type Nested; \ |
54 | | - typedef typename Eigen::internal::traits<Base>::StorageKind StorageKind; \ |
55 | | - typedef typename Eigen::internal::traits<Base>::StorageIndex StorageIndex; \ |
56 | | - enum { RowsAtCompileTime = Eigen::internal::traits<Base>::RowsAtCompileTime, \ |
57 | | - ColsAtCompileTime = Eigen::internal::traits<Base>::ColsAtCompileTime, \ |
58 | | - Flags = Eigen::internal::traits<Base>::Flags, \ |
59 | | - SizeAtCompileTime = Base::SizeAtCompileTime, \ |
60 | | - MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \ |
61 | | - IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; \ |
62 | | - using Base::derived; \ |
| 58 | + typedef typename Base::CoeffReturnType CoeffReturnType; /*!< \brief The return type for coefficient access. \details Depending on whether the object allows direct coefficient access (e.g. for a MatrixXd), this type is either 'const Scalar&' or simply 'Scalar' for objects that do not allow direct coefficient access. */ |
| 59 | + typedef typename Eigen::internal::ref_selector<Base>::type Nested; |
| 60 | + typedef typename Eigen::internal::traits<Base>::StorageKind StorageKind; |
| 61 | +#if EIGEN_VERSION_AT_LEAST(3,2,91) |
| 62 | + typedef typename Eigen::internal::traits<Base>::StorageIndex StorageIndex; |
| 63 | +#else |
| 64 | + typedef typename Eigen::internal::traits<Base>::Index StorageIndex; |
| 65 | +#endif |
| 66 | + enum { RowsAtCompileTime = Eigen::internal::traits<Base>::RowsAtCompileTime, |
| 67 | + ColsAtCompileTime = Eigen::internal::traits<Base>::ColsAtCompileTime, |
| 68 | + Flags = Eigen::internal::traits<Base>::Flags, |
| 69 | + SizeAtCompileTime = Base::SizeAtCompileTime, |
| 70 | + MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, |
| 71 | + IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; |
| 72 | + using Base::derived; |
63 | 73 | using Base::const_cast_derived; |
64 | 74 | typedef typename Base::PacketScalar PacketScalar; |
65 | 75 |
|
@@ -94,4 +104,8 @@ namespace eigenpy |
94 | 104 | }; // struct Ref<PlainObjectType> |
95 | 105 | } |
96 | 106 |
|
| 107 | +#if not EIGEN_VERSION_AT_LEAST(3,2,91) |
| 108 | +#undef EIGEN_DEVICE_FUNC |
| 109 | +#endif |
| 110 | + |
97 | 111 | #endif // ifndef __eigenpy_ref_hpp__ |
0 commit comments