escript  Revision_
Public Types | Public Member Functions | Private Attributes | List of all members
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. 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...
 
DataVectorAltoperator= (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
 
ElementTypem_array_data
 

Member Typedef Documentation

◆ const_pointer

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

◆ const_reference

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

◆ ElementType

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

◆ reference

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

◆ size_type

◆ value_type

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

Constructor & Destructor Documentation

◆ DataVectorAlt() [1/3]

template<class T >
escript::DataTypes::DataVectorAlt< T >::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::DataVectorAlt< T >::~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.

Referenced by escript::DataExpanded::copy(), escript::Data::Data(), escript::DataConstant::DataConstant(), and escript::Data::setTaggedValue().

◆ copyFromArrayToOffset() [1/2]

template<>
void escript::DataTypes::DataVectorAlt< DataTypes::cplx_t >::copyFromArrayToOffset ( const WrappedArray value,
size_type  offset,
size_type  copies 
)

◆ copyFromArrayToOffset() [2/2]

template<class T >
void escript::DataTypes::DataVectorAlt< T >::copyFromArrayToOffset ( const WrappedArray value,
size_type  offset,
size_type  copies 
)

◆ 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=()

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

DataVectorAlt assignment operator "=". Assign the given DataVectorAlt object to this.

◆ operator==()

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

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

◆ operator[]() [2/2]

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

◆ 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::DataConstant::complicate(), escript::DataExpanded::complicate(), escript::DataTagged::complicate(), escript::DataConstant::DataConstant(), escript::DataTagged::DataTagged(), and escript::DataExpanded::initialise().

◆ size()

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

Member Data Documentation

◆ m_array_data

template<class T>
ElementType* escript::DataTypes::DataVectorAlt< T >::m_array_data
private

◆ m_dim

template<class T>
size_type escript::DataTypes::DataVectorAlt< T >::m_dim
private

◆ m_N

template<class T>
size_type escript::DataTypes::DataVectorAlt< T >::m_N
private

◆ m_size

template<class T>
size_type escript::DataTypes::DataVectorAlt< T >::m_size
private

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