NeoN
A framework for CFD software
Loading...
Searching...
No Matches
NeoN::SegmentedVector< ValueType, IndexType > Class Template Reference

Data structure that stores a segmented fields or a vector of vectors. More...

#include <segmentedVector.hpp>

Inheritance diagram for NeoN::SegmentedVector< ValueType, IndexType >:
NeoN::SupportsCopyTo< SegmentedVector< ValueType, IndexType > >

Public Member Functions

 SegmentedVector (const Executor &exec, sizeType size, localIdx numSegments)
 Create a segmented vector with a given size and number of segments.
 SegmentedVector (const Vector< IndexType > &intervals)
 SegmentedVector (const Vector< ValueType > &values, const Vector< IndexType > &segments)
 Constructor to create a segmentedVector from values and the segments.
const Executor & exec () const
 Get the executor associated with the segmented vector.
sizeType size () const
 Get the size of the segmented vector.
sizeType numSegments () const
 Get the number of segments in the segmented vector.
SegmentedVector< ValueType, IndexType > copyToExecutor (Executor exec) const override
SegmentedVectorView< ValueType, IndexType > view () &
 get a view of the segmented vector
SegmentedVectorView< ValueType, IndexType > view () &&=delete
std::pair< View< ValueType >, View< IndexType > > views () &
 get the combined value and range views of the segmented vector
std::pair< View< ValueType >, View< IndexType > > views () &&=delete
const Vector< ValueType > & values () const
const Vector< IndexType > & segments () const
Public Member Functions inherited from NeoN::SupportsCopyTo< SegmentedVector< ValueType, IndexType > >
virtual ~SupportsCopyTo ()=default
SegmentedVector< ValueType, IndexType > copyToHost () const

Detailed Description

template<typename ValueType, typename IndexType>
class NeoN::SegmentedVector< ValueType, IndexType >

Data structure that stores a segmented fields or a vector of vectors.

Definition at line 159 of file segmentedVector.hpp.

Constructor & Destructor Documentation

◆ SegmentedVector() [1/3]

template<typename ValueType, typename IndexType>
NeoN::SegmentedVector< ValueType, IndexType >::SegmentedVector ( const Executor & exec,
sizeType size,
localIdx numSegments )
inline

Create a segmented vector with a given size and number of segments.

Parameters
execExecutor associated to the matrix
sizesize of the matrix
numSegmentsnumber of segments

Definition at line 169 of file segmentedVector.hpp.

◆ SegmentedVector() [2/3]

template<typename ValueType, typename IndexType>
NeoN::SegmentedVector< ValueType, IndexType >::SegmentedVector ( const Vector< IndexType > & intervals)
inline

Definition at line 178 of file segmentedVector.hpp.

◆ SegmentedVector() [3/3]

template<typename ValueType, typename IndexType>
NeoN::SegmentedVector< ValueType, IndexType >::SegmentedVector ( const Vector< ValueType > & values,
const Vector< IndexType > & segments )
inline

Constructor to create a segmentedVector from values and the segments.

Parameters
valuesThe values of the segmented vector.
segmentsThe segments of the segmented vector.

Definition at line 192 of file segmentedVector.hpp.

Member Function Documentation

◆ copyToExecutor()

template<typename ValueType, typename IndexType>
SegmentedVector< ValueType, IndexType > NeoN::SegmentedVector< ValueType, IndexType >::copyToExecutor ( Executor exec) const
inlinenodiscardoverridevirtual

◆ exec()

template<typename ValueType, typename IndexType>
const Executor & NeoN::SegmentedVector< ValueType, IndexType >::exec ( ) const
inline

Get the executor associated with the segmented vector.

Returns
Reference to the executor.

Definition at line 203 of file segmentedVector.hpp.

◆ numSegments()

template<typename ValueType, typename IndexType>
sizeType NeoN::SegmentedVector< ValueType, IndexType >::numSegments ( ) const
inline

Get the number of segments in the segmented vector.

Returns
The number of segments.

Definition at line 215 of file segmentedVector.hpp.

◆ segments()

template<typename ValueType, typename IndexType>
const Vector< IndexType > & NeoN::SegmentedVector< ValueType, IndexType >::segments ( ) const
inline

Definition at line 252 of file segmentedVector.hpp.

◆ size()

template<typename ValueType, typename IndexType>
sizeType NeoN::SegmentedVector< ValueType, IndexType >::size ( ) const
inline

Get the size of the segmented vector.

Returns
The size of the segmented vector.

Definition at line 209 of file segmentedVector.hpp.

◆ values()

template<typename ValueType, typename IndexType>
const Vector< ValueType > & NeoN::SegmentedVector< ValueType, IndexType >::values ( ) const
inline

Definition at line 250 of file segmentedVector.hpp.

◆ view() [1/2]

template<typename ValueType, typename IndexType>
SegmentedVectorView< ValueType, IndexType > NeoN::SegmentedVector< ValueType, IndexType >::view ( ) &
inlinenodiscard

get a view of the segmented vector

Returns
View of the fields

Definition at line 229 of file segmentedVector.hpp.

◆ view() [2/2]

template<typename ValueType, typename IndexType>
SegmentedVectorView< ValueType, IndexType > NeoN::SegmentedVector< ValueType, IndexType >::view ( ) &&
nodiscarddelete

◆ views() [1/2]

template<typename ValueType, typename IndexType>
std::pair< View< ValueType >, View< IndexType > > NeoN::SegmentedVector< ValueType, IndexType >::views ( ) &
inlinenodiscard

get the combined value and range views of the segmented vector

Returns
Combined value and range views of the fields

Definition at line 241 of file segmentedVector.hpp.

◆ views() [2/2]

template<typename ValueType, typename IndexType>
std::pair< View< ValueType >, View< IndexType > > NeoN::SegmentedVector< ValueType, IndexType >::views ( ) &&
nodiscarddelete

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