5 #ifndef __pinocchio_codegen_ccpadcg_hpp__
6 #define __pinocchio_codegen_ccpadcg_hpp__
8 #define PINOCCHIO_WITH_CPPADCG_SUPPORT
13 #include <boost/mpl/int.hpp>
14 #include <cppad/cg/support/cppadcg_eigen.hpp>
18 #ifndef PINOCCHIO_WITH_CXX11_SUPPORT
19 #error CppADCodeGen requires C++11 or more
30 template<
typename Scalar>
31 struct constant_pi<
CppAD::cg::CG<Scalar>> : constant_pi<Scalar>
38 return CGScalar(constant_pi<Scalar>::get(
n));
41 #if BOOST_VERSION >= 107700
42 template<
class T, T value>
43 static inline CGScalar get(
const std::integral_constant<T, value> &
n)
45 return CGScalar(constant_pi<Scalar>::get(
n));
48 template<
class T, T value>
49 static inline CGScalar get(
const boost::integral_constant<T, value> &
n)
51 return CGScalar(constant_pi<Scalar>::get(
n));
65 template<
typename Scalar>
68 #if EIGEN_VERSION_AT_LEAST(3, 2, 90)
71 static inline Scalar run(
const CppAD::cg::CG<Scalar> & x)
78 template<
typename Scalar>
81 #if EIGEN_VERSION_AT_LEAST(3, 2, 90)
84 static inline Scalar run(
const CppAD::AD<CppAD::cg::CG<Scalar>> & x)
86 return CppAD::Value(
x).getValue();
97 template<
class Scalar>
107 template<
typename Scalar>
116 return CGScalar(Base::template precision<degree>());
120 template<
typename Scalar>
125 return cg_value.getValue();
131 #endif // #ifndef __pinocchio_codegen_ccpadcg_hpp__