pinocchio  2.2.1-dirty
codegen/cppadcg.hpp
1 //
2 // Copyright (c) 2018-2019 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_codegen_ccpadcg_hpp__
6 #define __pinocchio_codegen_ccpadcg_hpp__
7 
8 #include "pinocchio/math/fwd.hpp"
9 
10 #include <cmath>
11 #include <cppad/cg/support/cppadcg_eigen.hpp>
12 
13 #include "pinocchio/autodiff/cppad.hpp"
14 
15 #ifndef PINOCCHIO_WITH_CXX11_SUPPORT
16  #error CppADCodeGen requires C++11 or more
17 #endif
18 
19 namespace boost
20 {
21  namespace math
22  {
23  namespace constants
24  {
25  namespace detail
26  {
27  template<typename Scalar>
28  struct constant_pi< CppAD::cg::CG<Scalar> > : constant_pi<Scalar> {};
29  }
30  }
31  }
32 }
33 
34 namespace Eigen
35 {
36  namespace internal
37  {
38  // Specialization of Eigen::internal::cast_impl for CppAD input types
39  template<typename Scalar>
40  struct cast_impl<CppAD::cg::CG<Scalar>,Scalar>
41  {
42 #if EIGEN_VERSION_AT_LEAST(3,2,90)
43  EIGEN_DEVICE_FUNC
44 #endif
45  static inline Scalar run(const CppAD::cg::CG<Scalar> & x)
46  {
47  return x.getValue();
48  }
49  };
50  }
51 } // namespace Eigen
52 
53 namespace pinocchio
54 {
55  template<typename Scalar>
56  struct TaylorSeriesExpansion< CppAD::cg::CG<Scalar> > : TaylorSeriesExpansion<Scalar>
57  {
59  using Base::precision;
60  };
61 } // namespace pinocchio
62 
63 #endif // #ifndef __pinocchio_codegen_ccpadcg_hpp__
Source from #include <cppad/example/cppad_eigen.hpp>
Source from #include <cppad/example/cppad_eigen.hpp>
Main pinocchio namespace.
Definition: treeview.dox:24