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

View for a 4D array. More...

#include <arccore/base/Array4View.h>

Public Member Functions

constexpr Array4View (DataType *ptr, Integer dim1_size, Integer dim2_size, Integer dim3_size, Integer dim4_size)
 Constructs a view.
constexpr Array4View ()
 Constructs an empty view.
constexpr Integer dim1Size () const
 Value of the first dimension.
constexpr Integer dim2Size () const
 Value of the second dimension.
constexpr Integer dim3Size () const
 Value of the third dimension.
constexpr Integer dim4Size () const
 Value of the fourth dimension.
constexpr Integer totalNbElement () const
 Total number of elements in the array.
constexpr Array3View< DataType > operator[] (Integer i)
constexpr ConstArray3View< DataType > operator[] (Integer i) const
constexpr DataType item (Integer i, Integer j, Integer k, Integer l) const
 Value for element i,j,k,l.
constexpr const DataType & operator() (Integer i, Integer j, Integer k, Integer l) const
 Value for element i,j,k,l.
constexpr DataType & operator() (Integer i, Integer j, Integer k, Integer l)
 Value for element i,j,k,l.
constexpr void setItem (Integer i, Integer j, Integer k, Integer l, const DataType &value)
 Sets the value for element i,j,k,l.
constexpr DataType * unguardedBasePointer ()
 Pointer to the first element of the array.
constexpr DataType * data ()
 Pointer to the first element of the array.

Detailed Description

template<class DataType>
class Arcane::Array4View< DataType >

View for a 4D array.

This class allows obtaining a 4D view from a contiguous memory area, such as the one obtained via the Array class.

The view can be used like a classic C array, for example:

a[0][1][2][3] = 5.0;
constexpr Array4View(DataType *ptr, Integer dim1_size, Integer dim2_size, Integer dim3_size, Integer dim4_size)
Constructs a view.

However, it is preferable to directly use the item() or setItem() methods (or the operator()) to access an element of the array for reading or writing.

Definition at line 46 of file arccore/src/base/arccore/base/Array4View.h.

Constructor & Destructor Documentation

◆ Array4View() [1/2]

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

Constructs a view.

Definition at line 51 of file arccore/src/base/arccore/base/Array4View.h.

◆ Array4View() [2/2]

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

Constructs an empty view.

Definition at line 63 of file arccore/src/base/arccore/base/Array4View.h.

Member Function Documentation

◆ data()

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

Pointer to the first element of the array.

Definition at line 148 of file arccore/src/base/arccore/base/Array4View.h.

◆ dim1Size()

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

Value of the first dimension.

Definition at line 77 of file arccore/src/base/arccore/base/Array4View.h.

◆ dim2Size()

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

Value of the second dimension.

Definition at line 79 of file arccore/src/base/arccore/base/Array4View.h.

◆ dim3Size()

template<class DataType>
Integer Arcane::Array4View< DataType >::dim3Size ( ) const
inlineconstexpr

Value of the third dimension.

Definition at line 81 of file arccore/src/base/arccore/base/Array4View.h.

◆ dim4Size()

template<class DataType>
Integer Arcane::Array4View< DataType >::dim4Size ( ) const
inlineconstexpr

Value of the fourth dimension.

Definition at line 83 of file arccore/src/base/arccore/base/Array4View.h.

◆ item()

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

Value for element i,j,k,l.

Definition at line 100 of file arccore/src/base/arccore/base/Array4View.h.

◆ operator()() [1/2]

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

Value for element i,j,k,l.

Definition at line 112 of file arccore/src/base/arccore/base/Array4View.h.

◆ operator()() [2/2]

template<class DataType>
const DataType & Arcane::Array4View< DataType >::operator() ( Integer i,
Integer j,
Integer k,
Integer l ) const
inlineconstexpr

Value for element i,j,k,l.

Definition at line 106 of file arccore/src/base/arccore/base/Array4View.h.

◆ operator[]() [1/2]

template<class DataType>
Array3View< DataType > Arcane::Array4View< DataType >::operator[] ( Integer i)
inlineconstexpr

Definition at line 89 of file arccore/src/base/arccore/base/Array4View.h.

◆ operator[]() [2/2]

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

Definition at line 94 of file arccore/src/base/arccore/base/Array4View.h.

◆ setItem()

template<class DataType>
void Arcane::Array4View< DataType >::setItem ( Integer i,
Integer j,
Integer k,
Integer l,
const DataType & value )
inlineconstexpr

Sets the value for element i,j,k,l.

Definition at line 132 of file arccore/src/base/arccore/base/Array4View.h.

◆ totalNbElement()

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

Total number of elements in the array.

Definition at line 85 of file arccore/src/base/arccore/base/Array4View.h.

◆ unguardedBasePointer()

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

Pointer to the first element of the array.

Definition at line 143 of file arccore/src/base/arccore/base/Array4View.h.


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