5 #ifndef __pinocchio_codegen_ccpadcg_hpp__
6 #define __pinocchio_codegen_ccpadcg_hpp__
8 #include "pinocchio/math/fwd.hpp"
11 #include <cppad/cg/support/cppadcg_eigen.hpp>
13 #include "pinocchio/autodiff/cppad.hpp"
15 #ifndef PINOCCHIO_WITH_CXX11_SUPPORT
16 #error CppADCodeGen requires C++11 or more
27 template<
typename Scalar>
28 struct constant_pi< CppAD::cg::CG<Scalar> > : constant_pi<Scalar>
30 typedef CppAD::cg::CG<Scalar> CGScalar;
33 static inline CGScalar get(
const mpl::int_<N>& n)
35 return CGScalar(constant_pi<Scalar>::get(n));
48 template<
typename Scalar>
49 struct cast_impl<CppAD::cg::CG<Scalar>,Scalar>
51 #if EIGEN_VERSION_AT_LEAST(3,2,90)
54 static inline Scalar run(
const CppAD::cg::CG<Scalar> & x)
64 template <
class Scalar>
65 bool isfinite(
const cg::CG<Scalar> & x) {
return std::isfinite(x.getValue()); }
67 template <
class Scalar>
68 bool isfinite(
const AD<Scalar> & x) {
return isfinite(Value(x)); }
73 template<
typename Scalar>
77 typedef CppAD::cg::CG<Scalar> CGScalar;
82 return CGScalar(Base::template precision<degree>());
88 #endif // #ifndef __pinocchio_codegen_ccpadcg_hpp__