NeoN
A framework for CFD software
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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, localIdx 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 Executorexec () const
 Get the executor associated with the segmented vector.
 
localIdx size () const
 Get the size of the segmented vector.
 
localIdx 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,
localIdx  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 170 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 179 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 193 of file segmentedVector.hpp.

Member Function Documentation

◆ copyToExecutor()

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

◆ 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 204 of file segmentedVector.hpp.

◆ numSegments()

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

Get the number of segments in the segmented vector.

Returns
The number of segments.

Definition at line 216 of file segmentedVector.hpp.

◆ segments()

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

Definition at line 253 of file segmentedVector.hpp.

◆ size()

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

Get the size of the segmented vector.

Returns
The size of the segmented vector.

Definition at line 210 of file segmentedVector.hpp.

◆ values()

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

Definition at line 251 of file segmentedVector.hpp.

◆ view() [1/2]

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

get a view of the segmented vector

Returns
View of the fields

Definition at line 230 of file segmentedVector.hpp.

◆ view() [2/2]

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

◆ views() [1/2]

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

get the combined value and range views of the segmented vector

Returns
Combined value and range views of the fields

Definition at line 242 of file segmentedVector.hpp.

◆ views() [2/2]

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

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