5 #ifndef __pinocchio_math_fwd_hpp__
6 #define __pinocchio_math_fwd_hpp__
8 #include "pinocchio/fwd.hpp"
10 #include <boost/math/constants/constants.hpp>
11 #include <boost/type_traits/is_floating_point.hpp>
26 template<
typename Scalar>
29 return boost::math::constants::pi<Scalar>();
33 template<
typename Scalar>
34 struct TaylorSeriesExpansion;
39 #define PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(name) \
40 template<typename Scalar> \
41 Scalar name(const Scalar & value) \
47 #define PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(name) \
50 template<typename T1, typename T2> \
51 struct return_type_##name \
55 template<typename T1, typename T2> \
58 static inline typename return_type_##name<T1, T2>::type run(const T1 & a, const T2 & b) \
65 template<typename T1, typename T2> \
66 inline typename internal::return_type_##name<T1, T2>::type name(const T1 & a, const T2 & b) \
68 return internal::call_##name<T1, T2>::run(a, b); \
71 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(fabs)
72 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(sqrt)
73 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(atan)
74 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(acos)
75 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(asin)
76 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(cos)
77 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(sin)
78 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(log)
79 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(exp)
81 PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(pow)
82 PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(min)
83 PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(max)
84 PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(atan2)
Main pinocchio namespace.
const Scalar PI()
Returns the value of PI according to the template parameters Scalar.