Go to the documentation of this file.
18 #ifndef viskores_BinaryOperators_h
19 #define viskores_BinaryOperators_h
33 #if (defined(VISKORES_GCC) || defined(VISKORES_CLANG))
34 #pragma GCC diagnostic push
35 #pragma GCC diagnostic ignored "-Wconversion"
36 #endif // gcc || clang
43 template <
typename T,
typename U>
54 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
57 return static_cast<T
>(x + y);
66 template <
typename T,
typename U>
77 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
80 return static_cast<T
>(x * y);
84 #if (defined(VISKORES_GCC) || defined(VISKORES_CLANG))
85 #pragma GCC diagnostic pop
86 #endif // gcc || clang
95 template <
typename T,
typename U>
109 template <
typename T,
typename U>
112 return x < y ? x : y;
119 template <
typename T>
155 template <
typename T,
typename U>
164 template <
typename T>
166 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
169 return static_cast<T
>(x & y);
178 template <
typename T,
typename U>
187 template <
typename T>
189 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
192 return static_cast<T
>(x | y);
201 template <
typename T,
typename U>
210 template <
typename T>
212 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
215 return static_cast<T
>(x ^ y);
221 #endif //viskores_BinaryOperators_h
Binary Predicate that takes two arguments argument x, and y and returns product (multiplication) of t...
Definition: BinaryOperators.h:64
viskores::Vec< T, 2 > operator()(const T &a, const viskores::Vec< T, 2 > &b) const
Definition: BinaryOperators.h:138
viskores::Vec< T, 2 > operator()(const viskores::Vec< T, 2 > &a, const T &b) const
Definition: BinaryOperators.h:144
auto operator()(const T &x, const U &y) const -> decltype(x &y)
Definition: BinaryOperators.h:156
viskores::Vec< T, 2 > operator()(const viskores::Vec< T, 2 > &a, const viskores::Vec< T, 2 > &b) const
Definition: BinaryOperators.h:132
viskores::Vec< T, 2 > operator()(const T &a, const T &b) const
Definition: BinaryOperators.h:126
auto operator()(const T &x, const U &y) const -> decltype(x ^ y)
Definition: BinaryOperators.h:202
Binary Predicate that takes two arguments argument x, and y and returns the bitwise operation x&y
Definition: BinaryOperators.h:153
std::common_type< T, U >::type operator()(const T &x, const U &y) const
Definition: BinaryOperators.h:96
auto operator()(const T &x, const U &y) const -> decltype(x|y)
Definition: BinaryOperators.h:179
#define VISKORES_EXEC_CONT
Definition: ExportMacros.h:60
Binary Predicate that takes two arguments argument x, and y and returns the bitwise operation x^y
Definition: BinaryOperators.h:199
Binary Predicate that takes two arguments argument x, and y and returns the x if x > y otherwise retu...
Definition: BinaryOperators.h:93
Binary Predicate that takes two arguments argument x, and y and returns the bitwise operation x|y
Definition: BinaryOperators.h:176
Groups connected points that have the same field value.
Definition: Atomic.h:27
constexpr viskores::Vec< T, viskores::IdComponent(sizeof...(Ts)+1)> make_Vec(T value0, Ts &&... args)
Initializes and returns a Vec containing all the arguments.
Definition: Types.h:1262
Binary Predicate that takes two arguments argument x, and y and returns sum (addition) of the two val...
Definition: BinaryOperators.h:41
auto operator()(const T &x, const U &y) const -> decltype(x *y)
Definition: BinaryOperators.h:67
viskores::Vec< T, 2 > operator()(const T &a) const
Definition: BinaryOperators.h:123
Binary Predicate that takes two arguments argument x, and y and returns the x if x < y otherwise retu...
Definition: BinaryOperators.h:107
std::common_type< T, U >::type operator()(const T &x, const U &y) const
Definition: BinaryOperators.h:110
auto operator()(const T &x, const U &y) const -> decltype(x+y)
Definition: BinaryOperators.h:44
Binary Predicate that takes two arguments argument x, and y and returns a viskores::Vec<T,...
Definition: BinaryOperators.h:120