Viskores  1.0
BinaryPredicates.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_BinaryPredicates_h
19 #define viskores_BinaryPredicates_h
20 
22 
23 namespace viskores
24 {
25 
29 struct NotEqual
30 {
31  template <typename T, typename U>
32  VISKORES_EXEC_CONT bool operator()(const T& x, const U& y) const
33  {
34  return x != y;
35  }
36 };
37 
41 struct Equal
42 {
43  template <typename T, typename U>
44  VISKORES_EXEC_CONT bool operator()(const T& x, const U& y) const
45  {
46  return x == y;
47  }
48 };
49 
53 struct SortLess
54 {
55  template <typename T, typename U>
56  VISKORES_EXEC_CONT bool operator()(const T& x, const U& y) const
57  {
58  return x < y;
59  }
60 };
61 
65 
67 {
68  template <typename T, typename U>
69  VISKORES_EXEC_CONT bool operator()(const T& x, const U& y) const
70  {
71  return y < x;
72  }
73 };
74 
78 
79 struct LogicalAnd
80 {
81  template <typename T, typename U>
82  VISKORES_EXEC_CONT bool operator()(const T& x, const U& y) const
83  {
84  return x && y;
85  }
86 };
87 
91 struct LogicalOr
92 {
93  template <typename T, typename U>
94  VISKORES_EXEC_CONT bool operator()(const T& x, const U& y) const
95  {
96  return x || y;
97  }
98 };
99 
100 } // namespace viskores
101 
102 #endif //viskores_BinaryPredicates_h
viskores::SortLess
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is less...
Definition: BinaryPredicates.h:53
viskores::SortGreater::operator()
bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:69
viskores::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:79
VISKORES_EXEC_CONT
#define VISKORES_EXEC_CONT
Definition: ExportMacros.h:60
ExportMacros.h
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::LogicalOr::operator()
bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:94
viskores::Equal::operator()
bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:44
viskores::SortLess::operator()
bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:56
viskores::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:91
viskores::NotEqual::operator()
bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:32
viskores::LogicalAnd::operator()
bool operator()(const T &x, const U &y) const
Definition: BinaryPredicates.h:82
viskores::Equal
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is equa...
Definition: BinaryPredicates.h:41
viskores::NotEqual
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is not ...
Definition: BinaryPredicates.h:29
viskores::SortGreater
Binary Predicate that takes two arguments argument x, and y and returns True if and only if x is grea...
Definition: BinaryPredicates.h:66