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