Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::Array3View< DataType > Class Template Reference

View for a 3D array. More...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/base/arccore/base/Array3View.h>

Collaboration diagram for Arcane::Array3View< DataType >:

Public Member Functions

constexpr Array3View (DataType *ptr, Integer dim1_size, Integer dim2_size, Integer dim3_size)
constexpr Integer dim1Size () const
constexpr Integer dim2Size () const
constexpr Integer dim3Size () const
constexpr Integer totalNbElement () const
constexpr Array2View< DataType > operator[] (Integer i)
constexpr ConstArray2View< DataType > operator[] (Integer i) const
constexpr DataType item (Integer i, Integer j, Integer k) const
constexpr const DataType & operator() (Integer i, Integer j, Integer k) const
constexpr DataType & operator() (Integer i, Integer j, Integer k)
constexpr DataType setItem (Integer i, Integer j, Integer k, const DataType &value)
DataType * unguardedBasePointer ()
 Pointer to the allocated memory.

Private Attributes

DataType * m_ptr
Integer m_dim1_size
 Size of the 1st dimension.
Integer m_dim2_size
 Size of the 2nd dimension.
Integer m_dim3_size
 Size of the 3rd dimension.
Integer m_dim23_size
 dim2 * dim3

Detailed Description

template<class DataType>
class Arcane::Array3View< DataType >

View for a 3D array.

A 3D view can be created from a classic array (Array) as follows:

Array3View<Int32> view(a.unguardedBasePointer(),5,7,9);
view[3][4][5] = 2;
view.setItem(4,5,6, 1); // Sets the value 1 to the element view[4][5][6].
1D data vector with value semantics (STL style).

For performance reasons, it is preferable to access elements via operator()()

Definition at line 44 of file arccore/src/base/arccore/base/Array3View.h.

Constructor & Destructor Documentation

◆ Array3View() [1/2]

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

Definition at line 48 of file arccore/src/base/arccore/base/Array3View.h.

◆ Array3View() [2/2]

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

Definition at line 56 of file arccore/src/base/arccore/base/Array3View.h.

Member Function Documentation

◆ dim1Size()

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

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

◆ dim2Size()

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

Definition at line 68 of file arccore/src/base/arccore/base/Array3View.h.

◆ dim3Size()

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

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

◆ item()

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

Definition at line 84 of file arccore/src/base/arccore/base/Array3View.h.

◆ operator()() [1/2]

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

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

◆ operator()() [2/2]

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

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

◆ operator[]() [1/2]

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

Definition at line 74 of file arccore/src/base/arccore/base/Array3View.h.

◆ operator[]() [2/2]

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

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

◆ setItem()

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

Definition at line 111 of file arccore/src/base/arccore/base/Array3View.h.

◆ totalNbElement()

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

Definition at line 70 of file arccore/src/base/arccore/base/Array3View.h.

◆ unguardedBasePointer()

template<class DataType>
DataType * Arcane::Array3View< DataType >::unguardedBasePointer ( )
inline

Pointer to the allocated memory.

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

Member Data Documentation

◆ m_dim1_size

template<class DataType>
Integer Arcane::Array3View< DataType >::m_dim1_size
private

Size of the 1st dimension.

Definition at line 130 of file arccore/src/base/arccore/base/Array3View.h.

◆ m_dim23_size

template<class DataType>
Integer Arcane::Array3View< DataType >::m_dim23_size
private

dim2 * dim3

Definition at line 133 of file arccore/src/base/arccore/base/Array3View.h.

◆ m_dim2_size

template<class DataType>
Integer Arcane::Array3View< DataType >::m_dim2_size
private

Size of the 2nd dimension.

Definition at line 131 of file arccore/src/base/arccore/base/Array3View.h.

◆ m_dim3_size

template<class DataType>
Integer Arcane::Array3View< DataType >::m_dim3_size
private

Size of the 3rd dimension.

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

◆ m_ptr

template<class DataType>
DataType* Arcane::Array3View< DataType >::m_ptr
private

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


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