Arcane  4.2.2.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].
 Array2View ()=default
 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.
constexpr const DataType * unguardedBasePointer () const
 Read-only pointer to the allocated memory.
constexpr const DataType * data () const
 Read-only 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 37 of file arccore/src/base/arccore/base/Array2View.h.

Constructor & Destructor Documentation

◆ Array2View()

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 51 of file arccore/src/base/arccore/base/Array2View.h.

Member Function Documentation

◆ data() [1/2]

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

Pointer to the allocated memory.

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

◆ data() [2/2]

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

Read-only pointer to the allocated memory.

Definition at line 131 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 62 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 64 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 81 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 99 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 93 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 70 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 75 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 87 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 66 of file arccore/src/base/arccore/base/Array2View.h.

◆ unguardedBasePointer() [1/2]

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

Pointer to the allocated memory.

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

◆ unguardedBasePointer() [2/2]

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

Read-only pointer to the allocated memory.

Definition at line 128 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: