Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::ArrayShape Class Reference

Array shape. More...

#include <arcane/utils/ArrayShape.h>

Collaboration diagram for Arcane::ArrayShape:

Public Member Functions

 ArrayShape (Span< const Int32 > v)
Int32 nbDimension () const
 Rank of the shape.
SmallSpan< const Int32dimensions () const
 Values of each dimension.
Int32 dimension (Int32 index) const
 Number of elements in the index-th dimension.
Int64 totalNbElement () const
 Total number of elements.
void setNbDimension (Int32 nb_value)
 Sets the rank of the shape.
void setDimension (Int32 index, Int32 value)
 Sets the value of the index-th dimension to value.
void setDimensions (Span< const Int32 > dims)
 Sets the number and values of the dimensions.

Static Public Attributes

static constexpr int MAX_NB_DIMENSION = 8

Private Member Functions

void _set (SmallSpan< const Int32 > v)
void _print (std::ostream &o) const

Static Private Member Functions

static bool _isEqual (const ArrayShape &s1, const ArrayShape &s2)

Private Attributes

Int32 m_nb_dim = 0
std::array< Int32, MAX_NB_DIMENSION > m_dims = {}

Friends

std::ostream & operator<< (std::ostream &o, const ArrayShape &s)
bool operator== (const ArrayShape &s1, const ArrayShape &s2)
bool operator!= (const ArrayShape &s1, const ArrayShape &s2)

Detailed Description

Array shape.

Definition at line 41 of file ArrayShape.h.

Constructor & Destructor Documentation

◆ ArrayShape()

Arcane::ArrayShape::ArrayShape ( Span< const Int32 > v)
explicit

Definition at line 29 of file ArrayShape.cc.

Member Function Documentation

◆ _isEqual()

bool Arcane::ArrayShape::_isEqual ( const ArrayShape & s1,
const ArrayShape & s2 )
staticprivate

Definition at line 72 of file ArrayShape.cc.

◆ _print()

void Arcane::ArrayShape::_print ( std::ostream & o) const
private

Definition at line 87 of file ArrayShape.cc.

◆ _set()

void Arcane::ArrayShape::_set ( SmallSpan< const Int32 > v)
private

Definition at line 49 of file ArrayShape.cc.

◆ dimension()

Int32 Arcane::ArrayShape::dimension ( Int32 index) const
inline

Number of elements in the index-th dimension.

Definition at line 59 of file ArrayShape.h.

◆ dimensions()

SmallSpan< const Int32 > Arcane::ArrayShape::dimensions ( ) const
inline

Values of each dimension.

Definition at line 56 of file ArrayShape.h.

Referenced by Arcane::MeshMDVariableRefBaseT< ItemType, DataType, AddedFirstExtentsType >::updateFromInternal().

Here is the caller graph for this function:

◆ nbDimension()

Int32 Arcane::ArrayShape::nbDimension ( ) const
inline

Rank of the shape.

Definition at line 53 of file ArrayShape.h.

◆ setDimension()

void Arcane::ArrayShape::setDimension ( Int32 index,
Int32 value )
inline

Sets the value of the index-th dimension to value.

Definition at line 74 of file ArrayShape.h.

◆ setDimensions()

void Arcane::ArrayShape::setDimensions ( Span< const Int32 > dims)

Sets the number and values of the dimensions.

Definition at line 63 of file ArrayShape.cc.

References Arcane::SpanImpl< T, SizeType, Extent >::smallView().

Here is the call graph for this function:

◆ setNbDimension()

void Arcane::ArrayShape::setNbDimension ( Int32 nb_value)

Sets the rank of the shape.

Definition at line 38 of file ArrayShape.cc.

References ARCANE_THROW.

Referenced by Arcane::MeshMDVariableRefBaseT< ItemType, DataType, AddedFirstExtentsType >::updateFromInternal().

Here is the caller graph for this function:

◆ totalNbElement()

Int64 Arcane::ArrayShape::totalNbElement ( ) const
inline

Total number of elements.

Definition at line 62 of file ArrayShape.h.

◆ operator!=

bool operator!= ( const ArrayShape & s1,
const ArrayShape & s2 )
friend

Definition at line 88 of file ArrayShape.h.

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const ArrayShape & s )
friend

Definition at line 79 of file ArrayShape.h.

◆ operator==

bool operator== ( const ArrayShape & s1,
const ArrayShape & s2 )
friend

Definition at line 84 of file ArrayShape.h.

Member Data Documentation

◆ m_dims

std::array<Int32, MAX_NB_DIMENSION> Arcane::ArrayShape::m_dims = {}
private

Definition at line 96 of file ArrayShape.h.

◆ m_nb_dim

Int32 Arcane::ArrayShape::m_nb_dim = 0
private

Definition at line 95 of file ArrayShape.h.

◆ MAX_NB_DIMENSION

int Arcane::ArrayShape::MAX_NB_DIMENSION = 8
staticconstexpr

Definition at line 45 of file ArrayShape.h.


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