VTK-m  2.0
BinaryPredicates.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_BinaryPredicates_h
11 #define vtk_m_BinaryPredicates_h
12 
14 
15 namespace vtkm
16 {
17 
21 struct NotEqual
22 {
23  template <typename T, typename U>
24  VTKM_EXEC_CONT bool operator()(const T& x, const U& y) const
25  {
26  return x != y;
27  }
28 };
29 
33 struct Equal
34 {
35  template <typename T, typename U>
36  VTKM_EXEC_CONT bool operator()(const T& x, const U& y) const
37  {
38  return x == y;
39  }
40 };
41 
45 struct SortLess
46 {
47  template <typename T, typename U>
48  VTKM_EXEC_CONT bool operator()(const T& x, const U& y) const
49  {
50  return x < y;
51  }
52 };
53 
57 
59 {
60  template <typename T, typename U>
61  VTKM_EXEC_CONT bool operator()(const T& x, const U& y) const
62  {
63  return y < x;
64  }
65 };
66 
70 
71 struct LogicalAnd
72 {
73  template <typename T, typename U>
74  VTKM_EXEC_CONT bool operator()(const T& x, const U& y) const
75  {
76  return x && y;
77  }
78 };
79 
83 struct LogicalOr
84 {
85  template <typename T, typename U>
86  VTKM_EXEC_CONT bool operator()(const T& x, const U& y) const
87  {
88  return x || y;
89  }
90 };
91 
92 } // namespace vtkm
93 
94 #endif //vtk_m_BinaryPredicates_h
vtkm::NotEqual::operator()
VTKM_EXEC_CONT bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:24
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::SortLess::operator()
VTKM_EXEC_CONT bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:48
vtkm::LogicalAnd
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x and y a...
Definition: BinaryPredicates.h:71
vtkm::NotEqual
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is not ...
Definition: BinaryPredicates.h:21
ExportMacros.h
vtkm::SortLess
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is less...
Definition: BinaryPredicates.h:45
vtkm::Equal
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is equa...
Definition: BinaryPredicates.h:33
vtkm::LogicalOr
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x or y is...
Definition: BinaryPredicates.h:83
vtkm::SortGreater
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is grea...
Definition: BinaryPredicates.h:58
vtkm::SortGreater::operator()
VTKM_EXEC_CONT bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:61
vtkm::LogicalOr::operator()
VTKM_EXEC_CONT bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:86
vtkm::Equal::operator()
VTKM_EXEC_CONT bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:36
vtkm::LogicalAnd::operator()
VTKM_EXEC_CONT bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:74