5 #ifndef __pinocchio_autodiff_ccpad_hpp__
6 #define __pinocchio_autodiff_ccpad_hpp__
8 #include "pinocchio/math/fwd.hpp"
15 #ifdef PINOCCHIO_CPPAD_REQUIRES_MATRIX_BASE_PLUGIN
16 #define EIGEN_MATRIXBASE_PLUGIN <cppad/example/eigen_plugin.hpp>
19 #include <cppad/cppad.hpp>
20 #include <Eigen/Dense>
30 template<
typename Scalar>
31 struct constant_pi< CppAD::AD<Scalar> > : constant_pi<Scalar>
33 typedef CppAD::AD<Scalar> ADScalar;
36 static inline ADScalar get(
const mpl::int_<N>& n)
38 return ADScalar(constant_pi<Scalar>::get(n));
52 template<
typename Scalar>
53 struct cast_impl<CppAD::AD<Scalar>,Scalar>
55 #if EIGEN_VERSION_AT_LEAST(3,2,90)
58 static inline Scalar run(
const CppAD::AD<Scalar> & x)
60 return CppAD::Value(x);
69 template <
class Base>
struct NumTraits< CppAD::AD<Base> >
71 typedef CppAD::AD<Base> Real;
73 typedef CppAD::AD<Base> NonInteger;
75 typedef CppAD::AD<Base> Literal;
77 typedef CppAD::AD<Base> Nested;
87 RequireInitialization = 1 ,
96 static CppAD::AD<Base> epsilon(
void)
97 {
return CppAD::numeric_limits< CppAD::AD<Base> >::epsilon(); }
101 static CppAD::AD<Base> dummy_precision(
void)
103 CppAD::numeric_limits< CppAD::AD<Base> >::epsilon();
107 static CppAD::AD<Base> lowest(
void)
108 {
return CppAD::numeric_limits< CppAD::AD<Base> >::min(); }
111 static CppAD::AD<Base> highest(
void)
112 {
return CppAD::numeric_limits< CppAD::AD<Base> >::max(); }
115 static int digits10(
void)
116 {
return CppAD::numeric_limits< CppAD::AD<Base> >::digits10; }
124 template <
class Base>
const AD<Base>& conj(
const AD<Base>& x)
126 template <
class Base>
const AD<Base>& real(
const AD<Base>& x)
130 template <
class Base> AD<Base> imag(
const AD<Base>& )
131 {
return CppAD::AD<Base>(0.); }
132 template <
class Base> AD<Base> abs2(
const AD<Base>& x)
136 #include "pinocchio/utils/static-if.hpp"
140 template<
typename Scalar>
144 typedef CppAD::AD<Scalar> ADScalar;
149 return ADScalar(Base::template precision<degree>());
156 #include "pinocchio/autodiff/cppad/spatial/se3-tpl.hpp"
157 #include "pinocchio/autodiff/cppad/spatial/log.hxx"
158 #include "pinocchio/autodiff/cppad/utils/static-if.hpp"
159 #include "pinocchio/autodiff/cppad/math/quaternion.hpp"
161 #endif // #ifndef __pinocchio_autodiff_ccpad_hpp__