Template Struct unary_negate¶
Defined in File functional.h
Inheritance Relationships¶
Base Type¶
public thrust::unary_function< Predicate::argument_type, bool >
(Template Struct unary_function)
Struct Documentation¶
-
template<typename
Predicate
>
structunary_negate
: public thrust::unary_function<Predicate::argument_type, bool>¶ unary_negate
is a function object adaptor: it is an Adaptable Predicate that represents the logical negation of some other Adaptable Predicate. That is: iff
is an object of classunary_negate<AdaptablePredicate>
, then there exists an objectpred
of classAdaptablePredicate
such thatf(x)
always returns the same value as!pred(x)
. There is rarely any reason to construct aunary_negate
directly; it is almost always easier to use the helper function not1.Public Functions
-
__host__ __device__ thrust::unary_negate::unary_negate(Predicate p)
Constructor takes a
Predicate
object to negate.- Parameters
p
: ThePredicate
object to negate.
-
__host__ __device__ bool thrust::unary_negate::operator()(const typename Predicate::argument_type & x)
Function call operator. The return value is
!pred(x)
.
-