vexcl_abs.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. [auto_generated]
  3. boost/numeric/odeint/external/vexcl/vexcl_abs.hpp
  4. [begin_description]
  5. abs() specialization for vexcl
  6. [end_description]
  7. Copyright 2009-2013 Karsten Ahnert
  8. Copyright 2009-2013 Mario Mulansky
  9. Distributed under the Boost Software License, Version 1.0.
  10. (See accompanying file LICENSE_1_0.txt or
  11. copy at http://www.boost.org/LICENSE_1_0.txt)
  12. */
  13. #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED
  14. #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED
  15. #include <vexcl/vector.hpp>
  16. #include <vexcl/multivector.hpp>
  17. #include <vexcl/operations.hpp>
  18. namespace vex {
  19. template <typename T, size_t N>
  20. typename std::enable_if<
  21. std::is_integral<T>::value,
  22. typename boost::proto::result_of::make_expr<
  23. boost::proto::tag::function,
  24. abs_func,
  25. const vex::multivector<T, N>&
  26. >::type const
  27. >::type
  28. abs(const multivector<T, N> &arg) {
  29. return boost::proto::make_expr<boost::proto::tag::function>(
  30. abs_func(),
  31. boost::ref(arg)
  32. );
  33. }
  34. template <typename T, size_t N>
  35. typename std::enable_if<
  36. !std::is_integral<T>::value,
  37. typename boost::proto::result_of::make_expr<
  38. boost::proto::tag::function,
  39. fabs_func,
  40. const vex::multivector<T, N>&
  41. >::type const
  42. >::type
  43. abs(const multivector<T, N> &arg) {
  44. return boost::proto::make_expr<boost::proto::tag::function>(
  45. fabs_func(),
  46. boost::ref(arg)
  47. );
  48. }
  49. } // namespace vex
  50. #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED