Opm::gpuistl::MiniVector< T, Dimension > Class Template Reference

#include <MiniVector.hpp>

Public Types

using value_type = T
 Element type. More...
 
using size_type = std::size_t
 Index/size type. More...
 
using reference = value_type &
 Mutable element reference. More...
 
using const_reference = const value_type &
 Immutable element reference. More...
 
using iterator = typename std::array< T, Dimension >::iterator
 Mutable iterator. More...
 
using const_iterator = typename std::array< T, Dimension >::const_iterator
 Immutable iterator. More...
 

Public Member Functions

OPM_HOST_DEVICE constexpr MiniVector () noexcept(std::is_nothrow_default_constructible< value_type >::value)=default
 Default‑constructs the MiniVector; elements are value‑initialized. More...
 
OPM_HOST_DEVICE constexpr MiniVector (const value_type &value)
 Uniform‑value constructor. More...
 
OPM_HOST_DEVICE MiniVector (std::initializer_list< value_type > init)
 Initializer‑list constructor. More...
 
OPM_HOST_DEVICE constexpr reference operator[] (size_type idx) noexcept
 
OPM_HOST_DEVICE constexpr const_reference operator[] (size_type idx) const noexcept
 
OPM_HOST_DEVICE reference at (size_type idx)
 Safe element access with bounds checking (throws on host). More...
 
OPM_HOST_DEVICE const_reference at (size_type idx) const
 Safe element access with bounds checking (throws on host). More...
 
OPM_HOST_DEVICE constexpr iterator begin () noexcept
 
OPM_HOST_DEVICE constexpr const_iterator begin () const noexcept
 
OPM_HOST_DEVICE constexpr const_iterator cbegin () const noexcept
 
OPM_HOST_DEVICE constexpr iterator end () noexcept
 
OPM_HOST_DEVICE constexpr const_iterator end () const noexcept
 
OPM_HOST_DEVICE constexpr const_iterator cend () const noexcept
 
OPM_HOST_DEVICE constexpr void fill (const value_type &value)
 Fill every component with the supplied value. More...
 
OPM_HOST_DEVICE constexpr bool operator== (const MiniVector &other) const noexcept
 
OPM_HOST_DEVICE constexpr bool operator!= (const MiniVector &other) const noexcept
 

Static Public Member Functions

static OPM_HOST_DEVICE constexpr size_type size () noexcept
 

Detailed Description

template<class T, int Dimension>
class Opm::gpuistl::MiniVector< T, Dimension >
Template Parameters
TElement type (must be trivially copyable for use on the GPU).
DimensionCompile‑time dimension (must be strictly positive).

Member Typedef Documentation

◆ const_iterator

template<class T , int Dimension>
using Opm::gpuistl::MiniVector< T, Dimension >::const_iterator = typename std::array<T, Dimension>::const_iterator

Immutable iterator.

◆ const_reference

template<class T , int Dimension>
using Opm::gpuistl::MiniVector< T, Dimension >::const_reference = const value_type&

Immutable element reference.

◆ iterator

template<class T , int Dimension>
using Opm::gpuistl::MiniVector< T, Dimension >::iterator = typename std::array<T, Dimension>::iterator

Mutable iterator.

◆ reference

template<class T , int Dimension>
using Opm::gpuistl::MiniVector< T, Dimension >::reference = value_type&

Mutable element reference.

◆ size_type

template<class T , int Dimension>
using Opm::gpuistl::MiniVector< T, Dimension >::size_type = std::size_t

Index/size type.

◆ value_type

template<class T , int Dimension>
using Opm::gpuistl::MiniVector< T, Dimension >::value_type = T

Element type.

Constructor & Destructor Documentation

◆ MiniVector() [1/3]

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr Opm::gpuistl::MiniVector< T, Dimension >::MiniVector ( ) const
constexprdefaultnoexcept

Default‑constructs the MiniVector; elements are value‑initialized.

◆ MiniVector() [2/3]

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr Opm::gpuistl::MiniVector< T, Dimension >::MiniVector ( const value_type value)
inlineexplicitconstexpr

