12#ifndef ARCANE_UTILS_ARRAYSHAPE_H
13#define ARCANE_UTILS_ARRAYSHAPE_H
18#include "arcane/utils/ArrayView.h"
39class ARCANE_UTILS_EXPORT ArrayShape
43 static constexpr int MAX_NB_DIMENSION = 8;
45 ArrayShape() =
default;
63 for (
Int32 i = 0, n = m_nb_dim; i < n; ++i)
64 v *= (
Int64)m_dims[i];
69 void setNbDimension(
Int32 nb_value);
82 friend bool operator==(
const ArrayShape& s1,
const ArrayShape& s2)
84 return _isEqual(s1, s2);
86 friend bool operator!=(
const ArrayShape& s1,
const ArrayShape& s2)
88 return !_isEqual(s1, s2);
94 std::array<Int32, MAX_NB_DIMENSION> m_dims = {};
98 void _set(SmallSpan<const Int32> v);
99 static bool _isEqual(
const ArrayShape& s1,
const ArrayShape& s2);
100 void _print(std::ostream& o)
const;
39class ARCANE_UTILS_EXPORT ArrayShape {
…};
Fichier de configuration d'Arcane.
Int32 dimension(Int32 index) const
Nombre d'élements de la index-ème dimension.
void setDimension(Int32 index, Int32 value)
Positionne la valeur de la index-ème dimension à value.
Int32 nbDimension() const
Rang de la forme.
SmallSpan< const Int32 > dimensions() const
Valeurs de chaque dimension.
Int64 totalNbElement() const
Nombre total d'élements.
Vue d'un tableau d'éléments de type T.
Vue d'un tableau d'éléments de type T.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.
std::ostream & operator<<(std::ostream &ostr, eItemKind item_kind)
Opérateur de sortie sur un flot.
std::int32_t Int32
Type entier signé sur 32 bits.