thrust::maximum
Defined in thrust/functional.h
-
template<typename T = void>
struct maximum : public cuda::maximum<void> maximum
is a function object that takes two arguments and returns the greater of the two. Specifically, it is an Adaptable Binary Function. Iff
is an object of classmaximum<T>
andx
andy
are objects of classT
f(x,y)
returnsx
ifx > y
andy
, otherwise.The following code snippet demonstrates that
maximum
returns its greater argument.#include <thrust/functional.h> #include <assert.h> ... int x = 137; int y = -137; thrust::maximum<int> mx; assert(x == mx(x,y));
See also
See also
min
See also
- Template Parameters
T – is a model of LessThan Comparable.