Go to the documentation of this file.
19 #if !defined escript_DataVectorTaipan_H
20 #define escript_DataVectorTaipan_H
51 typedef double ElementType;
55 typedef ElementType * VectorStorageType;
60 typedef const ElementType * const_pointer;
61 typedef ElementType value_type;
62 typedef long size_type;
63 typedef ElementType & reference;
64 typedef const ElementType & const_reference;
83 DataVectorTaipan(
const DataVectorTaipan& other);
103 DataVectorTaipan(
const size_type size,
104 const value_type val=0.0,
105 const size_type blockSize=1);
127 resize(
const size_type newSize,
128 const value_type newVal=0.0,
129 const size_type newBlockSize=1);
158 operator=(
const DataVectorTaipan& other);
166 operator==(
const DataVectorTaipan& other)
const;
174 operator!=(
const DataVectorTaipan& other)
const;
186 operator[](
const size_type i);
190 operator[](
const size_type i)
const;
203 VectorStorageType m_array_data;
227 ESYS_ASSERT(i<
size(),
"DataVectorTaipan: invalid index specified. " << i <<
" of " <<
size());
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:29
DataVectorTaipan()
Default constructor for DataVectorTaipan.
Definition: DataVectorTaipan.cpp:46
DataTypes::real_t getElt() const
Definition: WrappedArray.h:88
bool operator==(const DataVectorTaipan &other) const
DataVectorTaipan equality comparison operator "==". Return true if the given DataVectorTaipan is equa...
Definition: DataVectorTaipan.cpp:157
size_type size() const
Return the number of elements in this DataVectorTaipan.
Definition: DataVectorTaipan.h:243
size_type m_N
Definition: DataVectorTaipan.h:237
size_type m_dim
Definition: DataVectorTaipan.h:236
DataVectorTaipan implements an arbitrarily long vector of data values. DataVectorTaipan is the underl...
Definition: DataVectorTaipan.h:70
Definition: WrappedArray.h:31
~DataVectorTaipan()
Default destructor for DataVectorTaipan.
Definition: DataVectorTaipan.cpp:78
size_type m_size
Definition: DataVectorTaipan.h:235
unsigned int getRank() const
Definition: WrappedArray.h:76
DataVectorTaipan & operator=(const DataVectorTaipan &other)
DataVectorTaipan assignment operator "=". Assign the given DataVectorTaipan object to this.
Definition: DataVectorTaipan.cpp:134
Definition: DataException.h:39
VectorStorageType m_array_data
Definition: DataVectorTaipan.h:241
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:68
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:93
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:90
Taipan array manager, C++ version. Based on TaipanMemManager C module by Lutz Gross.
Definition: Taipan.h:56
long size_type
Definition: DataVectorTaipan.h:100
Taipan arrayManager
Definition: DataVectorTaipan.cpp:38
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:282
escript::DataTypes::DataVectorAlt< real_t > RealVectorType
Vector to store underlying data.
Definition: DataVector.h:43
void releaseUnusedMemory()
releases unused memory in the memory manager.
Definition: DataVectorTaipan.cpp:40
double * new_array(size_type dim, size_type N)
Taipan data-array allocator.
Definition: Taipan.cpp:104
bool operator!=(const DataVectorTaipan &other) const
DataVectorTaipan inequality comparison operator "!=". Return true if the given DataVectorTaipan is no...
Definition: DataVectorTaipan.cpp:179
void delete_array(double *array)
Taipan data-array deallocator.
Definition: Taipan.cpp:191
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:250
Definition: AbstractContinuousDomain.cpp:23
const typedef ElementType & const_reference
Definition: DataVectorTaipan.h:102
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:259
ElementType value_type
Definition: DataVectorTaipan.h:99
ElementType & reference
Definition: DataVectorTaipan.h:101
void copyFromArrayToOffset(const escript::WrappedArray &value, size_type offset, size_type copies)
Definition: DataVectorTaipan.cpp:185
const DataTypes::ShapeType & getShape() const
Definition: WrappedArray.h:82
#define ESYS_ASSERT(a, b)
EsysAssert is a MACRO that will throw an exception if the boolean condition specified is false.
Definition: Assert.h:78
void release_unused_arrays()
frees all arrays that are currently unused.
Definition: Taipan.cpp:73