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

Array shape. More...

#include <arcane/utils/ArrayShape.h>

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

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

◆ 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

◆ 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().

◆ 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().

◆ 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

◆ 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: