5 #ifndef __pinocchio_math_ccpad_hpp__ 6 #define __pinocchio_math_ccpad_hpp__ 13 #ifdef PINOCCHIO_CPPAD_REQUIRES_MATRIX_BASE_PLUGIN 14 #define EIGEN_MATRIXBASE_PLUGIN <cppad/example/eigen_plugin.hpp> 17 #if defined(PINOCCHIO_WITH_CPPADCG_SUPPORT) && defined(PINOCCHIO_WITH_CXX11_SUPPORT) 18 #include "pinocchio/math/cppadcg.hpp" 20 #include <cppad/cppad.hpp> 21 #include <Eigen/Dense> 29 template<
typename Scalar>
30 struct cast_impl<CppAD::AD<Scalar>,Scalar>
32 #if EIGEN_VERSION_AT_LEAST(3,2,90) 35 static inline Scalar run(
const CppAD::AD<Scalar> & x)
37 return CppAD::Value(x);
46 template <
class Base>
struct NumTraits<
CppAD::AD<Base> >
48 typedef CppAD::AD<Base> Real;
50 typedef CppAD::AD<Base> NonInteger;
52 typedef CppAD::AD<Base> Literal;
54 typedef CppAD::AD<Base> Nested;
64 RequireInitialization = 1 ,
73 static CppAD::AD<Base> epsilon(
void)
74 {
return CppAD::numeric_limits< CppAD::AD<Base> >::epsilon(); }
78 static CppAD::AD<Base> dummy_precision(
void)
80 CppAD::numeric_limits< CppAD::AD<Base> >::epsilon();
84 static CppAD::AD<Base> lowest(
void)
85 {
return CppAD::numeric_limits< CppAD::AD<Base> >::min(); }
88 static CppAD::AD<Base> highest(
void)
89 {
return CppAD::numeric_limits< CppAD::AD<Base> >::max(); }
92 static int digits10(
void)
93 {
return CppAD::numeric_limits< CppAD::AD<Base> >::digits10; }
101 template <
class Base>
const AD<Base>& conj(
const AD<Base>& x)
103 template <
class Base>
const AD<Base>& real(
const AD<Base>& x)
107 template <
class Base> AD<Base> imag(
const AD<Base>& )
108 {
return CppAD::AD<Base>(0.); }
109 template <
class Base> AD<Base> abs2(
const AD<Base>& x)
113 #endif // #ifndef __pinocchio_math_ccpad_hpp__ Source from #include <cppad/example/cppad_eigen.hpp>
Source from #include <cppad/example/cppad_eigen.hpp>