Bolt  1.3
C++ template library with support for OpenCL
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
bolt::amp::permutation_iterator< element_type, key_type > Class Template Reference

#include <permutation_iterator.h>

Inheritance diagram for bolt::amp::permutation_iterator< element_type, key_type >:

Public Types

typedef std::iterator
< permutation_iterator_tag,
typename element_type, int >
::difference_type 
difference_type
 
typedef permutation_iterator
< element_type, key_type > 
perm_iterator
 
typedef iterator_traits
< element_type >::value_type 
value_type
 
typedef iterator_traits
< key_type >::value_type 
index_type
 
typedef
concurrency::array_view
< value_type > 
arrayview_type
 

Public Member Functions

 permutation_iterator (element_type ivalue, key_type ikey, const control &ctl=control::getDefault())
 
template<typename OtherValType , typename OtherKeyType >
 permutation_iterator (const permutation_iterator< OtherValType, OtherKeyType > &rhs)
 
permutation_iterator
< element_type, key_type > & 
operator= (const permutation_iterator< element_type, key_type > &rhs)
 
permutation_iterator
< element_type, key_type > & 
operator+= (const difference_type &n) const restrict(cpu
 
const permutation_iterator
< element_type, key_type > 
operator+ (const difference_type &n) const restrict(cpu
 
result advance (n)
 
const permutation_iterator
< element_type, key_type > 
operator- (const difference_type &n) const restrict(cpu
 
result advance (-n)
 
const concurrency::array_view
< int > & 
getBuffer (perm_iterator itr) const
 
const permutation_iterator
< element_type, key_type > & 
getContainer () const
 
difference_type operator- (const permutation_iterator< element_type, key_type > &rhs) const
 
void advance (difference_type n) restrict(cpu
 
permutation_iterator
< element_type, key_type > 
operator++ ()
 
permutation_iterator
< element_type, key_type > 
operator++ (int)
 
permutation_iterator
< element_type, key_type > 
operator-- () const
 
permutation_iterator
< element_type, key_type > 
operator-- (int) const
 
difference_type getIndex () const
 
template<typename OtherValue , typename OtherKey >
bool operator== (const permutation_iterator< OtherValue, OtherKey > &rhs) const
 
template<typename OtherValue , typename OtherKey >
bool operator!= (const permutation_iterator< OtherValue, OtherKey > &rhs) const
 
template<typename OtherValue , typename OtherKey >
bool operator< (const permutation_iterator< OtherValue, OtherKey > &rhs) const
 
value_type & operator* () const restrict(cpu
 
value_type & operator[] (int x) restrict(cpu
 
value_type & operator[] (int x) const restrict(cpu
 

Public Attributes

permutation_iterator
< element_type, key_type > 
amp
 
return * this
 
const permutation_iterator
< element_type, key_type > 
amp
 
return result
 
difference_type m_Index
 
void amp
 
value_type amp
 
return element_iterator [temp_index]
 
key_type key_iterator
 
element_type element_iterator
 

Friends

template<typename , typename >
class permutation_iterator
 

Detailed Description

template<typename element_type, typename key_type>
class bolt::amp::permutation_iterator< element_type, key_type >

permutation_iterator permutes values in a range according to keys.

The following example demonstrates how to use a permutation_iterator.

#include <bolt/amp/permutation_iterator.h>
...
// Create device_vectors
bolt::amp::device_vector< int > values( 5 );
// Fill values
values[ 0 ] = 10 ; values[ 1 ] = 15 ; values[ 2 ] = 20 ;
values[ 3 ] = 25 ; values[ 4 ] = 30 ;
// Fill permutation indices
index[ 0 ] = 3 ; index[ 1 ] = 2 ; index[ 2 ] = 4 ;
index[ 3 ] = 0 ; index[ 4 ] = 1 ;
...
bolt::amp::transform( ctrl,
bolt::amp::make_permutation_iterator( values.begin( ), index.begin( ) ),
bolt::amp::make_permutation_iterator( values.end( ), index.end( ) ),
vecEmpty.begin( ),
vecDest.begin( ),
// Output:
// vecDest = { 25, 20, 30, 10, 15 }

The documentation for this class was generated from the following file: