5 #ifndef __pinocchio_autodiff_cppad_hpp__ 6 #define __pinocchio_autodiff_cppad_hpp__ 8 #include "pinocchio/math/fwd.hpp" 9 #define PINOCCHIO_WITH_CPPAD_SUPPORT 16 #define EIGEN_MATRIXBASE_PLUGIN <pinocchio/autodiff/cppad/math/eigen_plugin.hpp> 18 #include <cppad/cppad.hpp> 19 #include <Eigen/Dense> 29 template<
typename Scalar>
30 struct constant_pi<
CppAD::AD<Scalar> > : constant_pi<Scalar>
35 static inline ADScalar
get(
const mpl::int_<N>&
n)
37 return ADScalar(constant_pi<Scalar>::get(
n));
40 template <
class T, T value>
41 static inline ADScalar
get(
const std::integral_constant<T, value> &
n)
43 return ADScalar(constant_pi<Scalar>::get(
n));
56 template<
typename Scalar>
59 #if EIGEN_VERSION_AT_LEAST(3,2,90) 62 static inline Scalar run(
const CppAD::AD<Scalar> & x)
64 return CppAD::Value(x);
73 template <
class Base>
struct NumTraits<
CppAD::AD<Base> >
75 typedef CppAD::AD<Base>
Real;
91 RequireInitialization = 1 ,
101 {
return CppAD::numeric_limits< CppAD::AD<Base> >::epsilon(); }
107 CppAD::numeric_limits< CppAD::AD<Base> >::epsilon();
112 {
return CppAD::numeric_limits< CppAD::AD<Base> >
::min(); }
116 {
return CppAD::numeric_limits< CppAD::AD<Base> >
::max(); }
120 {
return CppAD::numeric_limits< CppAD::AD<Base> >::digits10; }
125 #include "pinocchio/utils/static-if.hpp" 131 template <
class Base>
const AD<Base>&
conj(
const AD<Base>& x)
133 template <
class Base>
const AD<Base>&
real(
const AD<Base>& x)
137 template <
class Base> AD<Base>
imag(
const AD<Base>& )
138 {
return CppAD::AD<Base>(0.); }
139 template <
class Base> AD<Base>
abs2(
const AD<Base>& x)
142 template<
typename Scalar>
143 AD<Scalar>
min(
const AD<Scalar>& x,
const AD<Scalar>& y)
150 template<
typename Scalar>
151 AD<Scalar>
max(
const AD<Scalar>& x,
const AD<Scalar>& y)
160 #include "pinocchio/utils/static-if.hpp" 164 template<
typename Scalar>
173 return ADScalar(Base::template precision<degree>());
180 #include "pinocchio/autodiff/cppad/spatial/se3-tpl.hpp" 181 #include "pinocchio/autodiff/cppad/spatial/log.hxx" 182 #include "pinocchio/autodiff/cppad/utils/static-if.hpp" 183 #include "pinocchio/autodiff/cppad/math/quaternion.hpp" 184 #include "pinocchio/autodiff/cppad/algorithm/aba.hpp" 187 #endif // #ifndef __pinocchio_autodiff_cppad_hpp__ const AD< Base > & conj(const AD< Base > &x)
static CppAD::AD< Base > highest(void)
TaylorSeriesExpansion< Scalar > Base
CppAD::AD< Scalar > ADScalar
Eigen::Matrix< typename ComplexMatrix::RealScalar, ComplexMatrix::RowsAtCompileTime, ComplexMatrix::ColsAtCompileTime, ComplexMatrix::Options > imag(const Eigen::MatrixBase< ComplexMatrix > &complex_mat)
AD< Scalar > max(const AD< Scalar > &x, const AD< Scalar > &y)
static int digits10(void)
#define EIGEN_DEVICE_FUNC
static Scalar run(const CppAD::AD< Scalar > &x)
CppAD::AD< Scalar > ADScalar
static CppAD::AD< Base > epsilon(void)
Main pinocchio namespace.
Eigen::Matrix< typename ComplexMatrix::RealScalar, ComplexMatrix::RowsAtCompileTime, ComplexMatrix::ColsAtCompileTime, ComplexMatrix::Options > real(const Eigen::MatrixBase< ComplexMatrix > &complex_mat)
if_then_else_impl< LhsType, RhsType, ThenType, ElseType >::ReturnType if_then_else(const ComparisonOperators op, const LhsType &lhs_value, const RhsType &rhs_value, const ThenType &then_value, const ElseType &else_value)
static ADScalar precision()
AD< Scalar > min(const AD< Scalar > &x, const AD< Scalar > &y)
CppAD::AD< Base > Literal
static CppAD::AD< Base > dummy_precision(void)
CppAD::AD< Base > NonInteger
AD< Base > abs2(const AD< Base > &x)
static CppAD::AD< Base > lowest(void)