29 #ifndef mrpt_utils_types_H
30 #define mrpt_utils_types_H
53 #ifdef EIGEN_MAJOR_VERSION
54 # error **FATAL ERROR**: MRPT headers must be included before Eigen headers.
56 #ifndef EIGEN_USE_NEW_STDVECTOR
57 # define EIGEN_USE_NEW_STDVECTOR
59 #include <Eigen/Dense>
60 #include <Eigen/StdVector>
61 #include <Eigen/StdDeque>
63 #if !EIGEN_VERSION_AT_LEAST(2,90,0)
64 #error MRPT needs version 3.0.0-beta of Eigen or newer
68 #include EIGEN_MATRIXBASE_PLUGIN_POST_IMPL
75 #define MRPT_EIGEN_DERIVED_CLASS_CTOR_OPERATOR_EQUAL(_CLASS_) \
77 template<typename OtherDerived> \
78 inline mrpt_autotype & operator= (const Eigen::MatrixBase <OtherDerived>& other) { \
80 Base::operator=(other); \
84 template<typename OtherDerived> \
85 inline _CLASS_(const Eigen::MatrixBase <OtherDerived>& other) : Base(other.template cast<typename Base::Scalar>()) { } \
96 typedef Eigen::Matrix<T,Eigen::Dynamic,1>
Base;
107 template <
typename R>
110 inline void resize(
const size_t N,
const T default_val) { Base::derived().resize(N,1); Base::derived().setConstant(default_val); }
112 inline void resize(
const size_t N) { Base::derived().conservativeResize(N); }
134 template <
class TYPE1,
class TYPE2=TYPE1>
138 typedef std::vector<TYPE1, Eigen::aligned_allocator<TYPE1> >
vector_t;
139 typedef std::deque<TYPE1, Eigen::aligned_allocator<TYPE1> >
deque_t;
140 typedef std::list<TYPE1, Eigen::aligned_allocator<TYPE1> >
list_t;
141 typedef std::map<TYPE1,TYPE2,std::less<TYPE1>,Eigen::aligned_allocator<std::pair<const TYPE1,TYPE2> > >
map_t;
142 typedef std::multimap<TYPE1,TYPE2,std::less<TYPE1>,Eigen::aligned_allocator<std::pair<const TYPE1,TYPE2> > >
multimap_t;
149 #if defined(_MSC_VER) && (_MSC_VER>=1300)
157 #define INVALID_NODEID static_cast<TNodeID>(-1)