Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::SmallSpan2< T, Extent1, Extent2 > Class Template Reference

View for a 2D array whose size is an 'Int32'. More...

#include <arccore/base/Span2.h>

Public Types

using ThatClass = SmallSpan2<T, Extent1, Extent2>
using BaseClass = Span2Impl<T, Int32, Extent1, Extent2>
using size_type = Int32
using value_type = typename BaseClass::value_type
using pointer = typename BaseClass::pointer
using ElementType = typename BaseClass::ElementType
Public Types inherited from Arcane::Span2Impl< T, Int32, Extent1, Extent2 >
using ElementType
using element_type
using value_type
using index_type
using difference_type
using size_type
using pointer
using const_pointer
using reference
using const_reference
using view_type
using is_same_const_type
 Indicates if an 'X' or 'const X' can be converted to a 'T'.

Public Member Functions

__host__ __device__ SmallSpan2 (pointer ptr, Int32 dim1_size, Int32 dim2_size)
 Creates a 2D view of dimension [dim1_size][dim2_size].
__host__ __device__ SmallSpan2 ()
 Creates an empty 2D view.
 SmallSpan2 (const Array2View< value_type > &from)
 Copy constructor from another view.
template<typename X, typename = std::enable_if_t<std::is_same_v<X, value_type>>>
 SmallSpan2 (const ConstArray2View< X > &from)
template<typename X, typename = std::enable_if_t<std::is_same_v<X, value_type>>>
__host__ __device__ SmallSpan2 (const SmallSpan2< X > &from)
__host__ __device__ SmallSpan< ElementType > operator[] (Int32 i) const
__host__ __device__ SmallSpan< ElementType > operator() (Int32 i) const
constexpr __host__ __device__ reference operator() (Int32 i, Int32 j) const
Public Member Functions inherited from Arcane::Span2Impl< T, Int32, Extent1, Extent2 >
__host__ __device__ Span2Impl (pointer ptr, Int32 dim1_size, Int32 dim2_size)
 Creates a 2D view of dimension [dim1_size][dim2_size].
__host__ __device__ Span2Impl ()
 Creates an empty 2D view.
 Span2Impl (const ConstArray2View< X > &from)
__host__ __device__ Span2Impl (const Span2< X > &from)
constexpr __host__ __device__ Int32 dim1Size () const
 Number of elements in the first dimension.
constexpr __host__ __device__ Int32 dim2Size () const
 Number of elements in the second dimension.
constexpr __host__ __device__ Int32 totalNbElement () const
 Total number of elements.
constexpr __host__ __device__ SpanImpl< ElementType, Int32operator[] (Int32 i) const
constexpr __host__ __device__ SpanImpl< ElementType, Int32operator() (Int32 i) const
constexpr __host__ __device__ reference operator() (Int32 i, Int32 j) const
constexpr __host__ __device__ ElementType item (Int32 i, Int32 j) const
 Value of the element [i][j].
constexpr __host__ __device__ ElementType setItem (Int32 i, Int32 j, const ElementType &value)
 Positions the element [i][j] at value.
constexpr view_type smallView ()
 Constant view of this view.
constexpr ConstArrayView< value_type > constSmallView () const
 Constant view of this view.
constexpr ElementType * unguardedBasePointer ()
 Pointer to the allocated memory.
constexpr __host__ __device__ ElementType * data ()
 Pointer to the allocated memory.
constexpr __host__ __device__ const ElementType * data () const
 Pointer to the allocated memory.
__host__ __device__ Span2Impl (pointer ptr, Int32 dim1_size, Int32 dim2_size)
 Creates a 2D view of dimension [dim1_size][dim2_size].
__host__ __device__ Span2Impl ()
 Creates an empty 2D view.
 Span2Impl (const ConstArray2View< X > &from)
__host__ __device__ Span2Impl (const Span2< X > &from)
constexpr __host__ __device__ Int32 dim1Size () const
 Number of elements in the first dimension.
constexpr __host__ __device__ Int32 dim2Size () const
 Number of elements in the second dimension.
constexpr __host__ __device__ Int32 totalNbElement () const
 Total number of elements.
constexpr __host__ __device__ SpanImpl< ElementType, Int32operator[] (Int32 i) const
constexpr __host__ __device__ SpanImpl< ElementType, Int32operator() (Int32 i) const
constexpr __host__ __device__ reference operator() (Int32 i, Int32 j) const
constexpr __host__ __device__ ElementType item (Int32 i, Int32 j) const
 Value of the element [i][j].
constexpr __host__ __device__ ElementType setItem (Int32 i, Int32 j, const ElementType &value)
 Positions the element [i][j] at value.
constexpr view_type smallView ()
 Constant view of this view.
constexpr ConstArrayView< value_type > constSmallView () const
 Constant view of this view.
constexpr ElementType * unguardedBasePointer ()
 Pointer to the allocated memory.
constexpr __host__ __device__ ElementType * data ()
 Pointer to the allocated memory.
constexpr __host__ __device__ const ElementType * data () const
 Pointer to the allocated memory.

