5 #ifndef __pinocchio_math_fwd_hpp__ 6 #define __pinocchio_math_fwd_hpp__ 8 #include "pinocchio/fwd.hpp" 10 #include <boost/math/constants/constants.hpp> 19 template<
typename Scalar>
21 {
return boost::math::constants::pi<Scalar>(); }
29 #define PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(name) \ 30 template<typename Scalar> \ 31 Scalar name(const Scalar & value) \ 32 { using std::name; return name(value); } 34 #define PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(name) \ 37 template<typename T1, typename T2> \ 38 struct return_type_##name \ 42 template<typename T1, typename T2> \ 45 static inline typename return_type_##name<T1,T2>::type \ 46 run(const T1 & a, const T2 & b) \ 47 { using std::name; return name(a,b); } \ 50 template<typename T1, typename T2> \ 51 inline typename internal::return_type_##name<T1,T2>::type name(const T1 & a, const T2 & b) \ 52 { return internal::call_##name<T1,T2>::run(a,b); } 54 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(fabs)
55 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(sqrt)
56 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(atan)
57 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(acos)
58 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(asin)
59 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(cos)
60 PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(sin)
62 PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(pow)
63 PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(min)
64 PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(max)
65 PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(atan2)
69 #endif //#ifndef __pinocchio_math_fwd_hpp__
const Scalar PI()
Returns the value of PI according to the template parameters Scalar.
Main pinocchio namespace.