Thrust

#include <thrust/functional.h>
Public Types  
typedef T  argument_type 
The type of the function object's argument.  
typedef T  result_type 
The type of the function object's result;.  
Public Member Functions  
__thrust_exec_check_disable__ __host__ __device__ constexpr T  operator() (const T &x) const 
negate
is a function object. Specifically, it is an Adaptable Unary Function. If f
is an object of class negate<T>
, and x
is an object of class T
, then f(x)
returns x
.
T  is a model of Assignable, and if x is an object of type T , then x must be defined and must have a return type that is convertible to T . 
The following code snippet demonstrates how to use negate
to negate the elements of a device_vector of floats
.