Go to the documentation of this file.
10 #ifndef vtk_m_BinaryOperators_h
11 #define vtk_m_BinaryOperators_h
25 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
26 #pragma GCC diagnostic push
27 #pragma GCC diagnostic ignored "-Wconversion"
28 #endif // gcc || clang
35 template <
typename T,
typename U>
46 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
49 return static_cast<T
>(x + y);
58 template <
typename T,
typename U>
69 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
72 return static_cast<T
>(x * y);
76 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
77 #pragma GCC diagnostic pop
78 #endif // gcc || clang
87 template <
typename T,
typename U>
101 template <
typename T,
typename U>
104 return x < y ? x : y;
111 template <
typename T>
126 return vtkm::make_Vec(vtkm::Min(a[0], b[0]), vtkm::Max(a[1], b[1]));
147 template <
typename T,
typename U>
156 template <
typename T>
158 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
161 return static_cast<T
>(x & y);
170 template <
typename T,
typename U>
179 template <
typename T>
181 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
184 return static_cast<T
>(x | y);
193 template <
typename T,
typename U>
202 template <
typename T>
204 typename std::enable_if<std::is_integral<T>::value &&
sizeof(T) <
sizeof(
int), T>::type
207 return static_cast<T
>(x ^ y);
213 #endif //vtk_m_BinaryOperators_h
vtkm::Vec< T, 2 > operator()(const T &a, const vtkm::Vec< T, 2 > &b) const
Definition: BinaryOperators.h:130
vtkm::Vec< T, 2 > operator()(const vtkm::Vec< T, 2 > &a, const T &b) const
Definition: BinaryOperators.h:136
Groups connected points that have the same field value.
Definition: Atomic.h:19
Binary Predicate that takes two arguments argument x, and y and returns product (multiplication) of t...
Definition: BinaryOperators.h:56
Binary Predicate that takes two arguments argument x, and y and returns the bitwise operation x|y
Definition: BinaryOperators.h:168
auto operator()(const T &x, const U &y) const -> decltype(x *y)
Definition: BinaryOperators.h:59
Binary Predicate that takes two arguments argument x, and y and returns a vtkm::Vec<T,...
Definition: BinaryOperators.h:112
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
constexpr vtkm::Vec< T, vtkm::IdComponent(sizeof...(Ts)+1)> make_Vec(T value0, Ts &&... args)
Initializes and returns a Vec containing all the arguments.
Definition: Types.h:1253
auto operator()(const T &x, const U &y) const -> decltype(x+y)
Definition: BinaryOperators.h:36
Binary Predicate that takes two arguments argument x, and y and returns the x if x > y otherwise retu...
Definition: BinaryOperators.h:85
std::common_type< T, U >::type operator()(const T &x, const U &y) const
Definition: BinaryOperators.h:88
Binary Predicate that takes two arguments argument x, and y and returns sum (addition) of the two val...
Definition: BinaryOperators.h:33
Binary Predicate that takes two arguments argument x, and y and returns the bitwise operation x^y
Definition: BinaryOperators.h:191
auto operator()(const T &x, const U &y) const -> decltype(x ^ y)
Definition: BinaryOperators.h:194
auto operator()(const T &x, const U &y) const -> decltype(x|y)
Definition: BinaryOperators.h:171
vtkm::Vec< T, 2 > operator()(const vtkm::Vec< T, 2 > &a, const vtkm::Vec< T, 2 > &b) const
Definition: BinaryOperators.h:124
vtkm::Vec< T, 2 > operator()(const T &a, const T &b) const
Definition: BinaryOperators.h:118
Binary Predicate that takes two arguments argument x, and y and returns the bitwise operation x&y
Definition: BinaryOperators.h:145
vtkm::Vec< T, 2 > operator()(const T &a) const
Definition: BinaryOperators.h:115
std::common_type< T, U >::type operator()(const T &x, const U &y) const
Definition: BinaryOperators.h:102
auto operator()(const T &x, const U &y) const -> decltype(x &y)
Definition: BinaryOperators.h:148
Binary Predicate that takes two arguments argument x, and y and returns the x if x < y otherwise retu...
Definition: BinaryOperators.h:99