Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::Array2View< DataType > Class Template Reference

Mutable view for a 2D array. More...

#include <arccore/base/Array2View.h>

Public Member Functions

constexpr Array2View (DataType *ptr, Integer dim1_size, Integer dim2_size)
 Creates a 2D view of dimension [dim1_size][dim2_size].
constexpr Array2View ()
 Creates an empty 2D view.
constexpr Integer dim1Size () const
 Number of elements in the first dimension.
constexpr Integer dim2Size () const
 Number of elements in the second dimension.
constexpr Integer totalNbElement () const
 Total number of elements.
constexpr ArrayView< DataType > operator[] (Integer i)
constexpr ConstArrayView< DataType > operator[] (Integer i) const
constexpr DataType item (Integer i, Integer j) const
 Value of element [i][j].
constexpr DataType setItem (Integer i, Integer j, const DataType &value)
 Positions element [i][j] to value.
constexpr const DataType operator() (Integer i, Integer j) const
 Value of element [i][j].
constexpr DataType & operator() (Integer i, Integer j)
 Value of element [i][j].
constexpr DataType * unguardedBasePointer ()
 Pointer to the allocated memory.
constexpr DataType * data ()
 Pointer to the allocated memory.

Friends

class SmallSpan2< DataType >
class SmallSpan2< const DataType >
class Span2< DataType >
class Span2< const DataType >
class ConstArray2View< DataType >

Detailed Description

template<class DataType>
class Arcane::Array2View< DataType >

Mutable view for a 2D array.

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

Definition at line 38 of file arccore/src/base/arccore/base/Array2View.h.

Constructor & Destructor Documentation

◆ Array2View() [1/2]

template<class DataType>
Arcane::Array2View< DataType >::Array2View ( DataType * ptr,
Integer dim1_size,
Integer dim2_size )
inlineconstexpr

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

Definition at line 52 of file arccore/src/base/arccore/base/Array2View.h.

◆ Array2View() [2/2]

template<class DataType>
Arcane::Array2View< DataType >::Array2View ( )
inlineconstexpr

Creates an empty 2D view.

Definition at line 58 of file arccore/src/base/arccore/base/Array2View.h.

Member Function Documentation

◆ data()

template<class DataType>
DataType * Arcane::Array2View< DataType >::data ( )
inlineconstexpr

Pointer to the allocated memory.

Definition at line 137 of file arccore/src/base/arccore/base/Array2View.h.

◆ dim1Size()

template<class DataType>
Integer Arcane::Array2View< DataType >::dim1Size ( ) const
inlineconstexpr

Number of elements in the first dimension.

Definition at line 67 of file arccore/src/base/arccore/base/Array2View.h.

◆ dim2Size()

template<class DataType>
Integer Arcane::Array2View< DataType >::dim2Size ( ) const
inlineconstexpr

Number of elements in the second dimension.

Definition at line 69 of file arccore/src/base/arccore/base/Array2View.h.

◆ item()

template<class DataType>
DataType Arcane::Array2View< DataType >::item ( Integer i,
Integer j ) const
inlineconstexpr

Value of element [i][j].

Definition at line 86 of file arccore/src/base/arccore/base/Array2View.h.

◆ operator()() [1/2]

template<class DataType>
DataType & Arcane::Array2View< DataType >::operator() ( Integer i,
Integer j )
inlineconstexpr

Value of element [i][j].

Definition at line 104 of file arccore/src/base/arccore/base/Array2View.h.

◆ operator()() [2/2]

template<class DataType>
const DataType Arcane::Array2View< DataType >::operator() ( Integer i,
Integer j ) const
inlineconstexpr

Value of element [i][j].

Definition at line 98 of file arccore/src/base/arccore/base/Array2View.h.

◆ operator[]() [1/2]

template<class DataType>
ArrayView< DataType > Arcane::Array2View< DataType >::operator[] ( Integer i)
inlineconstexpr

Definition at line 75 of file arccore/src/base/arccore/base/Array2View.h.

◆ operator[]() [2/2]

template<class DataType>
ConstArrayView< DataType > Arcane::Array2View< DataType >::operator[] ( Integer i) const
inlineconstexpr

Definition at line 80 of file arccore/src/base/arccore/base/Array2View.h.

◆ setItem()

template<class DataType>
DataType Arcane::Array2View< DataType >::setItem ( Integer i,
Integer j,
const DataType & value )
inlineconstexpr

Positions element [i][j] to value.

Definition at line 92 of file arccore/src/base/arccore/base/Array2View.h.

◆ totalNbElement()

template<class DataType>
Integer Arcane::Array2View< DataType >::totalNbElement ( ) const
inlineconstexpr

Total number of elements.

Definition at line 71 of file arccore/src/base/arccore/base/Array2View.h.

◆ unguardedBasePointer()

template<class DataType>
DataType * Arcane::Array2View< DataType >::unguardedBasePointer ( )
inlineconstexpr

Pointer to the allocated memory.

Definition at line 129 of file arccore/src/base/arccore/base/Array2View.h.

◆ ConstArray2View< DataType >

template<class DataType>
friend class ConstArray2View< DataType >
friend

Definition at line 1 of file arccore/src/base/arccore/base/Array2View.h.

◆ SmallSpan2< const DataType >

template<class DataType>
friend class SmallSpan2< const DataType >
friend

Definition at line 1 of file arccore/src/base/arccore/base/Array2View.h.

◆ SmallSpan2< DataType >

template<class DataType>
friend class SmallSpan2< DataType >
friend

Definition at line 1 of file arccore/src/base/arccore/base/Array2View.h.

◆ Span2< const DataType >

template<class DataType>
friend class Span2< const DataType >
friend

Definition at line 1 of file arccore/src/base/arccore/base/Array2View.h.

◆ Span2< DataType >

template<class DataType>
friend class Span2< DataType >
friend

Definition at line 1 of file arccore/src/base/arccore/base/Array2View.h.


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