Go to the documentation of this file.
18 #if !defined escript_DataVectorTaipan_H
19 #define escript_DataVectorTaipan_H
50 typedef double ElementType;
54 typedef ElementType * VectorStorageType;
59 typedef const ElementType * const_pointer;
60 typedef ElementType value_type;
61 typedef long size_type;
62 typedef ElementType & reference;
63 typedef const ElementType & const_reference;
82 DataVectorTaipan(
const DataVectorTaipan& other);
102 DataVectorTaipan(
const size_type size,
103 const value_type val=0.0,
104 const size_type blockSize=1);
126 resize(
const size_type newSize,
127 const value_type newVal=0.0,
128 const size_type newBlockSize=1);
157 operator=(
const DataVectorTaipan& other);
165 operator==(
const DataVectorTaipan& other)
const;
173 operator!=(
const DataVectorTaipan& other)
const;
185 operator[](
const size_type i);
189 operator[](
const size_type i)
const;
202 VectorStorageType m_array_data;
226 ESYS_ASSERT(i<
size(),
"DataVectorTaipan: invalid index specified. " << i <<
" of " <<
size());
234 ESYS_ASSERT(i<
size(),
"DataVectorTaipan: invalid index specified. " << i <<
" of " <<
size());
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:28
DataVectorTaipan()
Default constructor for DataVectorTaipan.
Definition: DataVectorTaipan.cpp:45
DataTypes::real_t getElt() const
Definition: WrappedArray.h:87
bool operator==(const DataVectorTaipan &other) const
DataVectorTaipan equality comparison operator "==". Return true if the given DataVectorTaipan is equa...
Definition: DataVectorTaipan.cpp:156
size_type size() const
Return the number of elements in this DataVectorTaipan.
Definition: DataVectorTaipan.h:240
size_type m_N
Definition: DataVectorTaipan.h:233
size_type m_dim
Definition: DataVectorTaipan.h:232
DataVectorTaipan implements an arbitrarily long vector of data values. DataVectorTaipan is the underl...
Definition: DataVectorTaipan.h:67
Definition: WrappedArray.h:30
~DataVectorTaipan()
Default destructor for DataVectorTaipan.
Definition: DataVectorTaipan.cpp:77
size_type m_size
Definition: DataVectorTaipan.h:231
unsigned int getRank() const
Definition: WrappedArray.h:75
DataVectorTaipan & operator=(const DataVectorTaipan &other)
DataVectorTaipan assignment operator "=". Assign the given DataVectorTaipan object to this.
Definition: DataVectorTaipan.cpp:133
Definition: DataException.h:37
VectorStorageType m_array_data
Definition: DataVectorTaipan.h:237
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:65
void resize(const size_type newSize, const value_type newVal=0.0, const size_type newBlockSize=1)
Resize the DataVectorTaipan to the given length "newSize". All current data is lost....
Definition: DataVectorTaipan.cpp:92
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:89
Taipan array manager, C++ version. Based on TaipanMemManager C module by Lutz Gross.
Definition: Taipan.h:54
long size_type
Definition: DataVectorTaipan.h:96
Taipan arrayManager
Definition: DataVectorTaipan.cpp:37
void copyFromArray(const escript::WrappedArray &value, size_type copies)
Populates the vector with the data from value. This method currently throws an exception if the speci...
Definition: DataVectorTaipan.cpp:281
escript::DataTypes::DataVectorAlt< real_t > RealVectorType
Vector to store underlying data.
Definition: DataVector.h:42
void releaseUnusedMemory()
releases unused memory in the memory manager.
Definition: DataVectorTaipan.cpp:39
double * new_array(size_type dim, size_type N)
Taipan data-array allocator.
Definition: Taipan.cpp:103
bool operator!=(const DataVectorTaipan &other) const
DataVectorTaipan inequality comparison operator "!=". Return true if the given DataVectorTaipan is no...
Definition: DataVectorTaipan.cpp:178
void delete_array(double *array)
Taipan data-array deallocator.
Definition: Taipan.cpp:190
reference operator[](const size_type i)
Return a reference to the element at position i in this DataVectorTaipan. Will throw an exception if ...
Definition: DataVectorTaipan.h:247
Definition: AbstractContinuousDomain.cpp:22
const typedef ElementType & const_reference
Definition: DataVectorTaipan.h:98
vec_size_type getRelIndex(const DataTypes::ShapeType &shape, vec_size_type i)
Compute the offset (in 1D vector) of a given subscript with a shape.
Definition: DataTypes.h:256
ElementType value_type
Definition: DataVectorTaipan.h:95
ElementType & reference
Definition: DataVectorTaipan.h:97
void copyFromArrayToOffset(const escript::WrappedArray &value, size_type offset, size_type copies)
Definition: DataVectorTaipan.cpp:184
const DataTypes::ShapeType & getShape() const
Definition: WrappedArray.h:81
#define ESYS_ASSERT(a, b)
EsysAssert is a MACRO that will throw an exception if the boolean condition specified is false.
Definition: Assert.h:77
void release_unused_arrays()
frees all arrays that are currently unused.
Definition: Taipan.cpp:72