Go to the documentation of this file.
19 #ifndef __ESCRIPT_DATATAGGED_H__
20 #define __ESCRIPT_DATATAGGED_H__
47 typedef DataReady parent;
52 typedef std::vector<int> TagListType;
53 typedef std::vector<DataTypes::RealVectorType::ElementType> FloatBatchType;
54 typedef std::vector<DataTypes::CplxVectorType::ElementType> CplxBatchType;
253 dump(
const std::string fileName)
const;
279 getTagNumber(
int dpno);
295 getPointOffset(
int sampleNo,
296 int dataPointNo)
const;
358 addTaggedValue(
int tagKey,
364 addTaggedValue(
int tagKey,
396 setTaggedValue(
int tagKey,
402 setTaggedValue(
int tagKey,
441 getOffsetForTag(
int tag)
const;
460 getVectorROC()
const;
488 getTagLookup()
const;
502 isCurrentTag(
int tag)
const;
684 getDefaultOffset()
const;
705 static const int m_defaultValueOffset = 0;
776 #endif // __ESCRIPT_DATATAGGED_H__
static const int maxRank
The maximum number of dimensions a datapoint can have.
Definition: DataTypes.h:71
virtual DataTypes::RealVectorType::size_type getLength() const
getLength
Definition: DataTagged.h:781
#define CHECK_FOR_EX_WRITE
Definition: DataTagged.cpp:39
int MPI_Status
Definition: EsysMPI.h:44
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:29
int getTagFromSampleNo(DataTypes::dim_t sampleNo) const
Returns the tag associated with the given sample number.
Definition: FunctionSpace.cpp:143
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:76
const DataMapType & getTagLookup() const
getTagLookup
Definition: DataTagged.h:774
virtual void swapaxes(DataAbstract *ev, int axis0, int axis1)
swaps components axis0 and axis1
Definition: DataTagged.cpp:1247
void addTag(int tagKey)
addTag - does not modify the default value for this object. ** Not unit tested **
Definition: DataTagged.cpp:684
virtual void setToZero()
sets all values to zero
Definition: DataTagged.cpp:1390
void copySlice(VEC &left, const ShapeType &leftShape, typename VEC::size_type leftOffset, const VEC &other, const ShapeType &otherShape, typename VEC::size_type otherOffset, const RegionLoopRangeType ®ion)
Copy a data slice specified by the given region and offset from the "other" vector into the "left" ve...
Definition: DataVector.h:173
void complicate()
Definition: DataTagged.cpp:1700
virtual void eigenvalues(DataAbstract *ev)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
Definition: DataTagged.cpp:1282
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataConstant.cpp:871
DataTypes::RealVectorType::reference getDataByTagRW(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDataByTag
Definition: DataTagged.cpp:1016
DataTypes::RealVectorType & getVectorRW()
Return a reference to the underlying DataVector.
Definition: DataTagged.cpp:1642
void antihermitian(const DataTypes::CplxVectorType &in, const DataTypes::ShapeType &inShape, typename DataTypes::CplxVectorType::size_type inOffset, DataTypes::CplxVectorType &ev, const DataTypes::ShapeType &evShape, typename DataTypes::CplxVectorType::size_type evOffset)
computes a antihermitian matrix from your square matrix A: (A - adjoint(A)) / 2
Definition: DataVectorOps.cpp:962
virtual void trace(DataAbstract *ev, int axis_offset)
Computes the trace of a matrix.
Definition: DataTagged.cpp:1177
DataTypes::RealVectorType::size_type getDefaultOffset() const
Returns the offset in the structure which stores the default value.
Definition: DataTagged.h:736
const typedef ElementType & const_reference
Definition: DataVectorAlt.h:90
bool checkShape(const ShapeType &s1, const ShapeType &s2)
Test if two shapes are equal.
Definition: DataTypes.h:330
DataConstant stores a single data point which represents the entire function space.
Definition: DataConstant.h:50
void eigenvalues(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, typename DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &ev, const DataTypes::ShapeType &evShape, typename DataTypes::RealVectorType::size_type evOffset)
solves a local eigenvalue problem
Definition: DataVectorOps.h:638
DataTypes::RealVectorType::reference getDefaultValueRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDefaultValue
Definition: DataTagged.h:743
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...
Definition: DataVectorAlt.h:316
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:88
void symmetric(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset)
computes a symmetric matrix from your square matrix A: (A + transpose(A)) / 2
Definition: DataVectorOps.h:102
static const int m_defaultValueOffset
Definition: DataTagged.h:717
void transpose(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataVectorOps.h:342
DataTypes::RealVectorType::const_reference getDataByTagRO(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.cpp:1005
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:665
DataTypes::CplxVectorType m_data_c
Definition: DataTagged.h:721
Definition: FunctionSpace.h:47
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:187
bool canTag() const
Returns true if this function space support tags.
Definition: FunctionSpace.cpp:352
const DataTypes::RealVectorType & getVectorRO() const
Definition: DataTagged.cpp:1649
std::map< int, int > DataMapType
Definition: DataTagged.h:70
#define MPI_INT
Definition: EsysMPI.h:45
virtual bool hasInf() const
Return true if data contains Inf or -Inf.
Definition: DataTagged.cpp:842
Definition: LapackInverseHelper.h:39
Simulates a full dataset accessible via sampleNo and dataPointNo.
Definition: DataTagged.h:57
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:624
#define MPI_COMM_WORLD
Definition: EsysMPI.h:47
Definition: DataException.h:39
void hermitian(const DataTypes::CplxVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::CplxVectorType::size_type inOffset, DataTypes::CplxVectorType &ev, const DataTypes::ShapeType &evShape, DataTypes::CplxVectorType::size_type evOffset)
computes an hermitian matrix from your square matrix A: (A + adjoint(A)) / 2
Definition: DataVectorOps.cpp:915
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:68
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
Contains the types to represent Shapes, Regions, RegionLoop ranges and vectors of data as well as the...
Definition: DataTypes.cpp:86
void fillComplexFromReal(const RealVectorType &r, CplxVectorType &c)
copy data from a real vector to a complex vector The complex vector will be resized as needed and any...
void copySliceFrom(VEC &left, const ShapeType &leftShape, typename VEC::size_type leftOffset, const VEC &other, const ShapeType &otherShape, typename VEC::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: DataVector.h:280
virtual void setSlice(const DataAbstract *other, const DataTypes::RegionType ®ion)
setSlice
Definition: DataTagged.cpp:392
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataTagged.cpp:1212
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:69
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:90
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:654
DataTypes::ShapeType getResultSliceShape(const RegionType ®ion)
Determine the shape of the specified slice region.
Definition: DataTypes.cpp:172
DataTypes::CplxVectorType & getVectorRWC()
Definition: DataTagged.cpp:1655
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:635
void setTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
setTaggedValue
Definition: DataTagged.cpp:496
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataTagged.cpp:1668
DataTypes::RealVectorType m_data_r
Definition: DataTagged.h:720
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataTagged.cpp:1675
virtual DataAbstract * deepCopy() const
Return a deep copy of the current object.
Definition: DataTagged.cpp:305
void addTaggedValues(const TagListType &tagKeys, const FloatBatchType &values, const ShapeType &vShape)
addTaggedValues
Definition: DataTagged.cpp:553
int matrix_inverse(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &out, const DataTypes::ShapeType &outShape, DataTypes::RealVectorType::size_type outOffset, int count, LapackInverseHelper &helper)
computes the inverses of square (up to 3x3) matricies
Definition: DataVectorOps.cpp:206
size_t getTagCount() const
Return the number of tags which have been given values (+the default)
Definition: DataTagged.cpp:1694
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
getPointOffset
Definition: DataTagged.cpp:981
virtual DataAbstract * zeroedCopy() const
Return an object with the same type, domain (and tags if appropriate) as this, but all values are zer...
Definition: DataTagged.cpp:312
bool m_iscompl
Definition: DataAbstract.h:576
virtual int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataTagged.cpp:1356
virtual void antihermitian(DataAbstract *ev)
Computes an antihermitian matrix (A - A*) / 2.
Definition: DataTagged.cpp:1151
void swapaxes(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis0, int axis1)
swaps the components axis0 and axis1.
Definition: DataVectorOps.h:487
virtual void antisymmetric(DataAbstract *ev)
Computes a antisymmetric matrix (A - AT) / 2.
Definition: DataTagged.cpp:1088
std::vector< std::pair< int, int > > RegionLoopRangeType
Definition: DataTypes.h:70
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:135
virtual DataAbstract * getSlice(const DataTypes::RegionType ®ion) const
getSlice
Definition: DataTagged.cpp:333
DataTypes::RealVectorType::const_reference getDefaultValueRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.h:750
const int * borrowListOfTagsInUse() const
Definition: FunctionSpace.cpp:329
const DataTypes::CplxVectorType & getVectorROC() const
Definition: DataTagged.cpp:1662
virtual void replaceInf(DataTypes::real_t value)
replaces all (+/-)Inf values with value
Definition: DataTagged.cpp:877
Definition: AbstractContinuousDomain.cpp:23
size_type size() const
Return the number of elements in this DataVectorAlt.
Definition: DataVectorAlt.h:240
std::string pointToString(const RealVectorType &data, const ShapeType &shape, int offset, const std::string &prefix)
Display a single value (with the specified shape) from the data.
Definition: DataAbstract.h:74
virtual void symmetric(DataAbstract *ev)
Computes a symmetric matrix (A + AT) / 2.
Definition: DataTagged.cpp:1051
DataTypes::RealVectorType::size_type getOffsetForTag(int tag) const
getOffsetForTag
Definition: DataTagged.cpp:994
bool isCurrentTag(int tag) const
isCurrentTag
Definition: DataTagged.h:728
Describes binary operations performed on DataVector.
std::string createShapeErrorMessage(const std::string &messagePrefix, const DataTypes::ShapeType &other, const DataTypes::ShapeType &thisShape)
Produce a string containing two shapes.
Definition: DataTypes.cpp:205
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:94
DataMapType m_offsetLookup
Definition: DataTagged.h:713
virtual void eigenvalues_and_eigenvectors(DataAbstract *ev, DataAbstract *V, const double tol=1.e-13)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev and eigenvectors V
Definition: DataTagged.cpp:1318
bool isComplex() const
true if the components of datapoints are complex
Definition: DataAbstract.cpp:69
void addTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
addTaggedValue
Definition: DataTagged.cpp:607
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:676
ElementType & reference
Definition: DataVectorAlt.h:89
std::vector< DataTypes::RealVectorType::ElementType > FloatBatchType
Definition: DataTagged.h:65
void antisymmetric(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset)
computes a antisymmetric matrix from your square matrix A: (A - transpose(A)) / 2
Definition: DataVectorOps.h:151
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:647
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:79
virtual int getTagNumber(int dpno)
Return the tag number associated with the given data-point number according to the associated functio...
Definition: DataTagged.cpp:466
virtual DataTypes::real_t * getSampleDataByTag(int tag, DataTypes::real_t dummy=0)
getSampleDataByTag
Definition: DataTagged.cpp:730
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:79
virtual std::string toString() const
Write the data as a string. Writes out each tag, including the default, and the data-point which is a...
Definition: DataTagged.cpp:927
virtual void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataTagged.cpp:1546
void trace(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis_offset)
computes the trace of a matrix
Definition: DataVectorOps.h:241
DataTagged(const FunctionSpace &what, const DataTypes::ShapeType &shape, const int tags[], const DataTypes::RealVectorType &data)
Alternative Constructor for DataTagged.
Definition: DataTagged.cpp:50
virtual void hermitian(DataAbstract *ev)
Computes an hermitian matrix (A + A*) / 2.
Definition: DataTagged.cpp:1123
int getNumberOfTagsInUse() const
Returns the number of tags in use.
Definition: FunctionSpace.cpp:324
std::vector< int > TagListType
Definition: DataTagged.h:64
bool hasNaN() const
Return true if any one of the datapoints contains a NaN.
Definition: DataTagged.cpp:759
void replaceNaN(DataTypes::real_t value)
replaces all NaN values with value
Definition: DataTagged.cpp:794
void eigenvalues_and_eigenvectors(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &ev, const DataTypes::ShapeType &evShape, DataTypes::RealVectorType::size_type evOffset, DataTypes::RealVectorType &V, const DataTypes::ShapeType &VShape, DataTypes::RealVectorType::size_type VOffset, const double tol=1.e-13)
solves a local eigenvalue problem
Definition: DataVectorOps.h:749