Operators#
Equality#
-
struct equality#
Functor that tests for equality.
Inequality#
-
struct inequality#
Functor that tests for inequality.
-
template<class EqualityOp>
struct inequality_wrapper# Functor that tests for inequality using a user-supplied equality comparator.
Public Functions
-
__host__ __device__ inline inequality_wrapper(EqualityOp op)#
Constructs the wrapper using the provided equality comparator.
- Parameters:
op – a binary equality comparator. The signature of the function should be equivalent to the following:
T f(const T &a, const T &b);
. The signature does not need to haveconst &
, but function object must not modify the objects passed to it.
Public Members
-
EqualityOp op#
A binary equality comparator (see constructor for details).
-
__host__ __device__ inline inequality_wrapper(EqualityOp op)#
Sum#
-
struct sum#
Functor that returns the sum of its arguments.
Max/Min#
-
struct max#
Functor that returns the maximum of its arguments.
-
struct min#
Functor that returns the minimum of its arguments.
ArgMax/ArgMin#
-
struct arg_max#
Functor that returns the “arg max” of the given key-value pairs.
The “arg max” of a key-value pair is defined as:
b: if b’s value is larger, or if the values are equal but b’s key is smaller.
a: otherwise
Public Functions
-
template<class Key, class Value>
__host__ __device__ inline constexpr key_value_pair<Key, Value> operator()(const key_value_pair<Key, Value> &a, const key_value_pair<Key, Value> &b) const# Invocation operator.
-
struct arg_min#
Functor that returns the “arg min” of the given key-value pairs.
The “arg min” of a key-value pair is defined as:
b: if b’s value is smaller, or if the values are equal but b’s key is smaller.
a: otherwise
Public Functions
-
template<class Key, class Value>
__host__ __device__ inline constexpr key_value_pair<Key, Value> operator()(const key_value_pair<Key, Value> &a, const key_value_pair<Key, Value> &b) const# Invocation operator (see struct description for details)