UQTk: Uncertainty Quantification Toolkit 3.1.5
|
Stores data of any type T in a 1D array. More...
#include <Array1D.h>
Public Member Functions | |
Array1D () | |
Default constructor, which does not allocate any memory. | |
Array1D (const int &nx) | |
Constructor that allocates the memory. | |
Array1D (const int &nx, const T &t) | |
Constructor that allocates and initializes the data to a value t. | |
Array1D & | operator= (const Array1D &obj) |
Assignment operator copies the data structure by value. | |
Array1D (const Array1D &obj) | |
Copy constructor. | |
~Array1D () | |
Destructor that frees up the memory. | |
void | Clear () |
Function to clear the memory. | |
int | XSize () const |
Returns size in the x-direction. | |
int | Length () const |
Returns length (i.e. size in the x-direction) | |
void | Resize (const int &nx) |
Resizes the array. | |
void | Resize (const int &nx, const T &t) |
Resizes the array and sets ALL entries to the specified value. | |
void | SetValue (const T &t) |
Set all values in the array to the given value. | |
void | PushBack (const T &t) |
Add element to the end of the vector. | |
T * | GetArrayPointer () |
Return a pointer to the first element of the data in the vector so we can use it access the data in array format (e.g. for passing it to a Fortran program). | |
const T * | GetConstArrayPointer () const |
Return a const point to the first element of the data in the vector so we can use it access the data in array format (e.g. for passing it to a Fortran program). | |
T & | operator() (int ix) |
const T & | operator() (int ix) const |
void | insert (Array1D< T > &insarr, int ix) |
Insert a given array to the position ix. | |
void | insert (const T &insval, int ix) |
Insert a given value to the position ix. | |
void | erase (int ix) |
Erase the value from the position ix. | |
void | DumpBinary (FILE *f_out) const |
Dump contents of the array to a file in binary format. | |
void | ReadBinary (FILE *f_in) |
Read contents of the array from a file in binary format. | |
T & | operator[] (int i) |
vector< int > | shape () |
void | assign (const int x, const T val) |
void | DumpBinary (char *filename) |
Dump contents of the array to a file in binary format. | |
void | ReadBinary (char *filename) |
void | DumpBinary4py (char *filename) |
void | ReadBinary4py (char *filename, int n) |
void | setArray (vector< T > inarray) |
vector< T > | flatten () |
string | type () |
Public Attributes | |
int | xsize_ |
vector< T > | data_ |
Stores data of any type T in a 1D array.
This class also provides a Fortran-like access operator () as well as a function to access the data in the array through a pointer that can be passed to F77 or C routines.
Default constructor, which does not allocate any memory.
Constructor that allocates the memory.
Constructor that allocates and initializes the data to a value t.
|
inline |
|
inline |
Function to clear the memory.
|
inline |
Dump contents of the array to a file in binary format.
|
inline |
Dump contents of the array to a file in binary format.
|
inline |
|
inline |
Erase the value from the position ix.
|
inline |
|
inline |
Return a pointer to the first element of the data in the vector so we can use it access the data in array format (e.g. for passing it to a Fortran program).
|
inline |
Return a const point to the first element of the data in the vector so we can use it access the data in array format (e.g. for passing it to a Fortran program).
Insert a given array to the position ix.
|
inline |
Insert a given value to the position ix.
|
inline |
Returns length (i.e. size in the x-direction)
|
inline |
|
inline |
Assignment operator copies the data structure by value.
|
inline |
|
inline |
Add element to the end of the vector.
|
inline |
|
inline |
Read contents of the array from a file in binary format.
|
inline |
|
inline |
Resizes the array.
|
inline |
Resizes the array and sets ALL entries to the specified value.
|
inline |
|
inline |
Set all values in the array to the given value.
|
inline |
|
inline |
|
inline |
Returns size in the x-direction.
vector<T> Array1D< T >::data_ |
int Array1D< T >::xsize_ |