Template Struct unary_negate

Inheritance Relationships

Base Type

Struct Documentation

template<typename Predicate>
struct unary_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: if f is an object of class unary_negate<AdaptablePredicate>, then there exists an object pred of class AdaptablePredicate such that f(x) always returns the same value as !pred(x). There is rarely any reason to construct a unary_negate directly; it is almost always easier to use the helper function not1.

See

http://www.sgi.com/tech/stl/unary_negate.html

See

not1

Public Functions

__host__ __device__ thrust::unary_negate::unary_negate(Predicate p)

Constructor takes a Predicate object to negate.

Parameters
  • p: The Predicate 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).