38 #ifndef FCL_DATA_TYPES_H 39 #define FCL_DATA_TYPES_H 46 #include <Eigen/Dense> 47 #include <Eigen/StdVector> 48 #include "fcl/common/deprecated.h" 53 typedef FCL_DEPRECATED
double FCL_REAL;
54 typedef FCL_DEPRECATED std::int64_t FCL_INT64;
55 typedef FCL_DEPRECATED std::uint64_t FCL_UINT64;
56 typedef FCL_DEPRECATED std::int32_t FCL_INT32;
57 typedef FCL_DEPRECATED std::uint32_t FCL_UINT32;
59 using int64 = std::int64_t;
60 using uint64 = std::uint64_t;
61 using int32 = std::int32_t;
62 using uint32 = std::uint32_t;
65 using Vector2 = Eigen::Matrix<S, 2, 1>;
68 using Vector3 = Eigen::Matrix<S, 3, 1>;
71 using Vector6 = Eigen::Matrix<S, 6, 1>;
74 using Vector7 = Eigen::Matrix<S, 7, 1>;
76 template <
typename S,
int N>
77 using VectorN = Eigen::Matrix<S, N, 1>;
80 using VectorX = Eigen::Matrix<S, Eigen::Dynamic, 1>;
83 using Matrix3 = Eigen::Matrix<S, 3, 3>;
86 using Quaternion = Eigen::Quaternion<S>;
89 using Transform3 = Eigen::Transform<S, 3, Eigen::AffineCompact>;
92 using Translation3 = Eigen::Translation<S, 3>;
95 using AngleAxis = Eigen::AngleAxis<S>;
98 using Vector3f = Vector3<float>;
100 using VectorNf = VectorN<float, N>;
101 using VectorXf = VectorX<float>;
102 using Matrix3f = Matrix3<float>;
103 using Quaternionf = Quaternion<float>;
104 using Transform3f = Transform3<float>;
105 using Translation3f = Translation3<float>;
106 using AngleAxisf = AngleAxis<float>;
109 using Vector3d = Vector3<double>;
111 using VectorNd = VectorN<double, N>;
112 using VectorXd = VectorX<double>;
113 using Matrix3d = Matrix3<double>;
114 using Quaterniond = Quaternion<double>;
115 using Transform3d = Transform3<double>;
116 using Translation3d = Translation3<double>;
117 using AngleAxisd = AngleAxis<double>;
123 template <
typename _Tp>
124 using aligned_vector = std::vector<_Tp, Eigen::aligned_allocator<_Tp>>;
126 template <
typename _Key,
typename _Tp,
typename _Compare = std::less<_Key>>
127 using aligned_map = std::map<_Key, _Tp, _Compare,
128 Eigen::aligned_allocator<std::pair<const _Key, _Tp>>>;
130 #if EIGEN_VERSION_AT_LEAST(3,2,1) 137 class aligned_allocator_cpp11 :
public std::allocator<T>
140 typedef std::size_t size_type;
141 typedef std::ptrdiff_t difference_type;
143 typedef const T* const_pointer;
144 typedef T& reference;
145 typedef const T& const_reference;
146 typedef T value_type;
151 typedef aligned_allocator_cpp11<U> other;
154 aligned_allocator_cpp11()
155 : std::allocator<T>() {}
157 aligned_allocator_cpp11(
const aligned_allocator_cpp11& other)
158 : std::allocator<T>(other) {}
161 aligned_allocator_cpp11(
const aligned_allocator_cpp11<U>& other)
162 : std::allocator<T>(other) {}
164 ~aligned_allocator_cpp11() {}
166 pointer allocate(size_type num,
const void* = 0)
168 internal::check_size_for_overflow<T>(num);
169 return static_cast<pointer
>( internal::aligned_malloc(num *
sizeof(T)) );
172 void deallocate(pointer p, size_type )
174 internal::aligned_free(p);
178 template <
typename _Tp,
typename... _Args>
179 inline std::shared_ptr<_Tp> make_aligned_shared(_Args&&... __args)
181 typedef typename std::remove_const<_Tp>::type _Tp_nc;
182 return std::allocate_shared<_Tp>(Eigen::aligned_allocator_cpp11<_Tp_nc>(),
183 std::forward<_Args>(__args)...);
188 template <
typename _Tp,
typename... _Args>
189 inline std::shared_ptr<_Tp> make_aligned_shared(_Args&&... __args)
191 typedef typename std::remove_const<_Tp>::type _Tp_nc;
192 return std::allocate_shared<_Tp>(Eigen::aligned_allocator<_Tp_nc>(),
193 std::forward<_Args>(__args)...);
Main namespace.
Definition: broadphase_bruteforce-inl.h:45