24 data =
new char[asize * elementsize];
39 delete [] (
char*)
data;
47 if (nsize < minsize) { nsize = minsize; }
49 p =
new char[nsize * elementsize];
56 delete [] (
char*)
data;
65 for (
int i = 0; i < size; i++)
68 if ( !((i+1) % width) || i+1 == size )
83 for (
int i = 0; i < size; i++)
85 out << operator[](i) <<
'\n';
92 MFEM_ASSERT(size > 0,
"Array is empty with size " << size);
94 T max = operator[](0);
95 for (
int i = 1; i < size; i++)
96 if (max <
operator[](i))
107 MFEM_ASSERT(size > 0,
"Array is empty with size " << size);
109 T min = operator[](0);
110 for (
int i = 1; i < size; i++)
111 if (
operator[](i) < min)
123 T sum =
static_cast<T
>(0);
124 for (
int i = 0; i < size; i++)
135 T sum =
static_cast<T
>(0);
136 for (
int i = 0; i < size; i++)
147 T val_prev = operator[](0), val;
148 for (
int i = 1; i < size; i++)
~BaseArray()
Free the allocated memory.
void * data
Pointer to data.
void GrowSize(int minsize, int elementsize)
int size
Size of the array.
int allocsize
Size of the allocated memory.
void Print(std::ostream &out=std::cout, int width=4)
Prints array to stream with width elements per row.
int IsSorted()
return true if the array is sorted.
void PartialSum()
Partial Sum.
void Save(std::ostream &out)
Prints array to stream out.