Operators#

Equality#

struct equality#

Functor that tests for equality.

Public Functions

template<class T>
__host__ __device__ inline constexpr bool operator()(const T &a, const T &b) const#

Invocation operator.

Inequality#

struct inequality#

Functor that tests for inequality.

Public Functions

template<class T>
__host__ __device__ inline constexpr bool operator()(const T &a, const T &b) const#

Invocation operator.

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 have const &, but function object must not modify the objects passed to it.

template<class T>
__host__ __device__ inline bool operator()(const T &a, const T &b)#

Invocation operator.

Public Members

EqualityOp op#

A binary equality comparator (see constructor for details).

Sum#

struct sum#

Functor that returns the sum of its arguments.

Public Functions

template<class T>
__host__ __device__ inline constexpr T operator()(const T &a, const T &b) const#

Invocation operator.

Max/Min#

struct max#

Functor that returns the maximum of its arguments.

Public Functions

template<class T>
__host__ __device__ inline constexpr T operator()(const T &a, const T &b) const#

Invocation operator.

struct min#

Functor that returns the minimum of its arguments.

Public Functions

template<class T>
__host__ __device__ inline constexpr T operator()(const T &a, const T &b) const#

Invocation operator.

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)