12#ifndef ARCANE_UTILS_EXTENTSV_H
13#define ARCANE_UTILS_EXTENTSV_H
26 template <
class...
Int32>
constexpr int doSum(
Int32... x)
30 constexpr int oneIfDynamic(
Int32 x)
36 template <
class...
Int32>
constexpr int nbDynamic(
Int32... args)
38 return doSum(oneIfDynamic(args)...);
47template <
typename IndexType_>
52 using ArrayExtentsValueType = impl::ArrayExtentsValue<IndexType_>;
54 static constexpr int rank() {
return 0; }
55 static constexpr int nb_dynamic = 0;
56 static constexpr bool isDynamic1D() {
return false; }
58 template <
int X>
using AddedFirstExtentsType = ExtentsV<IndexType_, X>;
59 template <
int X,
int Last>
using AddedFirstLastExtentsType = ExtentsV<IndexType_, X, Last>;
60 template <
int X,
int Last1,
int Last2>
using AddedFirstLastLastExtentsType = ExtentsV<IndexType_, X, Last1, Last2>;
68template <
typename IndexType_, Int32 X0>
73 static constexpr int rank() {
return 1; }
74 static constexpr int nb_dynamic = impl::extent::nbDynamic(X0);
75 static constexpr bool is_full_dynamic() {
return (nb_dynamic == 1); }
76 static constexpr bool isDynamic1D() {
return (nb_dynamic == 1); }
78 using MDIndexType = MDIndex<1>;
79 using ArrayExtentsValueType = impl::ArrayExtentsValue<IndexType_, X0>;
80 using RemovedFirstExtentsType = ExtentsV<IndexType_>;
81 using DynamicDimsType = MDIndex<nb_dynamic>;
82 template <
int X>
using AddedFirstExtentsType = ExtentsV<IndexType_, X, X0>;
83 template <
int X,
int Last>
using AddedFirstLastExtentsType = ExtentsV<IndexType_, X, X0, Last>;
84 template <
int X,
int Last1,
int Last2>
using AddedFirstLastLastExtentsType = ExtentsV<IndexType_, X, X0, Last1, Last2>;
86 using IndexType ARCANE_DEPRECATED_REASON(
"Use 'MDIndexType' instead") = ArrayIndex<1>;
94template <
typename IndexType_, Int32 X0, Int32 X1>
99 static constexpr int rank() {
return 2; }
100 static constexpr int nb_dynamic = impl::extent::nbDynamic(X0, X1);
101 static constexpr bool is_full_dynamic() {
return (nb_dynamic == 2); }
102 static constexpr bool isDynamic1D() {
return false; }
104 using MDIndexType = MDIndex<2>;
105 using ArrayExtentsValueType = impl::ArrayExtentsValue<IndexType_, X0, X1>;
106 using RemovedFirstExtentsType = ExtentsV<IndexType_, X1>;
107 using DynamicDimsType = MDIndex<nb_dynamic>;
108 template <
int X>
using AddedFirstExtentsType = ExtentsV<IndexType_, X, X0, X1>;
109 template <
int X,
int Last>
using AddedFirstLastExtentsType = ExtentsV<IndexType_, X, X0, X1, Last>;
111 using IndexType ARCANE_DEPRECATED_REASON(
"Use 'MDIndexType' instead") = ArrayIndex<2>;
119template <
typename IndexType_, Int32 X0, Int32 X1, Int32 X2>
120class ExtentsV<IndexType_, X0, X1, X2>
124 static constexpr int rank() {
return 3; }
125 static constexpr int nb_dynamic = impl::extent::nbDynamic(X0, X1, X2);
126 static constexpr bool is_full_dynamic() {
return (nb_dynamic == 3); }
127 static constexpr bool isDynamic1D() {
return false; }
129 using MDIndexType = MDIndex<3>;
130 using ArrayExtentsValueType = impl::ArrayExtentsValue<IndexType_, X0, X1, X2>;
131 using RemovedFirstExtentsType = ExtentsV<IndexType_, X1, X2>;
132 using DynamicDimsType = MDIndex<nb_dynamic>;
133 template <
int X>
using AddedFirstExtentsType = ExtentsV<IndexType_, X, X0, X1, X2>;
135 using IndexType ARCANE_DEPRECATED_REASON(
"Use 'MDIndexType' instead") = MDIndex<3>;
143template <
typename IndexType_, Int32 X0, Int32 X1, Int32 X2, Int32 X3>
144class ExtentsV<IndexType_, X0, X1, X2, X3>
148 static constexpr int rank() {
return 4; }
149 static constexpr int nb_dynamic = impl::extent::nbDynamic(X0, X1, X2, X3);
150 static constexpr bool is_full_dynamic() {
return (nb_dynamic == 4); }
151 static constexpr bool isDynamic1D() {
return false; }
153 using MDIndexType = MDIndex<4>;
154 using ArrayExtentsValueType = impl::ArrayExtentsValue<IndexType_, X0, X1, X2, X3>;
155 using RemovedFirstExtentsType = ExtentsV<IndexType_, X1, X2, X3>;
156 using DynamicDimsType = MDIndex<nb_dynamic>;
158 using IndexType ARCANE_DEPRECATED_REASON(
"Use 'MDIndexType' instead") = MDIndex<4>;
Déclarations des types utilisés dans Arcane.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
constexpr Int32 DynExtent
Constante pour indiquer que la dimension d'un tableau est dynamique.
std::int32_t Int32
Type entier signé sur 32 bits.