Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable > Class Template Reference

#include <crs_map.hpp>

Collaboration diagram for vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >:
[legend]

Public Types

using reference_t
 Alias for the reference type, depending on mutability.
using pointer_t
 Alias for the pointer type, depending on mutability.
using iterator = pointer_t
 Iterator type for mutable/non-mutable rows.
using const_iterator = const pointer_t

Public Member Functions

iterator begin ()
 Get the beginning iterator of the row.
iterator end ()
 Get the ending iterator of the row.
const_iterator begin () const
 Get the beginning iterator of the row (const version).
const_iterator end () const
 Get the ending iterator of the row (const version).
 RowView (pointer_t data, IndexType size)
 Constructor to create a view over a row.
const reference_t operator[] (IndexType index) const
 Access an element in the row by index.
reference_t operator[] (IndexType index)
 Access an element in the row by index.
constexpr IndexType size () const
 Get the size of the row.
constexpr pointer_t const data () const
 Get the data of the row.

Private Attributes

pointer_t const m_data
 Pointer to the first element in the row.
internal::StaticSelector< IndexType, RowSize !=IndexType(-1), RowSize > m_size
 Size of the row (either dynamic or static depending if RowSize == -1).

Detailed Description

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
class vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >
Template Parameters
MutableBoolean flag to indicate whether the row data is mutable.

This class provides a view over a single row in the CRS map. The row's elements can be accessed via iterators or array-style indexing.

Member Typedef Documentation

◆ const_iterator

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
using vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::const_iterator = const pointer_t

◆ iterator

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
using vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::iterator = pointer_t

Iterator type for mutable/non-mutable rows.

◆ pointer_t

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
using vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::pointer_t
Initial value:
typename std::conditional_t<Mutable, DataType*, const DataType*>

Alias for the pointer type, depending on mutability.

◆ reference_t

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
using vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::reference_t
Initial value:
typename std::conditional_t<Mutable, DataType&, const DataType&>

Alias for the reference type, depending on mutability.

Constructor & Destructor Documentation

◆ RowView()

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::RowView ( pointer_t data,
IndexType size )
inlineexplicit

Constructor to create a view over a row.

Parameters
dataPointer to the row data.
sizeSize of the row (only used if RowSize is dynamic).

Member Function Documentation

◆ begin() [1/2]

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
iterator vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::begin ( )
inline

Get the beginning iterator of the row.

Returns
Iterator pointing to the first element.

◆ begin() [2/2]

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
const_iterator vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::begin ( ) const
inline

Get the beginning iterator of the row (const version).

Returns
Const iterator pointing to the first element.

◆ data()

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
pointer_t const vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::data ( ) const
inlineconstexpr

Get the data of the row.

Returns
Raw data of elements in the row.

◆ end() [1/2]

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
iterator vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::end ( )
inline

Get the ending iterator of the row.

Returns
Iterator pointing past the last element.

◆ end() [2/2]

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
const_iterator vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::end ( ) const
inline

Get the ending iterator of the row (const version).

Returns
Const iterator pointing past the last element.

◆ operator[]() [1/2]

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
reference_t vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::operator[] ( IndexType index)
inline

Access an element in the row by index.

Parameters
indexThe index of the element to access.
Returns
Reference to the element (mutable version).

◆ operator[]() [2/2]

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
const reference_t vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::operator[] ( IndexType index) const
inline

Access an element in the row by index.

Parameters
indexThe index of the element to access.
Returns
Reference to the element (const version).

◆ size()

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
IndexType vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::size ( ) const
inlineconstexpr

Get the size of the row.

Returns
Number of elements in the row.

Member Data Documentation

◆ m_data

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
pointer_t const vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::m_data
private

Pointer to the first element in the row.

◆ m_size

template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)>
template<bool Mutable>
internal::StaticSelector<IndexType, RowSize != IndexType(-1), RowSize> vulpes::datastructure::CrsMap< DataType, IndexType, RowSize >::RowView< Mutable >::m_size
private

Size of the row (either dynamic or static depending if RowSize == -1).


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