CUB
|
A random-access input wrapper for pairing dereferenced values with their corresponding indices (forming KeyValuePair
tuples).
itr
of type InputIteratorT
. Dereferencing an ArgIndexInputIteratorTat offset i
produces a KeyValuePair
value whose key
field is i
and whose value
field is itr[i]
.ArgIndexInputIteratorTto
dereference an array of doubles InputIteratorT | The value type of the wrapped input iterator |
OffsetT | The difference type of this iterator (Default: ptrdiff_t ) |
OutputValueT | The paired value type of the <offset,value> tuple (Default: value type of input iterator) |
Public Types | |
typedef ArgIndexInputIterator | self_type |
My own type. More... | |
typedef OffsetT | difference_type |
Type to express the result of subtracting one iterator from another. More... | |
typedef KeyValuePair < difference_type, OutputValueT > | value_type |
The type of the element the iterator can point to. More... | |
typedef value_type * | pointer |
The type of a pointer to an element the iterator can point to. More... | |
typedef value_type | reference |
The type of a reference to an element the iterator can point to. More... | |
typedef std::random_access_iterator_tag | iterator_category |
The iterator category. More... | |
Public Methods | |
__host__ __device__ __forceinline__ | ArgIndexInputIterator (InputIteratorT itr, difference_type offset=0) |
Constructor. More... | |
__host__ __device__ __forceinline__ self_type | operator++ (int) |
Postfix increment. More... | |
__host__ __device__ __forceinline__ self_type | operator++ () |
Prefix increment. More... | |
__host__ __device__ __forceinline__ reference | operator* () const |
Indirection. More... | |
template<typename Distance > | |
__host__ __device__ __forceinline__ self_type | operator+ (Distance n) const |
Addition. More... | |
template<typename Distance > | |
__host__ __device__ __forceinline__ self_type & | operator+= (Distance n) |
Addition assignment. More... | |
template<typename Distance > | |
__host__ __device__ __forceinline__ self_type | operator- (Distance n) const |
Subtraction. More... | |
template<typename Distance > | |
__host__ __device__ __forceinline__ self_type & | operator-= (Distance n) |
Subtraction assignment. More... | |
__host__ __device__ __forceinline__ difference_type | operator- (self_type other) const |
Distance. More... | |
template<typename Distance > | |
__host__ __device__ __forceinline__ reference | operator[] (Distance n) const |
Array subscript. More... | |
__host__ __device__ __forceinline__ pointer | operator-> () |
Structure dereference. More... | |
__host__ __device__ __forceinline__ bool | operator== (const self_type &rhs) |
Equal to. More... | |
__host__ __device__ __forceinline__ bool | operator!= (const self_type &rhs) |
Not equal to. More... | |
__host__ __device__ __forceinline__ void | normalize () |
Normalize. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const self_type &) |
ostream operator More... | |
typedef ArgIndexInputIterator cub::ArgIndexInputIterator< InputIteratorT, OffsetT, OutputValueT >::self_type |
My own type.
typedef OffsetT cub::ArgIndexInputIterator< InputIteratorT, OffsetT, OutputValueT >::difference_type |
Type to express the result of subtracting one iterator from another.
typedef KeyValuePair<difference_type, OutputValueT> cub::ArgIndexInputIterator< InputIteratorT, OffsetT, OutputValueT >::value_type |
The type of the element the iterator can point to.
typedef value_type* cub::ArgIndexInputIterator< InputIteratorT, OffsetT, OutputValueT >::pointer |
The type of a pointer to an element the iterator can point to.
typedef value_type cub::ArgIndexInputIterator< InputIteratorT, OffsetT, OutputValueT >::reference |
The type of a reference to an element the iterator can point to.
typedef std::random_access_iterator_tag cub::ArgIndexInputIterator< InputIteratorT, OffsetT, OutputValueT >::iterator_category |
The iterator category.
|
inline |
Constructor.
itr | Input iterator to wrap |
offset | OffsetT (in items) from itr denoting the position of the iterator |
|
inline |
Postfix increment.
|
inline |
Prefix increment.
|
inline |
Indirection.
|
inline |
Addition.
|
inline |
Addition assignment.
|
inline |
Subtraction.
|
inline |
Subtraction assignment.
|
inline |
Distance.
|
inline |
Array subscript.
|
inline |
Structure dereference.
|
inline |
Equal to.
|
inline |
Not equal to.
|
inline |
Normalize.
|
friend |
ostream operator