|
| Array () |
| Creates an empty array. More...
|
|
| Array (MemoryType mt) |
| Creates an empty array with a given MemoryType. More...
|
|
| Array (int asize) |
| Creates array of asize elements. More...
|
|
| Array (int asize, MemoryType mt) |
| Creates array of asize elements with a given MemoryType. More...
|
|
| Array (T *data_, int asize) |
| Creates array using an existing c-array of asize elements; allocsize is set to -asize to indicate that the data will not be deleted. More...
|
|
| Array (const Array &src) |
| Copy constructor: deep copy from src. More...
|
|
template<typename CT > |
| Array (const Array< CT > &src) |
| Copy constructor (deep copy) from 'src', an Array of convertible type. More...
|
|
template<typename CT , int N> |
| Array (const CT(&values)[N]) |
| Deep copy from a braced init-list of convertible type. More...
|
|
| Array (Array< T > &&src) |
| Move constructor ("steals" data from 'src') More...
|
|
| ~Array () |
| Destructor. More...
|
|
Array< T > & | operator= (const Array< T > &src) |
| Assignment operator: deep copy from 'src'. More...
|
|
template<typename CT > |
Array & | operator= (const Array< CT > &src) |
| Assignment operator (deep copy) from src, an Array of convertible type. 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...
|
|
Memory< T > & | GetMemory () |
| Return a reference to the Memory object used by the Array. More...
|
|
const Memory< T > & | GetMemory () const |
| Return a reference to the Memory object used by the Array, const version. More...
|
|
bool | UseDevice () const |
| Return the device flag of the Memory object used by the Array. 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 data. More...
|
|
void | LoseData () |
| NULL-ifies the data. More...
|
|
void | MakeDataOwner () const |
| Make the Array own the data. More...
|
|
int | Size () const |
| Return the logical size of the array. More...
|
|
void | SetSize (int nsize) |
| Change the 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...
|
|
void | SetSize (int nsize, MemoryType mt) |
| Resize the array to size nsize using MemoryType mt. Note that unlike the other versions of SetSize(), the current content of the array is not preserved. More...
|
|
int | Capacity () const |
|
void | Reserve (int capacity) |
| Ensures that the allocated size is at least the given size. More...
|
|
T & | operator[] (int i) |
| Reference access to the ith element. More...
|
|
const T & | operator[] (int i) const |
| Const reference access to the ith element. More...
|
|
int | Append (const T &el) |
| Append element 'el' to array, resize if necessary. More...
|
|
int | Append (const T *els, int nels) |
| Append another array to this 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 'el' to the array, resize if necessary. More...
|
|
T & | Last () |
| Return the last element in the array. More...
|
|
const T & | Last () const |
| Return the last element in the array. More...
|
|
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...
|
|
int | FindSorted (const T &el) const |
| Do bisection search for 'el' in a sorted array; return -1 if not found. More...
|
|
void | DeleteLast () |
| Delete the last entry of the array. More...
|
|
void | DeleteFirst (const T &el) |
| Delete the first entry with value == 'el'. More...
|
|
void | DeleteAll () |
| Delete the whole array. More...
|
|
void | Copy (Array ©) const |
| Create a copy of the internal array to the provided copy. 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) const |
| Copy sub array starting from offset out to the provided sa. More...
|
|
void | Print (std::ostream &out=mfem::out, int width=4) const |
| Prints array to stream with width elements per row. More...
|
|
void | Save (std::ostream &out, int fmt=0) const |
| Save the Array to the stream out using the format fmt. The format fmt can be: More...
|
|
void | Load (std::istream &in, int fmt=0) |
| Read an Array from the stream in using format fmt. The format fmt can be: More...
|
|
void | Load (int new_size, std::istream &in) |
| Set the Array size to new_size and read that many entries from the stream in. More...
|
|
T | Max () const |
| Find the maximal element in the array, using the comparison operator < for class T. More...
|
|
T | Min () const |
| Find the minimal element in the array, using the comparison operator < for class T. More...
|
|
void | Sort () |
| Sorts the array in ascending order. This requires operator< to be defined for T. More...
|
|
template<class Compare > |
void | Sort (Compare cmp) |
| Sorts the array in ascending order using the supplied comparison function object. More...
|
|
void | Unique () |
| Removes duplicities from a sorted array. This requires operator== to be defined for T. More...
|
|
int | IsSorted () |
| Return 1 if the array is sorted from lowest to highest. Otherwise return 0. More...
|
|
void | PartialSum () |
| Fill the entries of the array with the cumulative sum of the entries. More...
|
|
T | Sum () |
| Return the sum of all the array entries using the '+'' operator for class 'T'. More...
|
|
void | operator= (const T &a) |
| Set all entries of the array to the provided constant. More...
|
|
void | Assign (const T *) |
| Copy data from a pointer. 'Size()' elements are copied. More...
|
|
template<typename U > |
void | CopyTo (U *dest) |
| STL-like copyTo dest from begin to end. More...
|
|
template<typename U > |
void | CopyFrom (const U *src) |
| Copy from src into this array. Copies enough entries to fill the Capacity size of this array. Careful this does not update the Size to match this Capacity after this. More...
|
|
T * | begin () |
| STL-like begin. Returns pointer to the first element of the array. More...
|
|
T * | end () |
| STL-like end. Returns pointer after the last element of the array. More...
|
|
const T * | begin () const |
| STL-like begin. Returns const pointer to the first element of the array. More...
|
|
const T * | end () const |
| STL-like end. Returns const pointer after the last element of the array. More...
|
|
std::size_t | MemoryUsage () const |
| Returns the number of bytes allocated for the array including any reserve. More...
|
|
const T * | Read (bool on_dev=true) const |
| Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev). More...
|
|
const T * | HostRead () const |
| Shortcut for mfem::Read(a.GetMemory(), a.Size(), false). More...
|
|
T * | Write (bool on_dev=true) |
| Shortcut for mfem::Write(a.GetMemory(), a.Size(), on_dev). More...
|
|
T * | HostWrite () |
| Shortcut for mfem::Write(a.GetMemory(), a.Size(), false). More...
|
|
T * | ReadWrite (bool on_dev=true) |
| Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), on_dev). More...
|
|
T * | HostReadWrite () |
| Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), false). More...
|
|
template<typename CT > |
Array< T > & | operator= (const Array< CT > &src) |
|
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, which must be a trivial type, see std::is_trivial
. 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 44 of file adios2stream.hpp.