5 #ifndef __eigenpy_fwd_hpp__
6 #define __eigenpy_fwd_hpp__
9 #define EIGENPY_CLANG_COMPILER
10 #elif defined(__GNUC__)
11 #define EIGENPY_GCC_COMPILER
12 #elif defined(_MSC_VER)
13 #define EIGENPY_MSVC_COMPILER
16 #if (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703))
17 #define EIGENPY_WITH_CXX17_SUPPORT
20 #if (__cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201403))
21 #define EIGENPY_WITH_CXX14_SUPPORT
24 #if (__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
25 #define EIGENPY_WITH_CXX11_SUPPORT
28 #define EIGENPY_STRING_LITERAL(string) #string
29 #define EIGENPY_STRINGIZE(string) EIGENPY_STRING_LITERAL(string)
30 #define _EIGENPY_PPCAT(A, B) A##B
31 #define EIGENPY_PPCAT(A, B) _EIGENPY_PPCAT(A, B)
32 #define EIGENPY_STRINGCAT(A, B) A B
36 #if defined(EIGENPY_CLANG_COMPILER) || defined(EIGENPY_GCC_COMPILER)
37 #define EIGENPY_PRAGMA(x) _Pragma(#x)
38 #define EIGENPY_PRAGMA_MESSAGE(the_message) \
39 EIGENPY_PRAGMA(GCC message the_message)
40 #define EIGENPY_PRAGMA_WARNING(the_message) \
41 EIGENPY_PRAGMA(GCC warning the_message)
42 #define EIGENPY_PRAGMA_DEPRECATED(the_message) \
43 EIGENPY_PRAGMA_WARNING(Deprecated : the_message)
44 #define EIGENPY_PRAGMA_DEPRECATED_HEADER(old_header, new_header) \
45 EIGENPY_PRAGMA_WARNING( \
46 Deprecated header file \
47 : #old_header has been replaced \
48 by #new_header.\n Please use #new_header instead of #old_header.)
50 #define EIGENPY_PRAGMA(x) __pragma(#x)
51 #define EIGENPY_PRAGMA_MESSAGE(the_message) \
52 EIGENPY_PRAGMA(message(#the_message))
53 #define EIGENPY_PRAGMA_WARNING(the_message) \
54 EIGENPY_PRAGMA(message(EIGENPY_STRINGCAT("WARNING: ", the_message)))
57 #define EIGENPY_DEPRECATED_MACRO(macro, the_message) \
58 EIGENPY_PRAGMA_WARNING( \
59 EIGENPY_STRINGCAT("this macro is deprecated: ", the_message))
60 #define EIGENPY_DEPRECATED_FILE(the_message) \
61 EIGENPY_PRAGMA_WARNING( \
62 EIGENPY_STRINGCAT("this file is deprecated: ", the_message))
64 #define EIGENPY_DOCUMENTATION_START_IGNORE
65 #define EIGENPY_DOCUMENTATION_END_IGNORE
67 #include "eigenpy/config.hpp"
72 #define BOOST_BIND_GLOBAL_PLACEHOLDERS
73 #include <boost/python.hpp>
74 #include <boost/python/scope.hpp>
76 #include <type_traits>
85 #define NO_IMPORT_ARRAY
87 #undef NO_IMPORT_ARRAY
89 #undef BOOST_BIND_GLOBAL_PLACEHOLDERS
92 #include <Eigen/Geometry>
94 #ifdef EIGENPY_WITH_CXX11_SUPPORT
95 #include <unsupported/Eigen/CXX11/Tensor>
96 #define EIGENPY_WITH_TENSOR_SUPPORT
99 #if EIGEN_VERSION_AT_LEAST(3, 2, 90)
100 #define EIGENPY_DEFAULT_ALIGNMENT_VALUE Eigen::Aligned16
102 #define EIGENPY_DEFAULT_ALIGNMENT_VALUE Eigen::Aligned
105 #define EIGENPY_DEFAULT_ALIGN_BYTES EIGEN_DEFAULT_ALIGN_BYTES
107 #define EIGENPY_NO_ALIGNMENT_VALUE Eigen::Unaligned
109 #define EIGENPY_UNUSED_VARIABLE(var) (void)(var)
110 #define EIGENPY_UNUSED_TYPE(type) EIGENPY_UNUSED_VARIABLE((type *)(NULL))
112 #ifdef EIGENPY_WITH_CXX11_SUPPORT
114 #define EIGENPY_SHARED_PTR_HOLDER_TYPE(T) ::std::shared_ptr<T>
116 #include <boost/shared_ptr.hpp>
117 #define EIGENPY_SHARED_PTR_HOLDER_TYPE(T) ::boost::shared_ptr<T>
121 template <
typename MatType,
123 typename boost::remove_reference<MatType>::type::Scalar>
125 template <
typename MatType,
127 typename boost::remove_reference<MatType>::type::Scalar>
130 template <
typename T>
132 typedef typename boost::remove_const<
136 template <
typename EigenType>
139 typedef typename boost::mpl::if_<
140 boost::is_base_of<Eigen::MatrixBase<EigenType_>,
EigenType_>,
141 Eigen::MatrixBase<EigenType_>
142 #ifdef EIGENPY_WITH_TENSOR_SUPPORT
144 typename boost::mpl::if_<
145 boost::is_base_of<Eigen::TensorBase<EigenType_>,
EigenType_>,
146 Eigen::TensorBase<EigenType_>,
void>
::type
153 typedef typename boost::mpl::if_<
154 boost::is_const<typename boost::remove_reference<EigenType>::type>,
158 template <
typename EigenType>
161 template <
typename MatType,
int Options,
typename Str
ide>
163 typedef typename Eigen::internal::traits<
164 Eigen::Ref<MatType, Options, Stride> >::PlainObjectType
type;
167 #ifdef EIGENPY_WITH_TENSOR_SUPPORT
168 template <
typename TensorType>
170 typedef TensorType type;
175 template <
class T1,
class T2>
177 template <
class U,
class V>
178 static auto check(U *) -> decltype(std::declval<U>() == std::declval<V>());
179 template <
typename,
typename>
180 static auto check(...) -> std::false_type;
182 using type =
typename std::is_same<bool, decltype(check<T1, T2>(0))>::
type;
186 template <
class T1,
class T2 = T1>
193 #endif // ifndef __eigenpy_fwd_hpp__