thrust
Classes | Functions
Function Object Adaptors

Classes

struct  thrust::unary_function< Argument, Result >
 
struct  thrust::binary_function< Argument1, Argument2, Result >
 
struct  thrust::unary_negate< Predicate >
 
struct  thrust::binary_negate< Predicate >
 

Functions

template<typename Predicate >
__host__ __device__
unary_negate< Predicate > 
thrust::not1 (const Predicate &pred)
 
template<typename BinaryPredicate >
__host__ __device__
binary_negate< BinaryPredicate > 
thrust::not2 (const BinaryPredicate &pred)
 

Detailed Description

Function Documentation

template<typename Predicate >
__host__ __device__ unary_negate<Predicate> thrust::not1 ( const Predicate &  pred)

not1 is a helper function to simplify the creation of Adaptable Predicates: it takes an Adaptable Predicate pred as an argument and returns a new Adaptable Predicate that represents the negation of pred. That is: if pred is an object of a type which models Adaptable Predicate, then the the type of the result npred of not1(pred) is also a model of Adaptable Predicate and npred(x) always returns the same value as !pred(x).

Parameters
predThe Adaptable Predicate to negate.
Returns
A new object, npred such that npred(x) always returns the same value as !pred(x).
Template Parameters
Predicateis a model of Adaptable Predicate.
See Also
unary_negate
not2
template<typename BinaryPredicate >
__host__ __device__ binary_negate<BinaryPredicate> thrust::not2 ( const BinaryPredicate &  pred)

not2 is a helper function to simplify the creation of Adaptable Binary Predicates: it takes an Adaptable Binary Predicate pred as an argument and returns a new Adaptable Binary Predicate that represents the negation of pred. That is: if pred is an object of a type which models Adaptable Binary Predicate, then the the type of the result npred of not2(pred) is also a model of Adaptable Binary Predicate and npred(x,y) always returns the same value as !pred(x,y).

Parameters
predThe Adaptable Binary Predicate to negate.
Returns
A new object, npred such that npred(x,y) always returns the same value as !pred(x,y).
Template Parameters
BinaryPredicate is a model of Adaptable Binary Predicate.
See Also
binary_negate
not1