5 #ifndef __pinocchio_codegen_ccpadcg_hpp__ 6 #define __pinocchio_codegen_ccpadcg_hpp__ 8 #define PINOCCHIO_WITH_CPPADCG_SUPPORT 10 #include "pinocchio/math/fwd.hpp" 13 #include <cppad/cg/support/cppadcg_eigen.hpp> 15 #include "pinocchio/autodiff/cppad.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>
32 typedef CppAD::cg::CG<Scalar> CGScalar;
35 static inline CGScalar
get(
const mpl::int_<N>& n)
37 return CGScalar(constant_pi<Scalar>::get(n));
50 template<
typename Scalar>
51 struct cast_impl<CppAD::cg::CG<Scalar>,Scalar>
53 #if EIGEN_VERSION_AT_LEAST(3,2,90) 56 static inline Scalar run(
const CppAD::cg::CG<Scalar> & x)
66 template <
class Scalar>
67 bool isfinite(
const cg::CG<Scalar> & x) {
return std::isfinite(x.getValue()); }
69 template <
class Scalar>
70 bool isfinite(
const AD<Scalar> & x) {
return isfinite(Value(x)); }
75 template<
typename Scalar>
79 typedef CppAD::cg::CG<Scalar> CGScalar;
82 static CGScalar precision()
84 return CGScalar(Base::template precision<degree>());
90 #endif // #ifndef __pinocchio_codegen_ccpadcg_hpp__
Main pinocchio namespace.