escript
Revision_
|
#include <DataVectorAlt.h>
Public Types | |
typedef T | ElementType |
typedef const ElementType * | const_pointer |
typedef ElementType | value_type |
typedef DataTypes::vec_size_type | size_type |
typedef ElementType & | reference |
typedef const ElementType & | const_reference |
Public Member Functions | |
DataVectorAlt () | |
Default constructor for DataVectorAlt. More... | |
DataVectorAlt (const DataVectorAlt< T > &other) | |
Copy constructor for DataVectorAlt. More... | |
DataVectorAlt (const size_type size, const value_type val=0.0, const size_type blockSize=1) | |
Constructor for DataVectorAlt. More... | |
~DataVectorAlt () | |
Default destructor for DataVectorAlt. More... | |
void | resize (const size_type newSize, const value_type newVal=0.0, const size_type newBlockSize=1) |
Resize the DataVectorAlt to the given length "newSize". All current data is lost. All elements in the new DataVectorAlt are initialised to "newVal". More... | |
void | copyFromArray (const WrappedArray &value, size_type copies) |
Populates the vector with the data from value. This method currently throws an exception if the specified number of copies won't fit. More... | |
void | copyFromArrayToOffset (const WrappedArray &value, size_type offset, size_type copies) |
size_type | size () const |
Return the number of elements in this DataVectorAlt. More... | |
DataVectorAlt & | operator= (const DataVectorAlt< T > &other) |
DataVectorAlt assignment operator "=". Assign the given DataVectorAlt object to this. More... | |
bool | operator== (const DataVectorAlt< T > &other) const |
DataVectorAlt equality comparison operator "==". Return true if the given DataVectorAlt is equal to this. More... | |
bool | operator!= (const DataVectorAlt< T > &other) const |
DataVectorAlt inequality comparison operator "!=". Return true if the given DataVectorAlt is not equal to this. More... | |
reference | operator[] (const size_type i) |
Return a reference to the element at position i in this DataVectorAlt. Will throw an exception if an invalid index "i" is given. More... | |
const_reference | operator[] (const size_type i) const |
template<> | |
void | copyFromArrayToOffset (const WrappedArray &value, size_type offset, size_type copies) |
Private Attributes | |
size_type | m_size |
size_type | m_dim |
size_type | m_N |
ElementType * | m_array_data |
typedef const ElementType* escript::DataTypes::DataVectorAlt< T >::const_pointer |
typedef const ElementType& escript::DataTypes::DataVectorAlt< T >::const_reference |
typedef T escript::DataTypes::DataVectorAlt< T >::ElementType |
typedef ElementType& escript::DataTypes::DataVectorAlt< T >::reference |
typedef DataTypes::vec_size_type escript::DataTypes::DataVectorAlt< T >::size_type |
typedef ElementType escript::DataTypes::DataVectorAlt< T >::value_type |
escript::DataTypes::DataVectorAlt< T >::DataVectorAlt | ( | ) |
Default constructor for DataVectorAlt.
Description: Constructs an empty DataVectorAlt object.
escript::DataTypes::DataVectorAlt< T >::DataVectorAlt | ( | const DataVectorAlt< T > & | other | ) |
Copy constructor for DataVectorAlt.
Description: Constructs a DataVectorAlt object which is a copy of the given DataVectorAlt object.
escript::DataTypes::DataVectorAlt< T >::DataVectorAlt | ( | const size_type | size, |
const value_type | val = 0.0 , |
||
const size_type | blockSize = 1 |
||
) |
Constructor for DataVectorAlt.
Description: Constructs a DataVectorAlt object of length "size" with all elements initilised to "val".
size | - Input - Number of elements in the vector. |
val | - Input - Initial value for all elements in the vector. Default is 0.0. |
blockSize | - Input - size of blocks within the vector, overall vector size must be a precise multiple of the block size. Default is 1. |
In escript::Data, blocksize corresponds to the number of elements required to hold all the data-points for a sample, ie: the product of the dimensions of a data-point and the number of data-points per sample. Size is the total number of elements required to hold all elements for all data-points in the given object, ie: number of samples * blocksize.
escript::DataTypes::DataVectorAlt< T >::~DataVectorAlt | ( | ) |
Default destructor for DataVectorAlt.
Description: Destroys the current DataVectorAlt object.
void escript::DataTypes::DataVectorAlt< T >::copyFromArray | ( | const WrappedArray & | value, |
size_type | copies | ||
) |
Populates the vector with the data from value. This method currently throws an exception if the specified number of copies won't fit.
Referenced by escript::DataExpanded::copy(), escript::Data::Data(), escript::DataConstant::DataConstant(), and escript::Data::setTaggedValue().
void escript::DataTypes::DataVectorAlt< DataTypes::cplx_t >::copyFromArrayToOffset | ( | const WrappedArray & | value, |
size_type | offset, | ||
size_type | copies | ||
) |
void escript::DataTypes::DataVectorAlt< T >::copyFromArrayToOffset | ( | const WrappedArray & | value, |
size_type | offset, | ||
size_type | copies | ||
) |
Referenced by escript::DataExpanded::copyToDataPoint().
bool escript::DataTypes::DataVectorAlt< T >::operator!= | ( | const DataVectorAlt< T > & | other | ) | const |
DataVectorAlt inequality comparison operator "!=". Return true if the given DataVectorAlt is not equal to this.
DataVectorAlt< T > & escript::DataTypes::DataVectorAlt< T >::operator= | ( | const DataVectorAlt< T > & | other | ) |
DataVectorAlt assignment operator "=". Assign the given DataVectorAlt object to this.
bool escript::DataTypes::DataVectorAlt< T >::operator== | ( | const DataVectorAlt< T > & | other | ) | const |
DataVectorAlt equality comparison operator "==". Return true if the given DataVectorAlt is equal to this.
|
inline |
Return a reference to the element at position i in this DataVectorAlt. Will throw an exception if an invalid index "i" is given.
NB: access to the element one past the end of the vector is permitted in order to provide a facility equivalent to an end() pointer.
|
inline |
void escript::DataTypes::DataVectorAlt< T >::resize | ( | const size_type | newSize, |
const value_type | newVal = 0.0 , |
||
const size_type | newBlockSize = 1 |
||
) |
Resize the DataVectorAlt to the given length "newSize". All current data is lost. All elements in the new DataVectorAlt are initialised to "newVal".
newSize | - Input - New size for the vector. |
newVal | - Input - New initial value for all elements in the vector. |
newBlockSize | - Input - New block size for the vector. |
Referenced by escript::DataTagged::addTag(), escript::DataTagged::addTaggedValue(), escript::DataConstant::complicate(), escript::DataExpanded::complicate(), escript::DataTagged::complicate(), escript::DataConstant::DataConstant(), escript::DataTagged::DataTagged(), and escript::DataExpanded::initialise().
|
inline |
Return the number of elements in this DataVectorAlt.
Referenced by escript::DataTagged::addTag(), escript::DataTagged::addTaggedValue(), escript::DataTagged::addTaggedValues(), escript::Data::copyWithMask(), escript::DataExpanded::DataExpanded(), escript::DataTagged::DataTagged(), escript::DataConstant::getLength(), escript::DataExpanded::getLength(), escript::DataExpanded::getPointOffset(), escript::DataConstant::hasNaN(), escript::DataTagged::hasNaN(), escript::DataExpanded::hasNaN(), escript::TestDomain::randomFill(), escript::MPIDataReducer::reduceRemoteValues(), escript::reductionOpVector(), escript::DataConstant::replaceNaN(), escript::DataTagged::replaceNaN(), escript::DataExpanded::replaceNaN(), escript::DataExpanded::setTaggedValue(), escript::DataConstant::setToZero(), and escript::DataTagged::setToZero().
|
private |
|
private |
|
private |
|
private |