18 #if !defined escript_DataTypes_20080811_H 19 #define escript_DataTypes_20080811_H 24 #include <boost/python/object.hpp> 25 #include <boost/python/extract.hpp> 185 EsysAssert((
getRank(shape)==1),
"Incorrect number of indices for the rank of this object.");
205 EsysAssert((
getRank(shape)==2),
"Incorrect number of indices for the rank of this object.");
225 EsysAssert((
getRank(shape)==3),
"Incorrect number of indices for the rank of this object.");
246 EsysAssert((
getRank(shape)==4),
"Incorrect number of indices for the rank of this object.");
294 const ShapeType& leftShape,
296 const ValueType& other,
297 const ShapeType& otherShape,
299 const RegionLoopRangeType& region);
318 const ShapeType& leftShape,
320 const ValueType& other,
321 const ShapeType& otherShape,
323 const RegionLoopRangeType& region);
353 pointToString(
const ValueType& data,
const ShapeType& shape,
int offset,
const std::string& prefix);
DataVector implements an arbitrarily long vector of data values. DataVector is the underlying data co...
Definition: DataVector.h:44
escript::DataVector ValueType
Vector to store underlying data.
Definition: DataTypes.h:37
std::string shapeToString(const DataTypes::ShapeType &shape)
Return the given shape as a string.
Definition: DataTypes.cpp:120
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:39
Definition: AbstractContinuousDomain.cpp:24
void copyPoint(ValueType &dest, ValueType::size_type doffset, ValueType::size_type nvals, const ValueType &src, ValueType::size_type soffset)
Copy a point from one vector to another. Note: This version does not check to see if shapes are the s...
Definition: DataTypes.cpp:635
static const ShapeType scalarShape
Use this instead of creating empty shape objects for scalars.
Definition: DataTypes.h:42
bool checkShape(const ShapeType &s1, const ShapeType &s2)
Test if two shapes are equal.
Definition: DataTypes.h:258
void copySliceFrom(ValueType &left, const ShapeType &leftShape, ValueType::size_type thisOffset, const ValueType &other, const ShapeType &otherShape, ValueType::size_type otherOffset, const RegionLoopRangeType ®ion)
Copy data into a slice specified by the given region and offset in the left vector from the other vec...
Definition: DataTypes.cpp:326
DataTypes::RegionType getSliceRegion(const DataTypes::ShapeType &shape, const boost::python::object &key)
Determine the region specified by the given python slice object.
Definition: DataTypes.cpp:140
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:38
std::string createShapeErrorMessage(const std::string &messagePrefix, const DataTypes::ShapeType &other, const DataTypes::ShapeType &thisShape)
Produce a string containing two shapes.
Definition: DataTypes.cpp:209
std::vector< std::pair< int, int > > RegionLoopRangeType
Definition: DataTypes.h:40
void pointToStream(std::ostream &os, const ValueType::ElementType *data, const ShapeType &shape, int offset, bool needsep, const std::string &sep)
Display a single value (with the specified shape) from the data.
Definition: DataTypes.cpp:479
double ElementType
Definition: DataVector.h:50
DataTypes::ShapeType getResultSliceShape(const RegionType ®ion)
Determine the shape of the specified slice region.
Definition: DataTypes.cpp:176
DataTypes::RegionLoopRangeType getSliceRegionLoopRange(const DataTypes::RegionType ®ion)
Modify region to copy from in order to deal with the case where one range in the region contains iden...
Definition: DataTypes.cpp:191
DataTypes::ValueType::size_type getRelIndex(const DataTypes::ShapeType &shape, DataTypes::ValueType::size_type i)
Compute the offset (in 1D vector) of a given subscript with a shape.
Definition: DataTypes.h:183
#define EsysAssert(AssertTest, AssertMessage)
EsysAssert is a MACRO that will throw an exception if the boolean condition specified is false...
Definition: EsysAssert.h:96
std::string pointToString(const ValueType &data, const ShapeType &shape, int offset, const std::string &prefix)
Display a single value (with the specified shape) from the data.
Definition: DataTypes.cpp:569
static const int maxRank
The maximum number of dimensions a datapoint can have.
Definition: DataTypes.h:41
void copySlice(ValueType &left, const ShapeType &leftShape, ValueType::size_type thisOffset, const ValueType &other, const ShapeType &otherShape, ValueType::size_type otherOffset, const RegionLoopRangeType ®ion)
Copy a data slice specified by the given region and offset from the "other" view into the "left" view...
Definition: DataTypes.cpp:232
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:94
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:54
int getRank(const DataTypes::ShapeType &shape)
Return the rank (number of dimensions) of the given shape.
Definition: DataTypes.h:167
long size_type
Definition: DataVector.h:60