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

Template Numerical Library version\ main:c7077e4fd

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)
| 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.
__cuda_callable__ void | setSegmentIndex (IndexType index)
| Set index of the segment.

## 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

  Index | is 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

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.
  step | is 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
| 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, ColumnMajorOrder >::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, ColumnMajorOrder >::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, ColumnMajorOrder >::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, ColumnMajorOrder >::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, ColumnMajorOrder >::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, ColumnMajorOrder >::getSize | ( |  | ) | const
| inlinenodiscard

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

Returns
  number of elements in the segment.

## ◆ setSegmentIndex()

template<typename Index>

__cuda_callable__ void TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder >::setSegmentIndex | ( | IndexType | index | ) |
| inline

Set index of the segment.

Parameters

  index | is the of the segment.

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

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