Gyselalib++
 
Loading...
Searching...
No Matches
IdxRangeSliceIterator< Grid1D > Struct Template Reference

An iterator type for the IdxRangeSlice. More...

Public Types

using iterator_category = std::random_access_iterator_tag
 The type of iterator.
 
using value_type = Idx< Grid1D >
 The type of the values stored in the iterator.
 
using stride_type = IdxStep< Grid1D >
 The type of the stride between values.
 
using difference_type = std::ptrdiff_t
 The type that can be used to increment the iterator.
 

Public Member Functions

KOKKOS_FUNCTION constexpr IdxRangeSliceIterator (Idx< Grid1D > value, IdxStep< Grid1D > stride)
 Build an iterator using the current value and the distance to the following element.
 
KOKKOS_FUNCTION constexpr Idx< Grid1D > operator* () const noexcept
 Get the value referred to by the iterator.
 
KOKKOS_FUNCTION constexpr IdxRangeSliceIteratoroperator++ ()
 The prefix increment operator.
 
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator operator++ (int)
 The postfix increment operator.
 
KOKKOS_FUNCTION constexpr IdxRangeSliceIteratoroperator-- ()
 The prefix decrement operator.
 
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator operator-- (int)
 The postfix decrement operator.
 
KOKKOS_FUNCTION constexpr IdxRangeSliceIteratoroperator+= (difference_type n)
 Increment the current iterator by n elements.
 
KOKKOS_FUNCTION constexpr IdxRangeSliceIteratoroperator-= (difference_type n)
 Decrement the current iterator by n elements.
 
KOKKOS_FUNCTION constexpr Idx< Grid1D > operator[] (difference_type n) const
 Access the n-th following element.
 

Friends

KOKKOS_FUNCTION constexpr bool operator== (IdxRangeSliceIterator const &xx, IdxRangeSliceIterator const &yy)
 Compare iterator equality.
 
KOKKOS_FUNCTION constexpr bool operator!= (IdxRangeSliceIterator const &xx, IdxRangeSliceIterator const &yy)
 Compare iterator non-equality.
 
KOKKOS_FUNCTION constexpr bool operator< (IdxRangeSliceIterator const &xx, IdxRangeSliceIterator const &yy)
 Compare the order of iterators.
 
KOKKOS_FUNCTION constexpr bool operator> (IdxRangeSliceIterator const &xx, IdxRangeSliceIterator const &yy)
 Compare the order of iterators.
 
KOKKOS_FUNCTION constexpr bool operator<= (IdxRangeSliceIterator const &xx, IdxRangeSliceIterator const &yy)
 Compare the order of iterators.
 
KOKKOS_FUNCTION constexpr bool operator>= (IdxRangeSliceIterator const &xx, IdxRangeSliceIterator const &yy)
 Compare the order of iterators.
 
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator operator+ (IdxRangeSliceIterator i, difference_type n)
 Increment an iterator by n elements.
 
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator operator+ (difference_type n, IdxRangeSliceIterator i)
 Increment an iterator by n elements.
 
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator operator- (IdxRangeSliceIterator i, difference_type n)
 Decrement an iterator by n elements.
 
KOKKOS_FUNCTION constexpr difference_type operator- (IdxRangeSliceIterator const &xx, IdxRangeSliceIterator const &yy)
 Decrement an iterator by n elements.
 

Detailed Description

template<class Grid1D>
struct IdxRangeSliceIterator< Grid1D >

An iterator type for the IdxRangeSlice.

Constructor & Destructor Documentation

◆ IdxRangeSliceIterator()

template<class Grid1D >
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator< Grid1D >::IdxRangeSliceIterator ( Idx< Grid1D >  value,
IdxStep< Grid1D >  stride 
)
inlineexplicitconstexpr

Build an iterator using the current value and the distance to the following element.

Parameters
valueThe value of the discrete sub-index range element.
strideThe stride between consectuive sub-index range elements.

Member Function Documentation

◆ operator*()

template<class Grid1D >
KOKKOS_FUNCTION constexpr Idx< Grid1D > IdxRangeSliceIterator< Grid1D >::operator* ( ) const
inlineconstexprnoexcept

Get the value referred to by the iterator.

Returns
The value referred to by the iterator.

◆ operator++() [1/2]

template<class Grid1D >
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator & IdxRangeSliceIterator< Grid1D >::operator++ ( )
inlineconstexpr

The prefix increment operator.

Returns
A reference to the current incremented iterator.

◆ operator++() [2/2]

template<class Grid1D >
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator IdxRangeSliceIterator< Grid1D >::operator++ ( int  )
inlineconstexpr

The postfix increment operator.

Returns
A reference to the non-incremented iterator.

◆ operator--() [1/2]

template<class Grid1D >
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator & IdxRangeSliceIterator< Grid1D >::operator-- ( )
inlineconstexpr

The prefix decrement operator.

Returns
A reference to the current decremented iterator.

◆ operator--() [2/2]

template<class Grid1D >
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator IdxRangeSliceIterator< Grid1D >::operator-- ( int  )
inlineconstexpr

The postfix decrement operator.

Returns
A reference to the non-decremented iterator.

◆ operator+=()

template<class Grid1D >
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator & IdxRangeSliceIterator< Grid1D >::operator+= ( difference_type  n)
inlineconstexpr

Increment the current iterator by n elements.

Parameters
nThe number of strides by which the iterator should be incremented.
Returns
A reference to the current incremented iterator.

◆ operator-=()

template<class Grid1D >
KOKKOS_FUNCTION constexpr IdxRangeSliceIterator & IdxRangeSliceIterator< Grid1D >::operator-= ( difference_type  n)
inlineconstexpr

Decrement the current iterator by n elements.

Parameters
nThe number of strides by which the iterator should be decremented.
Returns
A reference to the current decremented iterator.

◆ operator[]()

template<class Grid1D >
KOKKOS_FUNCTION constexpr Idx< Grid1D > IdxRangeSliceIterator< Grid1D >::operator[] ( difference_type  n) const
inlineconstexpr

Access the n-th following element.

Parameters
nThe index of the element.
Returns
The Idx n-th position in the sub-index range following the value indicated by this iterator.

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