|
| Array (int asize=0, int ainc=0) |
| Creates array of asize elements. More...
|
|
| Array (T *_data, int asize, int ainc=0) |
|
| ~Array () |
| Destructor. More...
|
|
| operator T * () |
| Return the data as 'T *'. More...
|
|
| operator const T * () const |
| Return the data as 'const T *'. More...
|
|
T * | GetData () |
| Returns the data. More...
|
|
const T * | GetData () const |
| Returns the data. More...
|
|
bool | OwnsData () const |
| Return true if the data will be deleted by the array. More...
|
|
void | StealData (T **p) |
| Changes the ownership of the the data. More...
|
|
void | LoseData () |
| NULL-ifies the data. More...
|
|
void | MakeDataOwner () |
| Make the Array own the data. More...
|
|
int | Size () const |
| Logical size of the array. More...
|
|
void | SetSize (int nsize) |
| Change logical size of the array, keep existing entries. More...
|
|
void | SetSize (int nsize, const T &initval) |
| Same as SetSize(int) plus initialize new entries with 'initval'. More...
|
|
int | Capacity () const |
|
void | Reserve (int capacity) |
| Ensures that the allocated size is at least the given size. More...
|
|
T & | operator[] (int i) |
| Access element. More...
|
|
const T & | operator[] (int i) const |
| Access const element. More...
|
|
int | Append (const T &el) |
| Append element to array, resize if necessary. More...
|
|
int | Append (const Array< T > &els) |
| Append another array to this array, resize if necessary. More...
|
|
int | Prepend (const T &el) |
| Prepend an element to the array, resize if necessary. More...
|
|
T & | Last () |
| Return the last element in the array. More...
|
|
const T & | Last () const |
|
int | Union (const T &el) |
| Append element when it is not yet in the array, return index. More...
|
|
int | Find (const T &el) const |
| Return the first index where 'el' is found; return -1 if not found. More...
|
|
void | DeleteLast () |
| Delete the last entry. More...
|
|
void | DeleteFirst (const T &el) |
| Delete the first 'el' entry. More...
|
|
void | DeleteAll () |
| Delete whole array. More...
|
|
void | Copy (Array ©) const |
| Create a copy of the current array. More...
|
|
void | MakeRef (T *, int) |
| Make this Array a reference to a pointer. More...
|
|
void | MakeRef (const Array &master) |
| Make this Array a reference to 'master'. More...
|
|
void | GetSubArray (int offset, int sa_size, Array< T > &sa) |
|
void | Print (std::ostream &out=std::cout, int width=4) |
| Prints array to stream with width elements per row. More...
|
|
void | Save (std::ostream &out) |
| Prints array to stream out. More...
|
|
T | Max () const |
|
T | Min () const |
|
void | Sort () |
| Sorts the array. This requires operator< to be defined for T. More...
|
|
void | Unique () |
|
int | IsSorted () |
| return true if the array is sorted. More...
|
|
void | PartialSum () |
| Partial Sum. More...
|
|
T | Sum () |
| Sum all entries. More...
|
|
void | operator= (const T &a) |
|
void | Assign (const T *) |
| Copy data from a pointer. Size() elements are copied. More...
|
|
long | MemoryUsage () const |
|
template<class T>
class mfem::Array< T >
Abstract data type Array.
Array<T> is an automatically increasing array containing elements of the generic type T. The allocated size may be larger then the logical size of the array. The elements can be accessed by the [] operator, the range is 0 to size-1.
Definition at line 52 of file array.hpp.