Fancy Iterators
template <typename Value, typename Incrementable = use_default, typename System = use_default> class thrust::constant_iterator;
template <typename Incrementable, typename System = use_default, typename Traversal = use_default, typename Difference = use_default> class thrust::counting_iterator;
template <typename System = use_default> class thrust::discard_iterator;
template <typename Derived, typename Base, typename Value = use_default, typename System = use_default, typename Traversal = use_default, typename Reference = use_default, typename Difference = use_default> class thrust::iterator_adaptor;
template <typename Derived, typename Value, typename System, typename Traversal, typename Reference, typename Difference = std::ptrdiff_t> class thrust::iterator_facade;
class thrust::iterator_core_access;
template <typename ElementIterator, typename IndexIterator> class thrust::permutation_iterator;
template <typename BidirectionalIterator> class thrust::reverse_iterator;
template <typename InputFunction, typename OutputFunction, typename Iterator> class thrust::transform_input_output_iterator;
template <class AdaptableUnaryFunction, class Iterator, class Reference = use_default, class Value = use_default> class thrust::transform_iterator;
template <typename UnaryFunction, typename OutputIterator> class thrust::transform_output_iterator;
template <typename IteratorTuple> class thrust::zip_iterator;
template <typename ValueT, typename IndexT> __host__ __device__ constant_iterator< ValueT, IndexT > thrust::make_constant_iterator(ValueT x, IndexT i = int());
template <typename V> __host__ __device__ constant_iterator< V > thrust::make_constant_iterator(V x);
template <typename Incrementable> __host__ __device__ counting_iterator< Incrementable > thrust::make_counting_iterator(Incrementable x);
__host__ __device__ discard_iterator thrust::make_discard_iterator(discard_iterator<>::difference_type i = discard_iterator<>::difference_type(0));
template <typename ElementIterator, typename IndexIterator> __host__ __device__ permutation_iterator< ElementIterator, IndexIterator > thrust::make_permutation_iterator(ElementIterator e, IndexIterator i);
template <typename BidirectionalIterator> __host__ __device__ reverse_iterator< BidirectionalIterator > thrust::make_reverse_iterator(BidirectionalIterator x);
template <typename InputFunction, typename OutputFunction, typename Iterator> transform_input_output_iterator< InputFunction, OutputFunction, Iterator > __host__ __device__ thrust::make_transform_input_output_iterator(Iterator io, InputFunction input_function, OutputFunction output_function);
template <class AdaptableUnaryFunction, class Iterator> __host__ __device__ transform_iterator< AdaptableUnaryFunction, Iterator > thrust::make_transform_iterator(Iterator it, AdaptableUnaryFunction fun);
template <typename UnaryFunction, typename OutputIterator> transform_output_iterator< UnaryFunction, OutputIterator > __host__ __device__ thrust::make_transform_output_iterator(OutputIterator out, UnaryFunction fun);
template <typename... Iterators> __host__ __device__ zip_iterator< thrust::tuple< Iterators... > > thrust::make_zip_iterator(thrust::tuple< Iterators... > t);
template <typename... Iterators> __host__ __device__ zip_iterator< thrust::tuple< Iterators... > > thrust::make_zip_iterator(Iterators... its);
Member Classes
Class thrust::constant_iterator
Inherits From: detail::constant_iterator_base::type
Class thrust::counting_iterator
Inherits From: detail::counting_iterator_base::type
Class thrust::discard_iterator
Inherits From: detail::discard_iterator_base::type
Class thrust::iterator_adaptor
Inherits From: detail::iterator_adaptor_base::type
Class thrust::iterator_facade
Class thrust::iterator_core_access
Class thrust::permutation_iterator
Inherits From: thrust::detail::permutation_iterator_base::type
Class thrust::reverse_iterator
Inherits From: detail::reverse_iterator_base::type
Class thrust::transform_input_output_iterator
Inherits From: detail::transform_input_output_iterator_base::type
Class thrust::transform_iterator
Inherits From: detail::transform_iterator_base::type
Class thrust::transform_output_iterator
Inherits From: detail::transform_output_iterator_base::type
Class thrust::zip_iterator
Inherits From: detail::zip_iterator_base::type
Functions
Function thrust::make_constant_iterator
template <typename ValueT, typename IndexT> __host__ __device__ constant_iterator< ValueT, IndexT > make_constant_iterator(ValueT x, IndexT i = int());
This version of make_constant_iterator
creates a constant_iterator
from values given for both value and index. The type of constant_iterator
may be inferred by the compiler from the types of its parameters.
Function Parameters:
x
The value of the returnedconstant_iterator's
constant value.i
The index of the returnedconstant_iterator
within a sequence. The type of this parameter defaults toint
. In the default case, the value of this parameter is0
.
Returns: A new constant_iterator
with constant value & index as given by x
& i
.
See: constant_iterator
Function thrust::make_constant_iterator
template <typename V> __host__ __device__ constant_iterator< V > make_constant_iterator(V x);
This version of make_constant_iterator
creates a constant_iterator
using only a parameter for the desired constant value. The value of the returned constant_iterator's
index is set to 0
.
Function Parameters: x
: The value of the returned constant_iterator's
constant value.
Returns: A new constant_iterator
with constant value equal to x
and index equal to 0
.
See: constant_iterator
Function thrust::make_counting_iterator
template <typename Incrementable> __host__ __device__ counting_iterator< Incrementable > make_counting_iterator(Incrementable x);
make_counting_iterator
creates a counting_iterator
using an initial value for its Incrementable
counter.
Function Parameters: x
: The initial value of the new counting_iterator's
counter.
Returns: A new counting_iterator
whose counter has been initialized to x
.
Function thrust::make_discard_iterator
__host__ __device__ discard_iterator make_discard_iterator(discard_iterator<>::difference_type i = discard_iterator<>::difference_type(0));
make_discard_iterator
creates a discard_iterator
from an optional index parameter.
Function Parameters: i
: The index of the returned discard_iterator
within a range. In the default case, the value of this parameter is 0
.
Returns: A new discard_iterator
with index as given by i
.
See: constant_iterator
Function thrust::make_permutation_iterator
template <typename ElementIterator, typename IndexIterator> __host__ __device__ permutation_iterator< ElementIterator, IndexIterator > make_permutation_iterator(ElementIterator e, IndexIterator i);
make_permutation_iterator
creates a permutation_iterator
from an ElementIterator
pointing to a range of elements to “permute” and an IndexIterator
pointing to a range of indices defining an indexing scheme on the values.
Function Parameters:
e
AnElementIterator
pointing to a range of values.i
AnIndexIterator
pointing to an indexing scheme to use one
.
Returns: A new permutation_iterator
which permutes the range e
by i
.
See: permutation_iterator
Function thrust::make_reverse_iterator
template <typename BidirectionalIterator> __host__ __device__ reverse_iterator< BidirectionalIterator > make_reverse_iterator(BidirectionalIterator x);
make_reverse_iterator
creates a reverse_iterator
from a BidirectionalIterator
pointing to a range of elements to reverse.
Function Parameters: x
: A BidirectionalIterator
pointing to a range to reverse.
Returns: A new reverse_iterator
which reverses the range x
.
Function thrust::make_transform_input_output_iterator
template <typename InputFunction, typename OutputFunction, typename Iterator> transform_input_output_iterator< InputFunction, OutputFunction, Iterator > __host__ __device__ make_transform_input_output_iterator(Iterator io, InputFunction input_function, OutputFunction output_function);
make_transform_input_output_iterator
creates a transform_input_output_iterator
from an Iterator
a InputFunction
and a OutputFunction
Function Parameters:
io
AnIterator
pointing to where the input toInputFunction
will be read from and the result ofOutputFunction
will be written toinput_function
AnInputFunction
to be executed on values read from the iteratoroutput_function
AnOutputFunction
to be executed on values written to the iterator
See: transform_input_output_iterator
Function thrust::make_transform_iterator
template <class AdaptableUnaryFunction, class Iterator> __host__ __device__ transform_iterator< AdaptableUnaryFunction, Iterator > make_transform_iterator(Iterator it, AdaptableUnaryFunction fun);
make_transform_iterator
creates a transform_iterator
from an Iterator
and AdaptableUnaryFunction
.
Function Parameters:
it
TheIterator
pointing to the input range of the newly createdtransform_iterator
.fun
TheAdaptableUnaryFunction
used to transform the range pointed to byit
in the newly createdtransform_iterator
.
Returns: A new transform_iterator
which transforms the range at it
by fun
.
See: transform_iterator
Function thrust::make_transform_output_iterator
template <typename UnaryFunction, typename OutputIterator> transform_output_iterator< UnaryFunction, OutputIterator > __host__ __device__ make_transform_output_iterator(OutputIterator out, UnaryFunction fun);
make_transform_output_iterator
creates a transform_output_iterator
from an OutputIterator
and UnaryFunction
.
Function Parameters:
out
TheOutputIterator
pointing to the output range of the newly createdtransform_output_iterator
fun
TheUnaryFunction
transform the object before assigning it toout
by the newly createdtransform_output_iterator
See: transform_output_iterator
Function thrust::make_zip_iterator
template <typename... Iterators> __host__ __device__ zip_iterator< thrust::tuple< Iterators... > > make_zip_iterator(thrust::tuple< Iterators... > t);
make_zip_iterator
creates a zip_iterator
from a tuple
of iterators.
Function Parameters: t
: The tuple
of iterators to copy.
Returns: A newly created zip_iterator
which zips the iterators encapsulated in t
.
See: zip_iterator
Function thrust::make_zip_iterator
template <typename... Iterators> __host__ __device__ zip_iterator< thrust::tuple< Iterators... > > make_zip_iterator(Iterators... its);
make_zip_iterator
creates a zip_iterator
from iterators.
Function Parameters: its
: The iterators to copy.
Returns: A newly created zip_iterator
which zips the iterators.
See: zip_iterator