9#define PINOCCHIO_WITH_CPPAD_SUPPORT 15#include <Eigen/Geometry> 17#include <boost/version.hpp> 18#include <boost/math/constants/constants.hpp> 19#include <boost/mpl/int.hpp> 21#include <cppad/cppad.hpp> 23#include "pinocchio/fwd.hpp" 24#include "pinocchio/macros.hpp" 25#include "pinocchio/eigen-common.hpp" 26#include "pinocchio/fwd.hpp" 28#include "pinocchio/utils/static-if.hpp" 30#include "pinocchio/math.hpp" 31#include "pinocchio/spatial.hpp" 42 template<
typename Scalar>
43 struct constant_pi<CppAD::AD<Scalar>> : constant_pi<Scalar>
45 typedef CppAD::AD<Scalar> ADScalar;
48 static inline ADScalar get(
const mpl::int_<N> & n)
50 return ADScalar(constant_pi<Scalar>::get(n));
53#if BOOST_VERSION >= 107700 54 template<
class T, T value>
55 static inline ADScalar get(
const std::integral_constant<T, value> & n)
57 return ADScalar(constant_pi<Scalar>::get(n));
60 template<
class T, T value>
61 static inline ADScalar get(
const boost::integral_constant<T, value> & n)
63 return ADScalar(constant_pi<Scalar>::get(n));
77 template<
typename Scalar>
78 struct cast_impl<CppAD::AD<Scalar>, Scalar>
81 static inline Scalar run(
const CppAD::AD<Scalar> & x)
83 return CppAD::Value(x);
93 struct NumTraits<CppAD::AD<Base>>
95 typedef CppAD::AD<Base> Real;
97 typedef CppAD::AD<Base> NonInteger;
99 typedef CppAD::AD<Base> Literal;
101 typedef CppAD::AD<Base> Nested;
112 RequireInitialization = 1,
121 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static inline CppAD::AD<Base> epsilon(
void)
123 return CppAD::numeric_limits<CppAD::AD<Base>>::epsilon();
128 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static inline CppAD::AD<Base> dummy_precision(
void)
130 return 100. * CppAD::numeric_limits<CppAD::AD<Base>>::epsilon();
134 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static inline CppAD::AD<Base> lowest(
void)
136 return CppAD::numeric_limits<CppAD::AD<Base>>::min();
140 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static inline CppAD::AD<Base> highest(
void)
142 return CppAD::numeric_limits<CppAD::AD<Base>>::max();
146 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static inline int digits10(
void)
148 return CppAD::numeric_limits<CppAD::AD<Base>>::digits10;
151 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static inline int digits()
153 return NumTraits<Base>::digits();
156#if EIGEN_VERSION_AT_LEAST(3, 4, 90) 157 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static inline int max_digits10()
159 return NumTraits<Base>::max_digits10();
170 const AD<Base> & conj(
const AD<Base> & x)
175 const AD<Base> & real(
const AD<Base> & x)
182 AD<Base> imag(
const AD<Base> & )
184 return CppAD::AD<Base>(0.);
187 AD<Base> abs2(
const AD<Base> & x)
192 template<
typename Scalar>
193 AD<Scalar> min(
const AD<Scalar> & x,
const AD<Scalar> & y)
195 using ::pinocchio::internal::if_then_else;
196 using ::pinocchio::internal::LT;
197 return if_then_else(LT, y, x, y, x);
200 template<
typename Scalar>
201 AD<Scalar> max(
const AD<Scalar> & x,
const AD<Scalar> & y)
203 using ::pinocchio::internal::if_then_else;
204 using ::pinocchio::internal::LT;
205 return if_then_else(LT, x, y, y, x);
211 template<
class Scalar>
212 bool isfinite(
const AD<Scalar> & x)
214 return isfinite(Value(x));
219#include "pinocchio/src/autodiff/cppad/utils/static-if.hxx" 220#include "pinocchio/src/autodiff/cppad/math/quaternion.hxx" 221#include "pinocchio/src/autodiff/cppad/math/taylor-series-expansion.hxx" 222#include "pinocchio/src/autodiff/cppad/spatial/se3-tpl.hxx" 223#include "pinocchio/src/autodiff/cppad/spatial/log.hxx" 224#include "pinocchio/src/autodiff/cppad/algorithm/aba.hxx"