escript Revision_
escript::DataTypes::DataVectorAlt< T > Class Template Reference

#include <DataVectorAlt.h>

Public Types

typedef T ElementType
 
typedef const ElementTypeconst_pointer
 
typedef ElementType value_type
 
typedef DataTypes::vec_size_type size_type
 
typedef ElementTypereference
 
typedef const ElementTypeconst_reference
 

Public Member Functions

 DataVectorAlt ()
 Default constructor for DataVectorAlt.
 
 DataVectorAlt (const DataVectorAlt< T > &other)
 Copy constructor for DataVectorAlt.
 
 DataVectorAlt (const size_type size, const value_type val=0.0, const size_type blockSize=1)
 Constructor for DataVectorAlt.
 
 ~DataVectorAlt ()
 Default destructor for DataVectorAlt.
 
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".
 
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.
 
void copyFromArrayToOffset (const WrappedArray &value, size_type offset, size_type copies)
 
size_type size () const
 Return the number of elements in this DataVectorAlt.
 
DataVectorAltoperator= (const DataVectorAlt< T > &other)
 DataVectorAlt assignment operator "=". Assign the given DataVectorAlt object to this.
 
bool operator== (const DataVectorAlt< T > &other) const
 DataVectorAlt equality comparison operator "==". Return true if the given DataVectorAlt is equal to this.
 
bool operator!= (const DataVectorAlt< T > &other) const
 DataVectorAlt inequality comparison operator "!=". Return true if the given DataVectorAlt is not equal to this.
 
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.
 
const_reference operator[] (const size_type i) const
 
ElementTypedata ()
 
const ElementTypedata () const
 
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
 
ElementTypem_array_data
 

Member Typedef Documentation

◆ const_pointer

template<class T >
const ElementType* escript::DataTypes::DataVectorAlt< T >::const_pointer

◆ const_reference

template<class T >
const ElementType& escript::DataTypes::DataVectorAlt< T >::const_reference

◆ ElementType

template<class T >
T escript::DataTypes::DataVectorAlt< T >::ElementType

◆ reference

template<class T >
ElementType& escript::DataTypes::DataVectorAlt< T >::reference

◆ size_type

template<class T >
DataTypes::vec_size_type escript::DataTypes::DataVectorAlt< T >::size_type

◆ value_type

template<class T >
ElementType escript::DataTypes::DataVectorAlt< T >::value_type

Constructor & Destructor Documentation

◆ DataVectorAlt() [1/3]

template<class T >
escript::DataTypes::DataTypes::DataVectorAlt::DataVectorAlt ( )

Default constructor for DataVectorAlt.

Description: Constructs an empty DataVectorAlt object.

◆ DataVectorAlt() [2/3]

template<class T >
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.

◆ DataVectorAlt() [3/3]

template<class T >
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".

Parameters
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.

◆ ~DataVectorAlt()

template<class T >
escript::DataTypes::DataTypes::DataVectorAlt::~DataVectorAlt ( )

Default destructor for DataVectorAlt.

Description: Destroys the current DataVectorAlt object.

Member Function Documentation

◆ copyFromArray()

template<class T >
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.

Warning
This function does not attempt to perform shape checking.

References escript::WrappedArray::getShape(), and escript::DataTypes::noValues().

Referenced by escript::DataExpanded::copy().

◆ copyFromArrayToOffset() [1/2]

◆ copyFromArrayToOffset() [2/2]

◆ data() [1/2]

◆ data() [2/2]

template<class T >
const DataVectorAlt< T >::ElementType * escript::DataTypes::DataVectorAlt< T >::data ( ) const
inline

◆ operator!=()

template<class T >
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.

◆ operator=()

◆ operator==()

template<class T >
bool escript::DataTypes::DataVectorAlt< T >::operator== ( const DataVectorAlt< T > & other) const

◆ operator[]() [1/2]

template<class T >
DataVectorAlt< T >::reference escript::DataTypes::DataVectorAlt< T >::operator[] ( const size_type i)
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.

References ESYS_ASSERT.

◆ operator[]() [2/2]

template<class T >
DataVectorAlt< T >::const_reference escript::DataTypes::DataVectorAlt< T >::operator[] ( const size_type i) const
inline

References ESYS_ASSERT.

◆ resize()

template<class T >
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".

Parameters
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::DataTagged::addTaggedValue(), escript::DataConstant::complicate(), escript::DataExpanded::complicate(), escript::DataTagged::complicate(), escript::DataConstant::DataConstant(), escript::DataTagged::DataTagged(), escript::DataTagged::DataTagged(), escript::DataTagged::DataTagged(), escript::DataTagged::DataTagged(), escript::DataTypes::fillComplexFromReal(), escript::DataExpanded::initialise(), and escript::DataLazy::LazyNodeSetup().

◆ size()

template<class T >
DataVectorAlt< T >::size_type escript::DataTypes::DataVectorAlt< T >::size ( ) const
inline

Return the number of elements in this DataVectorAlt.

Referenced by escript::DataTagged::addTag(), escript::DataTagged::addTaggedValue(), escript::DataTagged::addTaggedValue(), escript::DataTagged::addTaggedValues(), escript::DataExpanded::DataExpanded(), escript::DataExpanded::DataExpanded(), escript::DataTagged::DataTagged(), escript::DataTagged::DataTagged(), escript::DataTagged::DataTagged(), escript::DataTagged::DataTagged(), escript::DataTagged::DataTagged(), escript::DataTagged::DataTagged(), escript::DataTypes::fillComplexFromReal(), escript::DataConstant::getLength(), escript::DataExpanded::getLength(), escript::DataTagged::getLength(), escript::DataExpanded::getPointOffset(), escript::DataConstant::hasInf(), escript::DataExpanded::hasInf(), escript::DataTagged::hasInf(), escript::DataConstant::hasNaN(), escript::DataExpanded::hasNaN(), escript::DataTagged::hasNaN(), escript::DataTypes::pointToString(), dudley::DudleyDomain::randomFill(), escript::TestDomain::randomFill(), finley::FinleyDomain::randomFill(), escript::MPIDataReducer::reduceRemoteValues(), escript::reductionOpVector(), escript::DataConstant::replaceInf(), escript::DataConstant::replaceInf(), escript::DataExpanded::replaceInf(), escript::DataExpanded::replaceInf(), escript::DataTagged::replaceInf(), escript::DataTagged::replaceInf(), escript::DataConstant::replaceNaN(), escript::DataConstant::replaceNaN(), escript::DataExpanded::replaceNaN(), escript::DataExpanded::replaceNaN(), escript::DataTagged::replaceNaN(), escript::DataTagged::replaceNaN(), escript::DataExpanded::setTaggedValue(), escript::DataExpanded::setTaggedValue(), escript::DataConstant::setToZero(), and escript::DataTagged::setToZero().

Member Data Documentation

◆ m_array_data

◆ m_dim

◆ m_N

◆ m_size


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