escript
Revision_
|
DataBlocks2D manages a 2D array of multi-dimensional data points. More...
#include <DataBlocks2D.h>
Public Types | |
typedef DataVector | ValueType |
Public Member Functions | |
DataBlocks2D () | |
Default constructor for DataBlocks2D. | |
DataBlocks2D (const DataBlocks2D &other) | |
Copy constructor for DataBlocks2D. | |
DataBlocks2D (int numRows, int numCols, int blockSize) | |
Constructor for DataBlocks2D. | |
~DataBlocks2D () | |
Default destructor for DataBlocks2D. | |
ValueType::size_type | size () const |
Return the size of the underlying data array. ie: Number of rows * Number of columns * Number of elements per data point. | |
ValueType::size_type | getNumRows () const |
Return the number of rows in this DataBlocks2D array. | |
ValueType::size_type | getNumCols () const |
Return the number of columns in this DataBlocks2D array. | |
ValueType::size_type | getBlockSize () const |
Return the data point size for this DataBlocks2D array. | |
void | resize (int numRows, int numCols, int blockSize) |
Resize the underlying data array. All current data is lost. The new data elements are initialised to 0. | |
DataBlocks2D & | operator= (const DataBlocks2D &other) |
DataBlocks2D assignment operator = Assign the given DataBlocks2D object to this one. | |
void | Swap (DataBlocks2D &other) |
Swap all the values managed by the given DataBlocks2D objects. | |
ValueType::size_type | index (int row, int col) const |
Return the 1 dimensional index of the first element for data-point (i,j) within the underlying data array. Provides an index for accessing this data value via the [] operator. Subsequent elements of this data point can be accessed by manually incrementing the returned index value. | |
ValueType::reference | operator[] (ValueType::size_type i) |
Return a reference to the first element for the data-point with index i within the underlying data array as determined by the index(i,j) method. | |
ValueType::const_reference | operator[] (ValueType::size_type i) const |
ValueType::reference | operator() (int row, int col) |
Return a reference to the first element for the data-point (i,j). | |
ValueType::const_reference | operator() (int row, int col) const |
ValueType & | getData () |
Return a reference to the underlying data array. Data returned is an array type object that can be indexed via indexes generated by DataBlocks2D::index. | |
const ValueType & | getData () const |
Private Attributes | |
ValueType | m_data |
ValueType::size_type | m_numRows |
ValueType::size_type | m_numCols |
ValueType::size_type | m_blockSize |
DataBlocks2D manages a 2D array of multi-dimensional data points.
Description: This class is used to manage the data held by instances of the DataExpanded class.
Default constructor for DataBlocks2D.
Description: Default constructor for DataBlocks2D. Creates an empty DataBlocks2D object.
escript::DataBlocks2D::DataBlocks2D | ( | const DataBlocks2D & | other | ) |
Copy constructor for DataBlocks2D.
Description: Copy constructor for DataBlocks2D.
References m_data.
escript::DataBlocks2D::DataBlocks2D | ( | int | numRows, |
int | numCols, | ||
int | blockSize | ||
) |
Constructor for DataBlocks2D.
Description: Constructor for DataBlocks2D.
numRows | - Input - Number of rows(samples). |
numCols | - Input - Number of columns(data-points per sample). |
blockSize | - Input - Number of elements per block(per data-point). |
All parameters must be >0, else an exception will be thrown.
Default destructor for DataBlocks2D.
Description: Default destructor for DataBlocks2D.
References m_blockSize, m_numCols, and m_numRows.
DataBlocks2D::ValueType::size_type escript::DataBlocks2D::getBlockSize | ( | ) | const [inline] |
Return the data point size for this DataBlocks2D array.
References EsysAssert, m_blockSize, m_numCols, and m_numRows.
DataBlocks2D::ValueType & escript::DataBlocks2D::getData | ( | ) | [inline] |
Return a reference to the underlying data array. Data returned is an array type object that can be indexed via indexes generated by DataBlocks2D::index.
References EsysAssert, m_blockSize, m_data, m_numCols, and m_numRows.
Referenced by escript::DataExpanded::DataExpanded(), escript::DataExpanded::getVectorRO(), escript::DataExpanded::getVectorRW(), escript::DataExpanded::hasNaN(), and escript::DataExpanded::matrixInverse().
const DataBlocks2D::ValueType & escript::DataBlocks2D::getData | ( | ) | const [inline] |
References EsysAssert, m_blockSize, m_data, m_numCols, and m_numRows.
DataBlocks2D::ValueType::size_type escript::DataBlocks2D::getNumCols | ( | ) | const [inline] |
Return the number of columns in this DataBlocks2D array.
References EsysAssert, m_blockSize, m_numCols, and m_numRows.
Referenced by escript::DataExpanded::copy(), escript::DataExpanded::DataExpanded(), escript::DataExpanded::setSlice(), and escript::DataExpanded::toString().
DataBlocks2D::ValueType::size_type escript::DataBlocks2D::getNumRows | ( | ) | const [inline] |
Return the number of rows in this DataBlocks2D array.
References EsysAssert, m_blockSize, m_numCols, and m_numRows.
Referenced by escript::DataExpanded::copy(), escript::DataExpanded::DataExpanded(), escript::DataExpanded::setSlice(), and escript::DataExpanded::toString().
DataBlocks2D::ValueType::size_type escript::DataBlocks2D::index | ( | int | row, |
int | col | ||
) | const [inline] |
Return the 1 dimensional index of the first element for data-point (i,j) within the underlying data array. Provides an index for accessing this data value via the [] operator. Subsequent elements of this data point can be accessed by manually incrementing the returned index value.
References EsysAssert, m_blockSize, m_data, m_numCols, m_numRows, and escript::DataVector::size().
Referenced by escript::DataExpanded::getPointOffset(), and operator()().
DataBlocks2D::ValueType::reference escript::DataBlocks2D::operator() | ( | int | row, |
int | col | ||
) | [inline] |
Return a reference to the first element for the data-point (i,j).
References EsysAssert, index(), m_blockSize, m_data, m_numCols, and m_numRows.
DataBlocks2D::ValueType::const_reference escript::DataBlocks2D::operator() | ( | int | row, |
int | col | ||
) | const [inline] |
References EsysAssert, index(), m_blockSize, m_data, m_numCols, and m_numRows.
DataBlocks2D & escript::DataBlocks2D::operator= | ( | const DataBlocks2D & | other | ) |
DataBlocks2D assignment operator = Assign the given DataBlocks2D object to this one.
References EsysAssert, m_blockSize, m_numCols, m_numRows, and Swap().
DataBlocks2D::ValueType::reference escript::DataBlocks2D::operator[] | ( | ValueType::size_type | i | ) | [inline] |
Return a reference to the first element for the data-point with index i within the underlying data array as determined by the index(i,j) method.
References EsysAssert, m_blockSize, m_data, m_numCols, and m_numRows.
DataBlocks2D::ValueType::const_reference escript::DataBlocks2D::operator[] | ( | ValueType::size_type | i | ) | const [inline] |
References EsysAssert, m_blockSize, m_data, m_numCols, and m_numRows.
void escript::DataBlocks2D::resize | ( | int | numRows, |
int | numCols, | ||
int | blockSize | ||
) |
Resize the underlying data array. All current data is lost. The new data elements are initialised to 0.
numRows | - Input - Number of rows. |
numCols | - Input - Number of columns. |
blockSize | - Input - Number of elements per block. |
All parameters must be >0, else an exception will be thrown.
References m_blockSize, m_data, m_numCols, m_numRows, escript::DataVector::resize(), and size().
Referenced by DataBlocks2D(), and escript::DataExpanded::initialise().
DataBlocks2D::ValueType::size_type escript::DataBlocks2D::size | ( | ) | const [inline] |
Return the size of the underlying data array. ie: Number of rows * Number of columns * Number of elements per data point.
References EsysAssert, m_blockSize, m_data, m_numCols, m_numRows, and escript::DataVector::size().
Referenced by escript::DataExpanded::getLength(), and resize().
void escript::DataBlocks2D::Swap | ( | DataBlocks2D & | other | ) |
Swap all the values managed by the given DataBlocks2D objects.
References EsysAssert, m_blockSize, m_data, m_numCols, m_numRows, and paso::swap().
Referenced by operator=().
Referenced by getBlockSize(), getData(), getNumCols(), getNumRows(), index(), operator()(), operator=(), operator[](), resize(), size(), Swap(), and ~DataBlocks2D().
ValueType escript::DataBlocks2D::m_data [private] |
Referenced by DataBlocks2D(), getData(), index(), operator()(), operator[](), resize(), size(), and Swap().
Referenced by getBlockSize(), getData(), getNumCols(), getNumRows(), index(), operator()(), operator=(), operator[](), resize(), size(), Swap(), and ~DataBlocks2D().
Referenced by DataBlocks2D(), getBlockSize(), getData(), getNumCols(), getNumRows(), index(), operator()(), operator=(), operator[](), resize(), size(), Swap(), and ~DataBlocks2D().