UQTk: Uncertainty Quantification Toolkit 3.1.5
Array1D< double > Class Reference

#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 double &t)
 Constructor that allocates and initializes the data to a value t.
 
Array1Doperator= (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 double &t)
 Resizes the array and sets ALL entries to the specified value.
 
void SetValue (const double &t)
 Set all values in the array to the given value.
 
void PushBack (const double &t)
 Add element to the end of the vector.
 
double * 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 double * 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).
 
double & operator() (int ix)
 
const double & operator() (int ix) const
 
void insert (Array1D< double > &insarr, int ix)
 Insert a given array to the position ix.
 
void insert (const double &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.
 
double & operator[] (int i)
 
vector< int > shape ()
 
void assign (const int x, const double 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< double > inarray)
 
void setnpdblArray (vector< double > inarray, int n)
 
void getnpdblArray (double *outarray)
 
vector< double > flatten ()
 
string type ()
 

Public Attributes

vector< double > data_
 

Private Attributes

int xsize_
 

Constructor & Destructor Documentation

◆ Array1D() [1/4]

Array1D< double >::Array1D ( )
inline

Default constructor, which does not allocate any memory.

◆ Array1D() [2/4]

Array1D< double >::Array1D ( const int & nx)
inline

Constructor that allocates the memory.

◆ Array1D() [3/4]

Array1D< double >::Array1D ( const int & nx,
const double & t )
inline

Constructor that allocates and initializes the data to a value t.

◆ Array1D() [4/4]

Array1D< double >::Array1D ( const Array1D< double > & obj)
inline

Copy constructor.

◆ ~Array1D()

Array1D< double >::~Array1D ( )
inline

Destructor that frees up the memory.

Member Function Documentation

◆ assign()

void Array1D< double >::assign ( const int x,
const double val )
inline

◆ Clear()

void Array1D< double >::Clear ( )
inline

Function to clear the memory.

◆ DumpBinary() [1/2]

void Array1D< double >::DumpBinary ( char * filename)
inline

Dump contents of the array to a file in binary format.

◆ DumpBinary() [2/2]

void Array1D< double >::DumpBinary ( FILE * f_out) const
inline

Dump contents of the array to a file in binary format.

◆ DumpBinary4py()

void Array1D< double >::DumpBinary4py ( char * filename)
inline

◆ erase()

void Array1D< double >::erase ( int ix)
inline

Erase the value from the position ix.

◆ flatten()

vector< double > Array1D< double >::flatten ( )
inline

◆ GetArrayPointer()

double * Array1D< double >::GetArrayPointer ( )
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).

◆ GetConstArrayPointer()

const double * Array1D< double >::GetConstArrayPointer ( ) const
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).

◆ getnpdblArray()

void Array1D< double >::getnpdblArray ( double * outarray)
inline

◆ insert() [1/2]

void Array1D< double >::insert ( Array1D< double > & insarr,
int ix )
inline

Insert a given array to the position ix.

Note
ix=0 means insert at the beginning, ix=xsize_ means insert at the end

◆ insert() [2/2]

void Array1D< double >::insert ( const double & insval,
int ix )
inline

Insert a given value to the position ix.

Note
ix=0 means insert at the beginning, ix=xsize_ means insert at the end

◆ Length()

int Array1D< double >::Length ( ) const
inline

Returns length (i.e. size in the x-direction)

◆ operator()() [1/2]

double & Array1D< double >::operator() ( int ix)
inline

◆ operator()() [2/2]

const double & Array1D< double >::operator() ( int ix) const
inline

◆ operator=()

Array1D & Array1D< double >::operator= ( const Array1D< double > & obj)
inline

Assignment operator copies the data structure by value.

◆ operator[]()

double & Array1D< double >::operator[] ( int i)
inline

◆ PushBack()

void Array1D< double >::PushBack ( const double & t)
inline

Add element to the end of the vector.

◆ ReadBinary() [1/2]

void Array1D< double >::ReadBinary ( char * filename)
inline

◆ ReadBinary() [2/2]

void Array1D< double >::ReadBinary ( FILE * f_in)
inline

Read contents of the array from a file in binary format.

◆ ReadBinary4py()

void Array1D< double >::ReadBinary4py ( char * filename,
int n )
inline

◆ Resize() [1/2]

void Array1D< double >::Resize ( const int & nx)
inline

Resizes the array.

◆ Resize() [2/2]

void Array1D< double >::Resize ( const int & nx,
const double & t )
inline

Resizes the array and sets ALL entries to the specified value.

Warning
All original data will get lost if this function is used!

◆ setArray()

void Array1D< double >::setArray ( vector< double > inarray)
inline

◆ setnpdblArray()

void Array1D< double >::setnpdblArray ( vector< double > inarray,
int n )
inline

◆ SetValue()

void Array1D< double >::SetValue ( const double & t)
inline

Set all values in the array to the given value.

◆ shape()

vector< int > Array1D< double >::shape ( )
inline

◆ type()

string Array1D< double >::type ( )
inline

◆ XSize()

int Array1D< double >::XSize ( ) const
inline

Returns size in the x-direction.

Member Data Documentation

◆ data_

vector<double> Array1D< double >::data_

◆ xsize_

int Array1D< double >::xsize_
private

The documentation for this class was generated from the following file: