5 #ifndef __pinocchio_codegen_ccpadcg_hpp__
6 #define __pinocchio_codegen_ccpadcg_hpp__
8 #define PINOCCHIO_WITH_CPPADCG_SUPPORT
13 #include <cppad/cg/support/cppadcg_eigen.hpp>
17 #ifndef PINOCCHIO_WITH_CXX11_SUPPORT
18 #error CppADCodeGen requires C++11 or more
29 template<
typename Scalar>
30 struct constant_pi<
CppAD::cg::CG<Scalar>> : constant_pi<Scalar>
37 return CGScalar(constant_pi<Scalar>::get(
n));
40 #if BOOST_VERSION >= 107700
41 template<
class T, T value>
42 static inline CGScalar get(
const std::integral_constant<T, value> &
n)
44 return CGScalar(constant_pi<Scalar>::get(
n));
47 template<
class T, T value>
48 static inline CGScalar get(
const boost::integral_constant<T, value> &
n)
50 return CGScalar(constant_pi<Scalar>::get(
n));
64 template<
typename Scalar>
67 #if EIGEN_VERSION_AT_LEAST(3, 2, 90)
70 static inline Scalar run(
const CppAD::cg::CG<Scalar> & x)
77 template<
typename Scalar>
80 #if EIGEN_VERSION_AT_LEAST(3, 2, 90)
83 static inline Scalar run(
const CppAD::AD<CppAD::cg::CG<Scalar>> & x)
85 return CppAD::Value(
x).getValue();
96 template<
class Scalar>
106 template<
typename Scalar>
115 return CGScalar(Base::template precision<degree>());
119 template<
typename Scalar>
124 return cg_value.getValue();
130 #endif // #ifndef __pinocchio_codegen_ccpadcg_hpp__