fwd.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2024 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 #include <boost/type_traits/is_base_of.hpp>
69 
70 // Silence a warning about a deprecated use of boost bind by boost python
71 // at least fo boost 1.73 to 1.75
72 // ref. https://github.com/stack-of-tasks/tsid/issues/128
73 #define BOOST_BIND_GLOBAL_PLACEHOLDERS
74 #include <boost/python.hpp>
75 #include <boost/python/scope.hpp>
76 
77 #include <type_traits>
78 #include <utility>
79 
80 namespace eigenpy {
81 
82 namespace bp = boost::python;
83 
84 }
85 
86 #define NO_IMPORT_ARRAY
87 #include "eigenpy/numpy.hpp"
88 #undef NO_IMPORT_ARRAY
89 
90 #undef BOOST_BIND_GLOBAL_PLACEHOLDERS
91 
92 #include <Eigen/Core>
93 #include <Eigen/Sparse>
94 #include <Eigen/Geometry>
95 
96 #ifdef EIGENPY_WITH_CXX11_SUPPORT
97 #include <unsupported/Eigen/CXX11/Tensor>
98 #define EIGENPY_WITH_TENSOR_SUPPORT
99 #endif
100 
101 #if EIGEN_VERSION_AT_LEAST(3, 2, 90)
102 #define EIGENPY_DEFAULT_ALIGNMENT_VALUE Eigen::Aligned16
103 #else
104 #define EIGENPY_DEFAULT_ALIGNMENT_VALUE Eigen::Aligned
105 #endif
106 
107 #define EIGENPY_DEFAULT_ALIGN_BYTES EIGEN_DEFAULT_ALIGN_BYTES
108 
109 #define EIGENPY_NO_ALIGNMENT_VALUE Eigen::Unaligned
110 
111 #define EIGENPY_UNUSED_VARIABLE(var) (void)(var)
112 #define EIGENPY_UNUSED_TYPE(type) EIGENPY_UNUSED_VARIABLE((type *)(NULL))
113 #ifndef NDEBUG
114 #define EIGENPY_USED_VARIABLE_ONLY_IN_DEBUG_MODE(var)
115 #else
116 #define EIGENPY_USED_VARIABLE_ONLY_IN_DEBUG_MODE(var) \
117  EIGENPY_UNUSED_VARIABLE(var)
118 #endif
119 
120 #ifdef EIGENPY_WITH_CXX11_SUPPORT
121 #include <memory>
122 #define EIGENPY_SHARED_PTR_HOLDER_TYPE(T) ::std::shared_ptr<T>
123 #else
124 #include <boost/shared_ptr.hpp>
125 #define EIGENPY_SHARED_PTR_HOLDER_TYPE(T) ::boost::shared_ptr<T>
126 #endif
127 
128 namespace eigenpy {
129 
130 // Default Scalar value can't be defined in the declaration
131 // because of a CL bug.
132 // See https://github.com/stack-of-tasks/eigenpy/pull/462
133 template <typename MatType, typename Scalar>
134 struct EigenToPy;
135 template <typename MatType, typename Scalar>
136 struct EigenFromPy;
137 
138 template <typename T>
140  typedef typename boost::remove_const<
141  typename boost::remove_reference<T>::type>::type type;
142 };
143 
144 template <typename EigenType>
147  typedef typename boost::mpl::if_<
148  boost::is_base_of<Eigen::MatrixBase<EigenType_>, EigenType_>,
149  Eigen::MatrixBase<EigenType_>,
150  typename boost::mpl::if_<
151  boost::is_base_of<Eigen::SparseMatrixBase<EigenType_>, EigenType_>,
152  Eigen::SparseMatrixBase<EigenType_>
153 #ifdef EIGENPY_WITH_TENSOR_SUPPORT
154  ,
155  typename boost::mpl::if_<
156  boost::is_base_of<Eigen::TensorBase<EigenType_>, EigenType_>,
157  Eigen::TensorBase<EigenType_>, void>::type
158 #else
159  ,
160  void
161 #endif
163 
164  typedef typename boost::mpl::if_<
165  boost::is_const<typename boost::remove_reference<EigenType>::type>,
167 };
168 
169 template <typename EigenType>
171 
172 template <typename MatType, int Options, typename Stride>
173 struct get_eigen_plain_type<Eigen::Ref<MatType, Options, Stride> > {
174  typedef typename Eigen::internal::traits<
175  Eigen::Ref<MatType, Options, Stride> >::PlainObjectType type;
176 };
177 
178 #ifdef EIGENPY_WITH_TENSOR_SUPPORT
179 template <typename TensorType>
180 struct get_eigen_plain_type<Eigen::TensorRef<TensorType> > {
181  typedef TensorType type;
182 };
183 #endif
184 
185 namespace internal {
186 template <class T1, class T2>
188  template <class U, class V>
189  static auto check(U *) -> decltype(std::declval<U>() == std::declval<V>());
190  template <typename, typename>
191  static auto check(...) -> std::false_type;
192 
193  using type = typename std::is_same<bool, decltype(check<T1, T2>(0))>::type;
194 };
195 } // namespace internal
196 
197 template <class T1, class T2 = T1>
199 
200 } // namespace eigenpy
201 
202 #include "eigenpy/alignment.hpp"
203 #include "eigenpy/id.hpp"
204 
205 #endif // ifndef __eigenpy_fwd_hpp__
test_SimplicialLDLT.U
U
Definition: test_SimplicialLDLT.py:19
boost::python
Definition: alignment.hpp:49
Eigen
Definition: complex.cpp:7
eigenpy::remove_const_reference
Definition: fwd.hpp:139
id.hpp
eigenpy::get_eigen_base_type::EigenType_
remove_const_reference< EigenType >::type EigenType_
Definition: fwd.hpp:146
eigenpy::get_eigen_base_type::type
boost::mpl::if_< boost::is_const< typename boost::remove_reference< EigenType >::type >, const _type, _type >::type type
Definition: fwd.hpp:166
eigenpy
Definition: alignment.hpp:14
eigenpy::internal::has_operator_equal_impl::check
static auto check(U *) -> decltype(std::declval< U >()==std::declval< V >())
eigenpy::get_eigen_base_type
Definition: fwd.hpp:145
alignment.hpp
eigenpy::internal::has_operator_equal_impl
Definition: fwd.hpp:187
eigenpy::get_eigen_plain_type< Eigen::Ref< MatType, Options, Stride > >::type
Eigen::internal::traits< Eigen::Ref< MatType, Options, Stride > >::PlainObjectType type
Definition: fwd.hpp:175
numpy.hpp
eigenpy::get_eigen_base_type::_type
boost::mpl::if_< boost::is_base_of< Eigen::MatrixBase< EigenType_ >, EigenType_ >, Eigen::MatrixBase< EigenType_ >, typename boost::mpl::if_< boost::is_base_of< Eigen::SparseMatrixBase< EigenType_ >, EigenType_ >, Eigen::SparseMatrixBase< EigenType_ >, void >::type >::type _type
Definition: fwd.hpp:162
eigenpy::remove_const_reference::type
boost::remove_const< typename boost::remove_reference< T >::type >::type type
Definition: fwd.hpp:141
eigenpy::get_eigen_plain_type
Definition: fwd.hpp:170
eigenpy::internal::has_operator_equal_impl::type
typename std::is_same< bool, decltype(check< T1, T2 >(0))>::type type
Definition: fwd.hpp:193
eigenpy::has_operator_equal
Definition: fwd.hpp:198


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Jun 14 2024 02:15:58