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> _CCCL_HOST_DEVICE constant_iterator< ValueT, IndexT > make_constant_iterator(ValueT x,   IndexT i = int());
template <typename V> _CCCL_HOST_DEVICE constant_iterator< V > make_constant_iterator(V x);
template <typename Incrementable> _CCCL_HOST_DEVICE counting_iterator< Incrementable > make_counting_iterator(Incrementable x);
_CCCL_HOST_DEVICE discard_iterator make_discard_iterator(discard_iterator<>::difference_type i = discard_iterator<>::difference_type(0));
template <typename ElementIterator,   typename IndexIterator> _CCCL_HOST_DEVICE permutation_iterator< ElementIterator, IndexIterator > make_permutation_iterator(ElementIterator e,   IndexIterator i);
template <typename BidirectionalIterator> _CCCL_HOST_DEVICE reverse_iterator< BidirectionalIterator > make_reverse_iterator(BidirectionalIterator x);
template <typename InputFunction,   typename OutputFunction,   typename Iterator> transform_input_output_iterator< InputFunction, OutputFunction, Iterator > _CCCL_HOST_DEVICE make_transform_input_output_iterator(Iterator io,   InputFunction input_function,   OutputFunction output_function);
template <class AdaptableUnaryFunction,   class Iterator> _CCCL_HOST_DEVICE transform_iterator< AdaptableUnaryFunction, Iterator > make_transform_iterator(Iterator it,   AdaptableUnaryFunction fun);
template <typename UnaryFunction,   typename OutputIterator> transform_output_iterator< UnaryFunction, OutputIterator > _CCCL_HOST_DEVICE make_transform_output_iterator(OutputIterator out,   UnaryFunction fun);
template <typename... Iterators> _CCCL_HOST_DEVICE zip_iterator< thrust::tuple< Iterators... > > make_zip_iterator(thrust::tuple< Iterators... > t);
template <typename... Iterators> _CCCL_HOST_DEVICE zip_iterator< thrust::tuple< Iterators... > > 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 make_constant_iterator

template <typename ValueT,   typename IndexT> _CCCL_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 returned constant_iterator's constant value.
  • i The index of the returned constant_iterator within a sequence. The type of this parameter defaults to int. In the default case, the value of this parameter is 0.

Returns: A new constant_iterator with constant value & index as given by x & i.

See: constant_iterator

Function make_constant_iterator

template <typename V> _CCCL_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 make_counting_iterator

template <typename Incrementable> _CCCL_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 make_discard_iterator

_CCCL_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 make_permutation_iterator

template <typename ElementIterator,   typename IndexIterator> _CCCL_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 An ElementIterator pointing to a range of values.
  • i An IndexIterator pointing to an indexing scheme to use on e.

Returns: A new permutation_iterator which permutes the range e by i.

See: permutation_iterator

Function make_reverse_iterator

template <typename BidirectionalIterator> _CCCL_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 make_transform_input_output_iterator

template <typename InputFunction,   typename OutputFunction,   typename Iterator> transform_input_output_iterator< InputFunction, OutputFunction, Iterator > _CCCL_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 An Iterator pointing to where the input to InputFunction will be read from and the result of OutputFunction will be written to
  • input_function An InputFunction to be executed on values read from the iterator
  • output_function An OutputFunction to be executed on values written to the iterator

See: transform_input_output_iterator

Function make_transform_iterator

template <class AdaptableUnaryFunction,   class Iterator> _CCCL_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 The Iterator pointing to the input range of the newly created transform_iterator.
  • fun The AdaptableUnaryFunction used to transform the range pointed to by it in the newly created transform_iterator.

Returns: A new transform_iterator which transforms the range at it by fun.

See: transform_iterator

Function make_transform_output_iterator

template <typename UnaryFunction,   typename OutputIterator> transform_output_iterator< UnaryFunction, OutputIterator > _CCCL_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:

See: transform_output_iterator

Function make_zip_iterator

template <typename... Iterators> _CCCL_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 make_zip_iterator

template <typename... Iterators> _CCCL_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