DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::AdjacencyRow< index_T > Class Template Reference

Non-owning span (pointer, size) into an ArrayAdjacency row. More...

#include <AdjacencyRow.hpp>

Public Member Functions

DNDS_DEVICE_CALLABLE AdjacencyRow ()=default
 the copy is not trivial!
 
DNDS_DEVICE_CALLABLE AdjacencyRow (const AdjacencyRow &)=default
 
DNDS_DEVICE_CALLABLE ~AdjacencyRow ()=default
 
DNDS_DEVICE_CALLABLE AdjacencyRow (index_T *ptr, rowsize siz)
 Construct a span from raw pointer and size.
 
DNDS_DEVICE_CALLABLE index_T & operator[] (rowsize j)
 Bounds-checked (debug) element access.
 
DNDS_DEVICE_CALLABLE index_T operator[] (rowsize j) const
 
 operator std::vector< index > () const
 Copy the row into a new std::vector<index>.
 
void operator= (const std::vector< index > &r)
 Overwrite the row from a vector of the same size.
 
DNDS_DEVICE_CALLABLE void operator= (const AdjacencyRow &r)
 Copy contents of another span (same size required).
 
DNDS_DEVICE_CALLABLE index_T * begin ()
 
DNDS_DEVICE_CALLABLE index_T * end ()
 
DNDS_DEVICE_CALLABLE index_T * cbegin () const
 
DNDS_DEVICE_CALLABLE index_T * cend () const
 
DNDS_DEVICE_CALLABLE rowsize size () const
 Row width in number of index_T elements.
 

Detailed Description

template<typename index_T = index>
class DNDS::AdjacencyRow< index_T >

Non-owning span (pointer, size) into an ArrayAdjacency row.

Serves as the return value of ArrayAdjacency::operator[]. It is the "typed row handle" equivalent of std::span<index_T> with a few DNDSR-specific conveniences:

  • indexing is bounds-checked in debug (DNDS_assert);
  • assignment from / conversion to std::vector<index>;
  • device-callable accessors so kernels can walk adjacency rows.

The span does not own the underlying storage; it must not outlive the backing ArrayAdjacency.

Template Parameters
index_TEither DNDS::index (mutable) or const DNDS::index.

Definition at line 25 of file AdjacencyRow.hpp.

Constructor & Destructor Documentation

◆ AdjacencyRow() [1/3]

template<typename index_T = index>
DNDS_DEVICE_CALLABLE DNDS::AdjacencyRow< index_T >::AdjacencyRow ( )
default

the copy is not trivial!

◆ AdjacencyRow() [2/3]

template<typename index_T = index>
DNDS_DEVICE_CALLABLE DNDS::AdjacencyRow< index_T >::AdjacencyRow ( const AdjacencyRow< index_T > &  )
default

◆ ~AdjacencyRow()

template<typename index_T = index>
DNDS_DEVICE_CALLABLE DNDS::AdjacencyRow< index_T >::~AdjacencyRow ( )
default

◆ AdjacencyRow() [3/3]

template<typename index_T = index>
DNDS_DEVICE_CALLABLE DNDS::AdjacencyRow< index_T >::AdjacencyRow ( index_T *  ptr,
rowsize  siz 
)
inline

Construct a span from raw pointer and size.

Definition at line 38 of file AdjacencyRow.hpp.

Member Function Documentation

◆ begin()

template<typename index_T = index>
DNDS_DEVICE_CALLABLE index_T * DNDS::AdjacencyRow< index_T >::begin ( )
inline

Definition at line 73 of file AdjacencyRow.hpp.

Here is the caller graph for this function:

◆ cbegin()

template<typename index_T = index>
DNDS_DEVICE_CALLABLE index_T * DNDS::AdjacencyRow< index_T >::cbegin ( ) const
inline

Definition at line 75 of file AdjacencyRow.hpp.

◆ cend()

template<typename index_T = index>
DNDS_DEVICE_CALLABLE index_T * DNDS::AdjacencyRow< index_T >::cend ( ) const
inline

Definition at line 76 of file AdjacencyRow.hpp.

◆ end()

template<typename index_T = index>
DNDS_DEVICE_CALLABLE index_T * DNDS::AdjacencyRow< index_T >::end ( )
inline

Definition at line 74 of file AdjacencyRow.hpp.

◆ operator std::vector< index >()

template<typename index_T = index>
DNDS::AdjacencyRow< index_T >::operator std::vector< index > ( ) const
inline

Copy the row into a new std::vector<index>.

Definition at line 54 of file AdjacencyRow.hpp.

◆ operator=() [1/2]

template<typename index_T = index>
DNDS_DEVICE_CALLABLE void DNDS::AdjacencyRow< index_T >::operator= ( const AdjacencyRow< index_T > &  r)
inline

Copy contents of another span (same size required).

Definition at line 67 of file AdjacencyRow.hpp.

Here is the call graph for this function:

◆ operator=() [2/2]

template<typename index_T = index>
void DNDS::AdjacencyRow< index_T >::operator= ( const std::vector< index > &  r)
inline

Overwrite the row from a vector of the same size.

Definition at line 60 of file AdjacencyRow.hpp.

Here is the call graph for this function:

◆ operator[]() [1/2]

template<typename index_T = index>
DNDS_DEVICE_CALLABLE index_T & DNDS::AdjacencyRow< index_T >::operator[] ( rowsize  j)
inline

Bounds-checked (debug) element access.

Definition at line 41 of file AdjacencyRow.hpp.

◆ operator[]() [2/2]

template<typename index_T = index>
DNDS_DEVICE_CALLABLE index_T DNDS::AdjacencyRow< index_T >::operator[] ( rowsize  j) const
inline

Definition at line 47 of file AdjacencyRow.hpp.

◆ size()

template<typename index_T = index>
DNDS_DEVICE_CALLABLE rowsize DNDS::AdjacencyRow< index_T >::size ( ) const
inline

Row width in number of index_T elements.

Definition at line 78 of file AdjacencyRow.hpp.


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