Commit b0d0c8f4 by Justin Carpentier

math/sincos: improve compatibiltity with multiple precision arithmetic

parent d8cbe175
 ... ... @@ -11,8 +11,8 @@ namespace pinocchio { /// Forward declaration template::value> struct SINCOSAlgo; // Forward declaration template::value & boost::is_floating_point::value & boost::is_floating_point::value> struct SINCOSAlgo; /// /// \brief Computes sin/cos values of a given input scalar. ... ... @@ -23,23 +23,23 @@ namespace pinocchio /// \param[inout] sa Variable containing the sin of a. /// \param[inout] ca Variable containing the cos of a. /// template void SINCOS(const Scalar & a, Scalar * sa, Scalar * ca) template void SINCOS(const S1 & a, S2 * sa, S3 * ca) { SINCOSAlgo::run(a,sa,ca); SINCOSAlgo::run(a,sa,ca); } /// Generic evaluation of sin/cos functions. template /// \brief Generic evaluation of sin/cos functions. template struct SINCOSAlgo { static void run(const Scalar & a, Scalar * sa, Scalar * ca) static void run(const S2 & a, S2 * sa, S3 * ca) { (*sa) = std::sin(a); (*ca) = std::cos(a); } }; /// Specific evaluation of sin/cos for double type. /// \brief Specific evaluation of sin/cos for double type. template<> struct SINCOSAlgo { ... ... @@ -55,7 +55,7 @@ namespace pinocchio } }; /// Specific evaluation of sin/cos for float type. /// \brief Specific evaluation of sin/cos for float type. template<> struct SINCOSAlgo { ... ... @@ -71,7 +71,7 @@ namespace pinocchio } }; /// Specific evaluation of sin/cos for long double. /// \brief Specific evaluation of sin/cos for long double. template<> struct SINCOSAlgo { ... ... @@ -85,11 +85,11 @@ namespace pinocchio } }; /// Implementation for overloaded scalar types (e.g. Automatic Differentiation). template struct SINCOSAlgo< Scalar, false > /// \brief Implementation for overloaded scalar types (e.g. Automatic Differentiation). template struct SINCOSAlgo { static void run(const Scalar & a, Scalar * sa, Scalar * ca) static void run(const S1 & a, S2 * sa, S3 * ca) { (*sa) = sin(a); (*ca) = cos(a); } ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!