Template Numerical Library version\ main:f17d0c8
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder > Class Template Reference

Data structure for accessing particular segment. More...

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

Public Types

using IndexType = Index
 Type for indexing elements in related segments.
 
using IteratorType = SegmentViewIterator< SegmentView >
 Type of iterator for iterating over elements of the segment.
 

Public Member Functions

__cuda_callable__ SegmentView (const SegmentView &)=default
 Copy constructor.
 
__cuda_callable__ SegmentView (IndexType segmentIdx, IndexType offset, IndexType size, IndexType step)
 Conctructor with all parameters.
 
__cuda_callable__ SegmentView (SegmentView &&) noexcept=default
 Move constructor.
 
__cuda_callable__ IteratorType begin () const
 Returns iterator pointing at the beginning of the segment.
 
__cuda_callable__ IteratorType cbegin () const
 Returns constant iterator pointing at the beginning of the segment.
 
__cuda_callable__ IteratorType cend () const
 Returns constant iterator pointing at the end of the segment.
 
__cuda_callable__ IteratorType end () const
 Returns iterator pointing at the end of the segment.
 
__cuda_callable__ IndexType getGlobalIndex (IndexType localIndex) const
 Get global index of an element with rank localIndex in the segment.
 
__cuda_callable__ IndexType getSegmentIndex () const
 Get index of the segment.
 
__cuda_callable__ IndexType getSize () const
 Get the size of the segment, i.e. number of elements in the segment.
 
__cuda_callable__ SegmentViewoperator= (const SegmentView &)=default
 Copy assignment operator.
 
__cuda_callable__ SegmentViewoperator= (SegmentView &&) noexcept=default
 Move assignment operator.
 

Protected Attributes

IndexType segmentIdx
 
IndexType segmentOffset
 
IndexType segmentSize
 
IndexType step
 

Detailed Description

template<typename Index>
class TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >

Data structure for accessing particular segment.

Template Parameters
Indexis type for indexing elements in related segments.

Constructor & Destructor Documentation

◆ SegmentView()

template<typename Index >
__cuda_callable__ TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >::SegmentView ( IndexType segmentIdx,
IndexType offset,
IndexType size,
IndexType step )
inline

Conctructor with all parameters.

Parameters
segmentIdxis an index of segment the segment view will point to.
offsetis an offset of the segment in the parent segments.
sizeis a size of the segment.
stepis stepping between neighbouring elements in the segment.

Member Function Documentation

◆ begin()

template<typename Index >
__cuda_callable__ IteratorType TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >::begin ( ) const
inline

Returns iterator pointing at the beginning of the segment.

Returns
iterator pointing at the beginning.

◆ cbegin()

template<typename Index >
__cuda_callable__ IteratorType TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >::cbegin ( ) const
inline

Returns constant iterator pointing at the beginning of the segment.

Returns
iterator pointing at the beginning.

◆ cend()

template<typename Index >
__cuda_callable__ IteratorType TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >::cend ( ) const
inline

Returns constant iterator pointing at the end of the segment.

Returns
iterator pointing at the end.

◆ end()

template<typename Index >
__cuda_callable__ IteratorType TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >::end ( ) const
inline

Returns iterator pointing at the end of the segment.

Returns
iterator pointing at the end.

◆ getGlobalIndex()

template<typename Index >
__cuda_callable__ IndexType TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >::getGlobalIndex ( IndexType localIndex) const
inline

Get global index of an element with rank localIndex in the segment.

Parameters
localIndexis the rank of the element in the segment.
Returns
global index of the element.

◆ getSegmentIndex()

template<typename Index >
__cuda_callable__ IndexType TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >::getSegmentIndex ( ) const
inline

Get index of the segment.

Returns
index of the segment.

◆ getSize()

template<typename Index >
__cuda_callable__ IndexType TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >::getSize ( ) const
inline

Get the size of the segment, i.e. number of elements in the segment.

Returns
number of elements in the segment.

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