Template Numerical Library: TNL::Algorithms::Segments::SegmentView< Index, RowMajorOrder > Class Template Reference

Template Numerical Library version\ main:be7e16d88

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
TNL::Algorithms::Segments::SegmentView< Index, RowMajorOrder > Class Template Reference

## 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)
| Constructor 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__ SegmentView & | operator= (const SegmentView &)=default
| Copy assignment operator.
__cuda_callable__ SegmentView & | operator= (SegmentView &&) noexcept=default
| Move assignment operator.

## Protected Attributes
IndexType | segmentIdx
IndexType | segmentOffset
IndexType | segmentSize

## Constructor & Destructor Documentation

## ◆ SegmentView()

template<typename Index>

__cuda_callable__ TNL::Algorithms::Segments::SegmentView< Index, RowMajorOrder >::SegmentView | ( | IndexType | segmentIdx,
|  | IndexType | offset,
|  | IndexType | size )
| inline

Constructor with all parameters.

Parameters

  segmentIdx | is an index of segment the segment view will point to.
  offset | is an offset of the segment in the parent segments.
  size | is a size of the segment.

## Member Function Documentation

## ◆ begin()

template<typename Index>

__cuda_callable__ IteratorType TNL::Algorithms::Segments::SegmentView< Index, RowMajorOrder >::begin | ( |  | ) | const
| inlinenodiscard

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, RowMajorOrder >::cbegin | ( |  | ) | const
| inlinenodiscard

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, RowMajorOrder >::cend | ( |  | ) | const
| inlinenodiscard

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, RowMajorOrder >::end | ( |  | ) | const
| inlinenodiscard

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, RowMajorOrder >::getGlobalIndex | ( | IndexType | localIndex | ) | const
| inlinenodiscard

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

Parameters

  localIndex | is 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, RowMajorOrder >::getSegmentIndex | ( |  | ) | const
| inlinenodiscard

Get index of the segment.

Returns
  index of the segment.

## ◆ getSize()

template<typename Index>

__cuda_callable__ IndexType TNL::Algorithms::Segments::SegmentView< Index, RowMajorOrder >::getSize | ( |  | ) | const
| inlinenodiscard

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:

- src/TNL/Algorithms/Segments/SegmentView.h