NeoN
WIP Prototype of a modern OpenFOAM core
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>

Public Member Functions

 SegmentedVector (const Executor &exec, localIdx size, localIdx numSegments)
 Create a segmented field 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 field.
 
localIdx size () const
 Get the size of the segmented field.
 
localIdx numSegments () const
 Get the number of segments in the segmented field.
 
SegmentedVectorView< ValueType, IndexType > view () &
 get a view of the segmented field
 
SegmentedVectorView< ValueType, IndexType > view () &&=delete
 
std::pair< View< ValueType >, View< IndexType > > spans () &
 get the combined value and range spans of the segmented field
 
std::pair< View< ValueType >, View< IndexType > > spans () &&=delete
 
const Vector< ValueType > & values () const
 
const Vector< IndexType > & segments () 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 127 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 field with a given size and number of segments.

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

Definition at line 138 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 147 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 field.
segmentsThe segments of the segmented field.

Definition at line 161 of file segmentedVector.hpp.

Member Function Documentation

◆ exec()

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

Get the executor associated with the segmented field.

Returns
Reference to the executor.

Definition at line 172 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 field.

Returns
The number of segments.

Definition at line 184 of file segmentedVector.hpp.

◆ segments()

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

Definition at line 213 of file segmentedVector.hpp.

◆ size()

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

Get the size of the segmented field.

Returns
The size of the segmented field.

Definition at line 178 of file segmentedVector.hpp.

◆ spans() [1/2]

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

get the combined value and range spans of the segmented field

Returns
Combined value and range spans of the fields

Definition at line 203 of file segmentedVector.hpp.

◆ spans() [2/2]

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

◆ values()

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

Definition at line 211 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 field

Returns
View of the fields

Definition at line 191 of file segmentedVector.hpp.

◆ view() [2/2]

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

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