5 #include "pinocchio/fwd.hpp" 6 #include "pinocchio/math/sincos.hpp" 11 #include <boost/test/unit_test.hpp> 12 #include <boost/utility/binary.hpp> 16 template <
typename Scalar>
19 template<>
inline float sinCosTolerance<float>()
24 template<>
inline double sinCosTolerance<double>()
29 template<>
inline long double sinCosTolerance<long double>()
36 template<
typename Scalar>
39 for(
int k = 0; k <
n; ++k)
41 Scalar sin_value, cos_value;
45 Scalar sin_value_ref = std::sin(alpha),
46 cos_value_ref = std::cos(alpha);
48 BOOST_CHECK_CLOSE_FRACTION(sin_value, sin_value_ref, sinCosTolerance<Scalar>());
49 BOOST_CHECK_CLOSE_FRACTION(cos_value, cos_value_ref, sinCosTolerance<Scalar>());
63 testSINCOS<double>(
n);
64 testSINCOS<long double>(
n);
67 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(test_sincos)
#define BOOST_TEST_MODULE
void SINCOS(const S1 &a, S2 *sa, S3 *ca)
Computes sin/cos values of a given input scalar.