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> {};
42 template<
typename Scalar>
43 struct cast_impl<CppAD::AD<Scalar>,Scalar>
45 #if EIGEN_VERSION_AT_LEAST(3,2,90) 48 static inline Scalar run(
const CppAD::AD<Scalar> & x)
50 return CppAD::Value(x);
59 template <
class Base>
struct NumTraits<
CppAD::AD<Base> >
61 typedef CppAD::AD<Base> Real;
63 typedef CppAD::AD<Base> NonInteger;
65 typedef CppAD::AD<Base> Literal;
67 typedef CppAD::AD<Base> Nested;
77 RequireInitialization = 1 ,
86 static CppAD::AD<Base> epsilon(
void)
87 {
return CppAD::numeric_limits< CppAD::AD<Base> >::epsilon(); }
91 static CppAD::AD<Base> dummy_precision(
void)
93 CppAD::numeric_limits< CppAD::AD<Base> >::epsilon();
97 static CppAD::AD<Base> lowest(
void)
98 {
return CppAD::numeric_limits< CppAD::AD<Base> >::min(); }
101 static CppAD::AD<Base> highest(
void)
102 {
return CppAD::numeric_limits< CppAD::AD<Base> >::max(); }
105 static int digits10(
void)
106 {
return CppAD::numeric_limits< CppAD::AD<Base> >::digits10; }
114 template <
class Base>
const AD<Base>& conj(
const AD<Base>& x)
116 template <
class Base>
const AD<Base>& real(
const AD<Base>& x)
120 template <
class Base> AD<Base> imag(
const AD<Base>& )
121 {
return CppAD::AD<Base>(0.); }
122 template <
class Base> AD<Base> abs2(
const AD<Base>& x)
128 template<
typename Scalar>
132 using Base::precision;
136 #endif // #ifndef __pinocchio_autodiff_ccpad_hpp__
Source from #include <cppad/example/cppad_eigen.hpp>
Source from #include <cppad/example/cppad_eigen.hpp>
Main pinocchio namespace.