2D array of items of arbitrary types. More...
#include <arcane/core/anyitem/AnyItemArray2.h>
Public Member Functions | |
| Array2 (const Group &group) | |
| void | resize (Integer size) |
| Resizing the second dimension of the array. | |
| void | fill (const DataType &data) |
| Filling the array. | |
| template<typename T> | |
| ArrayView< DataType > | operator[] (const T &item) |
| Accessor. | |
| template<typename T> | |
| ConstArrayView< DataType > | operator[] (const T &item) const |
| Integer | size () const |
| Returns the size of the array. | |
Private Attributes | |
| Integer | m_size |
| Size of the array's second dimension. | |
| Arcane::UniqueArray< Arcane::UniqueArray2< DataType > > | m_values |
| Container for generic variables. | |
2D array of items of arbitrary types.
Similar to 2D variables but without defining them
For example:
AnyItem::UniqueArray2<Real> array(family.allItems()); array.resize(3); array.fill(0.);
ENUMERATE_ANY_ITEM(iitem, family.allItems()) { for(Integer i = 0; i < 3; ++i) array[iitem][i] += variable[iitem]; }
\TODO: We could improve the implementation by using localId in AnyItem::Family with a unique array allocated to maxLocalId
Definition at line 51 of file AnyItemArray2.h.
|
inline |
Definition at line 55 of file AnyItemArray2.h.
|
inline |
|
inline |
|
inline |
Definition at line 93 of file AnyItemArray2.h.
|
inline |
Resizing the second dimension of the array.
Definition at line 68 of file AnyItemArray2.h.
References m_size, m_values, and size().
|
inline |
Returns the size of the array.
Definition at line 99 of file AnyItemArray2.h.
References m_size.
Referenced by resize().
|
private |
Size of the array's second dimension.
Definition at line 104 of file AnyItemArray2.h.
|
private |
Container for generic variables.
Definition at line 107 of file AnyItemArray2.h.
Referenced by fill(), operator[](), and resize().