Friends

class Span2< T >

Additional Inherited Members

Protected Attributes inherited from Arcane::Span2Impl< T, Int32, Extent1, Extent2 >
ElementType * m_ptr
Int32 m_dim1_size
Int32 m_dim2_size
ElementType * m_ptr
Int32 m_dim1_size
Int32 m_dim2_size

Detailed Description

template<class T, Int32 Extent1, Int32 Extent2>
class Arcane::SmallSpan2< T, Extent1, Extent2 >

View for a 2D array whose size is an 'Int32'.

Like any view, an instance of this class is only valid as long as the container it originated from does not change its number of elements.

Definition at line 247 of file Span2.h.

Member Typedef Documentation

◆ BaseClass

template<class T, Int32 Extent1, Int32 Extent2>
using Arcane::SmallSpan2< T, Extent1, Extent2 >::BaseClass = Span2Impl<T, Int32, Extent1, Extent2>

Definition at line 255 of file Span2.h.

◆ ElementType

template<class T, Int32 Extent1, Int32 Extent2>
using Arcane::SmallSpan2< T, Extent1, Extent2 >::ElementType = typename BaseClass::ElementType

Definition at line 261 of file Span2.h.

◆ pointer

template<class T, Int32 Extent1, Int32 Extent2>
using Arcane::SmallSpan2< T, Extent1, Extent2 >::pointer = typename BaseClass::pointer

Definition at line 258 of file Span2.h.

◆ size_type

template<class T, Int32 Extent1, Int32 Extent2>
using Arcane::SmallSpan2< T, Extent1, Extent2 >::size_type = Int32

Definition at line 256 of file Span2.h.

◆ ThatClass

template<class T, Int32 Extent1, Int32 Extent2>
using Arcane::SmallSpan2< T, Extent1, Extent2 >::ThatClass = SmallSpan2<T, Extent1, Extent2>

Definition at line 254 of file Span2.h.

◆ value_type

template<class T, Int32 Extent1, Int32 Extent2>
using Arcane::SmallSpan2< T, Extent1, Extent2 >::value_type = typename BaseClass::value_type

Definition at line 257 of file Span2.h.

Constructor & Destructor Documentation

◆ SmallSpan2() [1/5]

template<class T, Int32 Extent1, Int32 Extent2>
__host__ __device__ Arcane::SmallSpan2< T, Extent1, Extent2 >::SmallSpan2 ( pointer ptr,
Int32 dim1_size,
Int32 dim2_size )
inline

Creates a 2D view of dimension [dim1_size][dim2_size].

Definition at line 272 of file Span2.h.

◆ SmallSpan2() [2/5]

template<class T, Int32 Extent1, Int32 Extent2>
__host__ __device__ Arcane::SmallSpan2< T, Extent1, Extent2 >::SmallSpan2 ( )
inline

Creates an empty 2D view.

Definition at line 276 of file Span2.h.

◆ SmallSpan2() [3/5]

template<class T, Int32 Extent1, Int32 Extent2>
Arcane::SmallSpan2< T, Extent1, Extent2 >::SmallSpan2 ( const Array2View< value_type > & from)
inline

Copy constructor from another view.

Definition at line 280 of file Span2.h.

◆ SmallSpan2() [4/5]

template<class T, Int32 Extent1, Int32 Extent2>
template<typename X, typename = std::enable_if_t<std::is_same_v<X, value_type>>>
Arcane::SmallSpan2< T, Extent1, Extent2 >::SmallSpan2 ( const ConstArray2View< X > & from)
inline

Definition at line 286 of file Span2.h.

◆ SmallSpan2() [5/5]

template<class T, Int32 Extent1, Int32 Extent2>
template<typename X, typename = std::enable_if_t<std::is_same_v<X, value_type>>>
__host__ __device__ Arcane::SmallSpan2< T, Extent1, Extent2 >::SmallSpan2 ( const SmallSpan2< X > & from)
inline

Definition at line 291 of file Span2.h.

Member Function Documentation

◆ operator()() [1/2]

template<class T, Int32 Extent1, Int32 Extent2>
__host__ __device__ SmallSpan< ElementType > Arcane::SmallSpan2< T, Extent1, Extent2 >::operator() ( Int32 i) const
inline

Definition at line 303 of file Span2.h.

◆ operator()() [2/2]

template<class T, Int32 Extent1, Int32 Extent2>
__host__ __device__ reference Arcane::Span2Impl< T, Int32, Extent1, Extent2 >::operator() ( Int32 i,
Int32 j ) const
inlineconstexpr

Definition at line 140 of file Span2.h.

◆ operator[]()

template<class T, Int32 Extent1, Int32 Extent2>
__host__ __device__ SmallSpan< ElementType > Arcane::SmallSpan2< T, Extent1, Extent2 >::operator[] ( Int32 i) const
inline

Definition at line 297 of file Span2.h.

◆ Span2< T >

template<class T, Int32 Extent1, Int32 Extent2>
friend class Span2< T >
friend

Definition at line 232 of file Span2.h.


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