Uniform‑value constructor.

Parameters
valueValue used to initialize all components.

◆ MiniVector() [3/3]

template<class T , int Dimension>
OPM_HOST_DEVICE Opm::gpuistl::MiniVector< T, Dimension >::MiniVector ( std::initializer_list< value_type init)
inline

Initializer‑list constructor.

Enables natural brace initialization:

Opm::MiniVector<float, 3> v{1.0f, 2.0f, 3.0f};
Parameters
initList containing exactly Dimension elements.
Exceptions
std::runtime_errorif init.size() != Dimension **(host only)**.

Member Function Documentation

◆ at() [1/2]

template<class T , int Dimension>
OPM_HOST_DEVICE reference Opm::gpuistl::MiniVector< T, Dimension >::at ( size_type  idx)
inline

Safe element access with bounds checking (throws on host).

Exceptions
std::out_of_rangeif idx >= Dimension **(host only)**.

◆ at() [2/2]

template<class T , int Dimension>
OPM_HOST_DEVICE const_reference Opm::gpuistl::MiniVector< T, Dimension >::at ( size_type  idx) const
inline

Safe element access with bounds checking (throws on host).

Exceptions
std::out_of_rangeif idx >= Dimension **(host only)**.

◆ begin() [1/2]

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr const_iterator Opm::gpuistl::MiniVector< T, Dimension >::begin ( ) const
inlineconstexprnoexcept
Returns
Const iterator to first element.

◆ begin() [2/2]

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr iterator Opm::gpuistl::MiniVector< T, Dimension >::begin ( )
inlineconstexprnoexcept
Returns
Iterator to first element (mutable).

◆ cbegin()

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr const_iterator Opm::gpuistl::MiniVector< T, Dimension >::cbegin ( ) const
inlineconstexprnoexcept
Returns
Const iterator to first element.

◆ cend()

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr const_iterator Opm::gpuistl::MiniVector< T, Dimension >::cend ( ) const
inlineconstexprnoexcept
Returns
Const one‑past‑the‑last iterator.

◆ end() [1/2]

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr const_iterator Opm::gpuistl::MiniVector< T, Dimension >::end ( ) const
inlineconstexprnoexcept
Returns
Const one‑past‑the‑last iterator.

◆ end() [2/2]

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr iterator Opm::gpuistl::MiniVector< T, Dimension >::end ( )
inlineconstexprnoexcept
Returns
One‑past‑the‑last iterator (mutable).

◆ fill()

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr void Opm::gpuistl::MiniVector< T, Dimension >::fill ( const value_type value)
inlineconstexpr

Fill every component with the supplied value.

Parameters
valueThe value to assign to each element.

◆ operator!=()

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr bool Opm::gpuistl::MiniVector< T, Dimension >::operator!= ( const MiniVector< T, Dimension > &  other) const
inlineconstexprnoexcept
Returns
true if any component differs.

◆ operator==()

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr bool Opm::gpuistl::MiniVector< T, Dimension >::operator== ( const MiniVector< T, Dimension > &  other) const
inlineconstexprnoexcept
Returns
true if all components compare equal.

◆ operator[]() [1/2]

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr const_reference Opm::gpuistl::MiniVector< T, Dimension >::operator[] ( size_type  idx) const
inlineconstexprnoexcept
Returns
Immutable reference to element idx (no bounds check).

◆ operator[]() [2/2]

template<class T , int Dimension>
OPM_HOST_DEVICE constexpr reference Opm::gpuistl::MiniVector< T, Dimension >::operator[] ( size_type  idx)
inlineconstexprnoexcept
Returns
Mutable reference to element idx (no bounds check).

◆ size()

template<class T , int Dimension>
static OPM_HOST_DEVICE constexpr size_type Opm::gpuistl::MiniVector< T, Dimension >::size ( )
inlinestaticconstexprnoexcept
Returns
The fixed dimension of the MiniVector (compile‑time constant).

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