Class representing a classic 2D array. More...
#include <arccore/collections/Array2.h>
Public Member Functions | |
| ArrayView< DataType > | operator[] (Int64 i) |
| ConstArrayView< DataType > | operator[] (Int64 i) const |
| ArrayView< DataType > | operator() (Int64 i) |
| ConstArrayView< DataType > | operator() (Int64 i) const |
| DataType & | operator() (Int64 i, Int64 j) |
| ConstReferenceType | operator() (Int64 i, Int64 j) const |
| DataType | item (Int64 i, Int64 j) |
| void | setItem (Int64 i, Int64 j, ConstReferenceType v) |
| ConstArrayView< DataType > | at (Int64 i) const |
| Element at index i. Always checks for bounds. | |
| ArrayView< DataType > | at (Int64 i) |
| Element at index i. Always checks for bounds. | |
| DataType | at (Int64 i, Int64 j) |
| void | fill (ConstReferenceType v) |
| void | clear () |
| Array2< DataType > | clone () |
| void | copy (Span2< const DataType > rhs) |
| Resizes the instance based on the dimensions of rhs and copies the values of rhs into it. | |
| Integer | capacity () const |
| Capacity (number of allocated elements) of the array. | |
| Int64 | largeCapacity () const |
| Capacity (number of allocated elements) of the array. | |
| void | reserve (Int64 new_capacity) |
| Reserves memory for new_capacity elements. | |
| void | shrink () |
| void | shrink (Int64 new_capacity) |
| Reallocates memory to have a capacity close to new_capacity. | |
| void | shrink_to_fit () |
| ArrayView< DataType > | viewAsArray () |
| View of the array as a 1D array. | |
| ConstArrayView< DataType > | viewAsArray () const |
| View of the array as a 1D array. | |
| Span< DataType > | to1DSpan () |
| View of the array as a 1D array. | |
| Span< const DataType > | to1DSpan () const |
| View of the array as a 1D array. | |
| operator Array2View< DataType > () | |
| operator ConstArray2View< DataType > () const | |
| operator Span2< const DataType > () const | |
| operator Span2< DataType > () | |
| Array2View< DataType > | view () |
| ConstArray2View< DataType > | constView () const |
| Span2< DataType > | span () |
| Span2< const DataType > | constSpan () const |
| Integer | dim2Size () const |
| Integer | dim1Size () const |
| Int64 | largeDim2Size () const |
| Int64 | largeDim1Size () const |
| void | add (const DataType &value) |
| void | resize (Int64 new_size) |
| Resizes only the first dimension, leaving the second dimension unchanged. | |
| void | resizeNoInit (Int64 new_size) |
| Resizes only the first dimension, leaving the second dimension unchanged. | |
| void | resize (Int64 new_size1, Int64 new_size2) |
| Reallocates both dimensions. | |
| void | resizeNoInit (Int64 new_size1, Int64 new_size2) |
| Reallocates both dimensions. | |
| Integer | totalNbElement () const |
| Total number of elements (dim1Size()*dim2Size()). | |
| Int64 | largeTotalNbElement () const |
| Total number of elements (largeDim1Size()*largeDim2Size()). | |
| MemoryAllocationOptions | allocationOptions () const |
| String | debugName () const |
| Debug name (null if no name specified). | |
| void | setDebugName (const String &name) |
| Sets the array name for debug information. | |
Protected Types | |
| enum | CloneBehaviour { CB_Clone , CB_Shared } |
| enum | InitBehaviour { IB_InitWithDefault , IB_NoInit } |
Protected Member Functions | |
| Array2 (Int64 size1, Int64 size2) | |
| Creates an array of size1 * size2 elements. | |
| Array2 (ConstArray2View< DataType > rhs) | |
| Array2 (const Span2< const DataType > &rhs) | |
| Array2 (IMemoryAllocator *allocator) | |
| Creates an empty array with a specific allocator allocator. | |
| Array2 (IMemoryAllocator *allocator, Int64 size1, Int64 size2) | |
| Creates an array of size1 * size2 elements with a specific allocator allocator. | |
| Array2 (Array2< DataType > &&rhs) | |
| Move constructor. Only valid for UniqueArray2. | |
| void | _resize (Int64 new_size, InitBehaviour rb) |
| Resizes only the first dimension, leaving the second dimension unchanged. | |
| void | _resize (Int64 new_size1, Int64 new_size2, InitBehaviour rb) |
| Reallocates both dimensions. | |
| void | _resizeFromEmpty (Int64 new_size1, Int64 new_size2, InitBehaviour rb) |
| void | _resizeSameDim1ReduceDim2 (Int64 new_size2, InitBehaviour rb) |
| void | _resizeSameDim1IncreaseDim2 (Int64 new_size2, InitBehaviour rb) |
| void | _resize2 (Int64 d1, Int64 d2, InitBehaviour rb) |
| void | _move (Array2< DataType > &rhs) |
| void | _swap (Array2< DataType > &rhs) |
| void | _assignFromArray2 (const Array2< DataType > &rhs) |
| void | _resizeAndCopyView (Span2< const DataType > rhs) |
| void | _copyMetaData (const Array2< DataType > &rhs) |
| void | _destroy () |
| void | _initFromAllocator (MemoryAllocationOptions o, Int64 acapacity, void *pre_allocated_buffer=nullptr) |
| Constructs an empty vector with a specific allocator a. | |
| void | _internalDeallocate (RunQueue *queue=nullptr) |
| void | _setMP (TrueImpl *new_mp) |
| void | _setMP2 (TrueImpl *new_mp, ArrayMetaData *new_md) |
Protected Attributes | |
| DataType * | m_ptr |
Class representing a classic 2D array.
Instances of this class are neither copyable nor assignable. To create a copyable array, you must use SharedArray2 (for reference semantics) or UniqueArray2 (for value semantics like STL).
Definition at line 42 of file arccore/src/collections/arccore/collections/Array2.h.
|
protected |
Definition at line 47 of file arccore/src/collections/arccore/collections/Array2.h.
|
protected |
Definition at line 52 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 86 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Creates an array of size1 * size2 elements.
Definition at line 90 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 95 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 100 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineexplicitprotected |
Creates an empty array with a specific allocator allocator.
Definition at line 109 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Creates an array of size1 * size2 elements with a specific allocator allocator.
Definition at line 118 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Move constructor. Only valid for UniqueArray2.
Definition at line 136 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 478 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 520 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 626 of file AbstractArray.h.
|
inlineprotected |
Constructs an empty vector with a specific allocator a.
If acapacity is not null, memory is allocated to hold acapacity elements (but the array remains empty).
This method must only be called in a derived class constructor and only by classes using UniqueArray semantics.
Definition at line 262 of file AbstractArray.h.
Referenced by Arcane::Array2< T >::Array2(), and Arcane::Array2< T >::Array2().
|
inlineprotected |
Definition at line 494 of file AbstractArray.h.
|
inlineprotected |
Definition at line 467 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Resizes only the first dimension, leaving the second dimension unchanged.
Definition at line 375 of file arccore/src/collections/arccore/collections/Array2.h.
Referenced by Arcane::Array2< T >::_resize(), Arcane::Array2< T >::resize(), Arcane::Array2< T >::resize(), Arcane::Array2< T >::resizeNoInit(), and Arcane::Array2< T >::resizeNoInit().
|
inlineprotected |
Reallocates both dimensions.
Definition at line 386 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 451 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 492 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 406 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 428 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 414 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 877 of file AbstractArray.h.
|
inlineprotected |
Definition at line 882 of file AbstractArray.h.
|
inlineprotected |
Definition at line 472 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 317 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 63 of file AbstractArray.h.
|
inline |
Element at index i. Always checks for bounds.
Definition at line 205 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Element at index i. Always checks for bounds.
Definition at line 199 of file arccore/src/collections/arccore/collections/Array2.h.
Referenced by Arcane::Array2VariableT< T >::compact().
|
inline |
Definition at line 210 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Capacity (number of allocated elements) of the array.
Definition at line 238 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 220 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 225 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 306 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 298 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Resizes the instance based on the dimensions of rhs and copies the values of rhs into it.
Definition at line 233 of file arccore/src/collections/arccore/collections/Array2.h.
Referenced by Arcane::Array2VariableT< T >::_compareVariable().
| String Arcane::AbstractArrayBase::debugName | ( | ) | const |
Debug name (null if no name specified).
Definition at line 74 of file arccore/src/common/arccore/common/Array.cc.
|
inline |
Definition at line 314 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 313 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 216 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 188 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Capacity (number of allocated elements) of the array.
Definition at line 241 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 316 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 315 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Total number of elements (largeDim1Size()*largeDim2Size()).
Definition at line 370 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 278 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 282 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 286 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 290 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 155 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 161 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 166 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 171 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 143 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 149 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Reserves memory for new_capacity elements.
Definition at line 244 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Resizes only the first dimension, leaving the second dimension unchanged.
Any new values are initialized with the default constructor.
Definition at line 330 of file arccore/src/collections/arccore/collections/Array2.h.
Referenced by Arcane::Array2< T >::Array2(), Arcane::Array2< T >::Array2(), and Arcane::Array2VariableT< T >::compact().
|
inline |
Reallocates both dimensions.
Any new values are initialized with the default constructor.
Definition at line 351 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Resizes only the first dimension, leaving the second dimension unchanged.
Any new values are NOT initialized.
Definition at line 341 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Reallocates both dimensions.
Any new values are NOT initialized.
Definition at line 361 of file arccore/src/collections/arccore/collections/Array2.h.
| void Arcane::AbstractArrayBase::setDebugName | ( | const String & | name | ) |
Sets the array name for debug information.
This name can be used, for example, for listing displays.
Definition at line 72 of file arccore/src/common/arccore/common/Array.cc.
|
inline |
Definition at line 193 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 247 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Reallocates memory to have a capacity close to new_capacity.
Definition at line 250 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 253 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Definition at line 302 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
View of the array as a 1D array.
Definition at line 266 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
View of the array as a 1D array.
Definition at line 271 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Total number of elements (dim1Size()*dim2Size()).
Definition at line 367 of file arccore/src/collections/arccore/collections/Array2.h.
Referenced by Arcane::Array2< T >::_resize().
|
inline |
Definition at line 294 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
View of the array as a 1D array.
Definition at line 256 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
View of the array as a 1D array.
Definition at line 261 of file arccore/src/collections/arccore/collections/Array2.h.
|
protected |
Definition at line 413 of file AbstractArray.h.