pinocchio  3.3.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
fwd.hpp
1 //
2 // Copyright (c) 2018-2024 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_fwd_hpp__
6 #define __pinocchio_fwd_hpp__
7 
8 // Forward declaration of the main pinocchio namespace
9 namespace pinocchio
10 {
11 }
12 
13 #ifdef _WIN32
14  #include <windows.h>
15  #undef far
16  #undef near
17 #endif
18 
19 #include <cassert>
20 
21 #include "pinocchio/macros.hpp"
22 #include "pinocchio/deprecation.hpp"
23 #include "pinocchio/warning.hpp"
24 #include "pinocchio/config.hpp"
25 #include "pinocchio/unsupported.hpp"
26 
27 #include "pinocchio/utils/helpers.hpp"
28 #include "pinocchio/utils/cast.hpp"
29 #include "pinocchio/utils/check.hpp"
30 
31 #include "pinocchio/container/boost-container-limits.hpp"
32 
33 #ifdef PINOCCHIO_EIGEN_CHECK_MALLOC
34  #ifndef EIGEN_RUNTIME_NO_MALLOC
35  #define EIGEN_RUNTIME_NO_MALLOC_WAS_NOT_DEFINED
36  #define EIGEN_RUNTIME_NO_MALLOC
37  #endif
38 #endif
39 
40 #include <Eigen/Core>
41 #include <Eigen/Sparse>
42 #include <Eigen/SparseCholesky>
43 
44 #ifdef PINOCCHIO_WITH_ACCELERATE_SUPPORT
45  #include <Eigen/AccelerateSupport>
46 #endif
47 
48 #ifdef PINOCCHIO_EIGEN_CHECK_MALLOC
49  #ifdef EIGEN_RUNTIME_NO_MALLOC_WAS_NOT_DEFINED
50  #undef EIGEN_RUNTIME_NO_MALLOC
51  #undef EIGEN_RUNTIME_NO_MALLOC_WAS_NOT_DEFINED
52  #endif
53 #endif
54 
55 #include "pinocchio/eigen-macros.hpp"
56 #ifdef PINOCCHIO_WITH_EIGEN_TENSOR_MODULE
57  #include <unsupported/Eigen/CXX11/Tensor>
58 #endif
59 
60 #include "pinocchio/core/binary-op.hpp"
61 #include "pinocchio/core/unary-op.hpp"
62 
63 #include <cstddef> // std::size_t
64 
65 namespace pinocchio
66 {
70  template<class C>
71  struct traits
72  {
73  };
74 
76  struct Blank
77  {
78  };
79 
80  namespace internal
81  {
82  template<typename T>
83  struct traits
84  {
85  };
86  } // namespace internal
87 
88  template<class Derived>
90  {
91  typedef typename traits<Derived>::Scalar Scalar;
92  };
93 
98  template<typename NewScalar, class C>
99  struct CastType;
100 
104  template<typename To, typename From>
105  struct ScalarCast
106  {
107  static To cast(const From & value)
108  {
109  return static_cast<To>(value);
110  }
111  };
112 
113  template<typename To, typename From>
114  To scalar_cast(const From & value)
115  {
116  return ScalarCast<To, From>::cast(value);
117  }
118 
122  {
123  ARG0 = 0,
124  ARG1 = 1,
125  ARG2 = 2,
126  ARG3 = 3,
127  ARG4 = 4
128  };
129 
130  enum AssignmentOperatorType
131  {
132  SETTO,
133  ADDTO,
134  RMTO
135  };
136 
140  const int Dynamic = -1;
141 
144  struct ReturnTypeNotDefined;
145 
146  typedef Eigen::Matrix<bool, Eigen::Dynamic, 1> VectorXb;
147 } // namespace pinocchio
148 
149 #include "pinocchio/context.hpp"
150 
151 #endif // #ifndef __pinocchio_fwd_hpp__
Main pinocchio namespace.
Definition: treeview.dox:11
ArgumentPosition
Argument position. Used as template parameter to refer to an argument.
Definition: fwd.hpp:122
const int Dynamic
Definition: fwd.hpp:140
Blank type.
Definition: fwd.hpp:77
Type of the cast of a class C templated by Scalar and Options, to a new NewScalar type....
Definition: fwd.hpp:99
Cast scalar type from type FROM to type TO.
Definition: fwd.hpp:106
Common traits structure to fully define base classes for CRTP.
Definition: fwd.hpp:72