Template Numerical Library version\ main:bb09b17
Loading...
Searching...
No Matches
TNL::Algorithms::Segments::SegmentViewIterator< SegmentView > Class Template Reference

Iterator for iterating over elements of a segment. More...

#include <TNL/Algorithms/Segments/SegmentViewIterator.h>

Collaboration diagram for TNL::Algorithms::Segments::SegmentViewIterator< SegmentView >:

Public Types

using IndexType = typename SegmentViewType::IndexType
 The type used for matrix elements indexing.
 
using SegmentElementType = SegmentElement< IndexType >
 The type of related matrix element.
 
using SegmentViewType = SegmentView
 Type of SegmentView.
 

Public Member Functions

__cuda_callable__ SegmentViewIterator (const SegmentViewType &segmentView, IndexType localIdx)
 
__cuda_callable__ bool operator!= (const SegmentViewIterator &other) const
 Comparison of two matrix Segment iterators.
 
__cuda_callable__ SegmentElementType operator* () const
 Operator for derefrencing the iterator.
 
__cuda_callable__ SegmentViewIteratoroperator++ ()
 Operator for incrementing the iterator, i.e. moving to the next element.
 
__cuda_callable__ SegmentViewIteratoroperator-- ()
 Operator for decrementing the iterator, i.e. moving to the previous element.
 
__cuda_callable__ bool operator== (const SegmentViewIterator &other) const
 Comparison of two matrix Segment iterators.
 

Protected Attributes

IndexType localIdx = 0
 
const SegmentViewTypesegmentView
 

Detailed Description

template<typename SegmentView>
class TNL::Algorithms::Segments::SegmentViewIterator< SegmentView >

Iterator for iterating over elements of a segment.

The iterator can be used even in GPU kernels.

Template Parameters
SegmentViewis a type of related segment view.

Member Function Documentation

◆ operator!=()

template<typename SegmentView >
__cuda_callable__ bool TNL::Algorithms::Segments::SegmentViewIterator< SegmentView >::operator!= ( const SegmentViewIterator< SegmentView > & other) const
nodiscard

Comparison of two matrix Segment iterators.

Parameters
otheris another matrix Segment iterator.
Returns
false if both iterators points at the same point of the same matrix, true otherwise.

◆ operator*()

template<typename SegmentView >
__cuda_callable__ auto TNL::Algorithms::Segments::SegmentViewIterator< SegmentView >::operator* ( ) const
nodiscard

Operator for derefrencing the iterator.

It returns structure SegmentElementType which represent one element of a segment.

Returns
segment element the iterator points to.

◆ operator++()

Operator for incrementing the iterator, i.e. moving to the next element.

Returns
reference to this iterator.

◆ operator--()

Operator for decrementing the iterator, i.e. moving to the previous element.

Returns
reference to this iterator.

◆ operator==()

template<typename SegmentView >
__cuda_callable__ bool TNL::Algorithms::Segments::SegmentViewIterator< SegmentView >::operator== ( const SegmentViewIterator< SegmentView > & other) const
nodiscard

Comparison of two matrix Segment iterators.

Parameters
otheris another matrix Segment iterator.
Returns
true if both iterators points at the same point of the same matrix, false otherwise.

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