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