fwd.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2023 CNRS INRIA
3  */
4 
5 #ifndef __eigenpy_fwd_hpp__
6 #define __eigenpy_fwd_hpp__
7 
8 #if defined(__clang__)
9 #define EIGENPY_CLANG_COMPILER
10 #elif defined(__GNUC__)
11 #define EIGENPY_GCC_COMPILER
12 #elif defined(_MSC_VER)
13 #define EIGENPY_MSVC_COMPILER
14 #endif
15 
16 #if (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703))
17 #define EIGENPY_WITH_CXX17_SUPPORT
18 #endif
19 
20 #if (__cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201403))
21 #define EIGENPY_WITH_CXX14_SUPPORT
22 #endif
23 
24 #if (__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
25 #define EIGENPY_WITH_CXX11_SUPPORT
26 #endif
27 
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
33 
34 // For more details, visit
35 // https://stackoverflow.com/questions/171435/portability-of-warning-preprocessor-directive
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.)
49 #elif defined(WIN32)
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)))
55 #endif
56 
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))
63 
64 #define EIGENPY_DOCUMENTATION_START_IGNORE
65 #define EIGENPY_DOCUMENTATION_END_IGNORE
66 
67 #include "eigenpy/config.hpp"
68 
69 // Silence a warning about a deprecated use of boost bind by boost python
70 // at least fo boost 1.73 to 1.75
71 // ref. https://github.com/stack-of-tasks/tsid/issues/128
72 #define BOOST_BIND_GLOBAL_PLACEHOLDERS
73 #include <boost/python.hpp>
74 #include <boost/python/scope.hpp>
75 
76 namespace eigenpy {
77 
78 namespace bp = boost::python;
79 
80 }
81 
82 #define NO_IMPORT_ARRAY
83 #include "eigenpy/numpy.hpp"
84 #undef NO_IMPORT_ARRAY
85 
86 #undef BOOST_BIND_GLOBAL_PLACEHOLDERS
87 
88 #include <Eigen/Core>
89 #include <Eigen/Geometry>
90 
91 #ifdef EIGENPY_WITH_CXX11_SUPPORT
92 #include <unsupported/Eigen/CXX11/Tensor>
93 #define EIGENPY_WITH_TENSOR_SUPPORT
94 #endif
95 
96 #if EIGEN_VERSION_AT_LEAST(3, 2, 90)
97 #define EIGENPY_DEFAULT_ALIGNMENT_VALUE Eigen::Aligned16
98 #else
99 #define EIGENPY_DEFAULT_ALIGNMENT_VALUE Eigen::Aligned
100 #endif
101 
102 #define EIGENPY_DEFAULT_ALIGN_BYTES EIGEN_DEFAULT_ALIGN_BYTES
103 
104 #define EIGENPY_NO_ALIGNMENT_VALUE Eigen::Unaligned
105 
106 #define EIGENPY_UNUSED_VARIABLE(var) (void)(var)
107 #define EIGENPY_UNUSED_TYPE(type) EIGENPY_UNUSED_VARIABLE((type *)(NULL))
108 
109 #ifdef EIGENPY_WITH_CXX11_SUPPORT
110 #include <memory>
111 #define EIGENPY_SHARED_PTR_HOLDER_TYPE(T) ::std::shared_ptr<T>
112 #else
113 #include <boost/shared_ptr.hpp>
114 #define EIGENPY_SHARED_PTR_HOLDER_TYPE(T) ::boost::shared_ptr<T>
115 #endif
116 
117 namespace eigenpy {
118 template <typename MatType,
119  typename Scalar =
120  typename boost::remove_reference<MatType>::type::Scalar>
121 struct EigenToPy;
122 template <typename MatType,
123  typename Scalar =
124  typename boost::remove_reference<MatType>::type::Scalar>
125 struct EigenFromPy;
126 
127 template <typename T>
129  typedef typename boost::remove_const<
130  typename boost::remove_reference<T>::type>::type type;
131 };
132 
133 template <typename EigenType>
136  typedef typename boost::mpl::if_<
137  boost::is_base_of<Eigen::MatrixBase<EigenType_>, EigenType_>,
138  Eigen::MatrixBase<EigenType_>
139 #ifdef EIGENPY_WITH_TENSOR_SUPPORT
140  ,
141  typename boost::mpl::if_<
142  boost::is_base_of<Eigen::TensorBase<EigenType_>, EigenType_>,
143  Eigen::TensorBase<EigenType_>, void>::type
144 #else
145  ,
146  void
147 #endif
148  >::type _type;
149 
150  typedef typename boost::mpl::if_<
151  boost::is_const<typename boost::remove_reference<EigenType>::type>,
152  const _type, _type>::type type;
153 };
154 
155 template <typename EigenType>
157 
158 template <typename MatType, int Options, typename Stride>
159 struct get_eigen_ref_plain_type<Eigen::Ref<MatType, Options, Stride> > {
160  typedef typename Eigen::internal::traits<
161  Eigen::Ref<MatType, Options, Stride> >::PlainObjectType type;
162 };
163 
164 #ifdef EIGENPY_WITH_TENSOR_SUPPORT
165 template <typename TensorType>
166 struct get_eigen_ref_plain_type<Eigen::TensorRef<TensorType> > {
167  typedef TensorType type;
168 };
169 #endif
170 } // namespace eigenpy
171 
172 #include "eigenpy/alignment.hpp"
173 
174 #endif // ifndef __eigenpy_fwd_hpp__
boost::mpl::if_< boost::is_base_of< Eigen::MatrixBase< EigenType_ >, EigenType_ >, Eigen::MatrixBase< EigenType_ >, void >::type _type
Definition: fwd.hpp:148
Definition: complex.cpp:7
Eigen::internal::traits< Eigen::Ref< MatType, Options, Stride > >::PlainObjectType type
Definition: fwd.hpp:161
boost::remove_const< typename boost::remove_reference< T >::type >::type type
Definition: fwd.hpp:130
remove_const_reference< EigenType >::type EigenType_
Definition: fwd.hpp:135
boost::mpl::if_< boost::is_const< typename boost::remove_reference< EigenType >::type >, const _type, _type >::type type
Definition: fwd.hpp:152


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Jun 2 2023 02:10:26