Go to the documentation of this file.
18 #ifndef __ESCRIPT_DATATAGGED_H__
19 #define __ESCRIPT_DATATAGGED_H__
46 typedef DataReady parent;
51 typedef std::vector<int> TagListType;
52 typedef std::vector<DataTypes::RealVectorType::ElementType> FloatBatchType;
53 typedef std::vector<DataTypes::CplxVectorType::ElementType> CplxBatchType;
252 dump(
const std::string fileName)
const;
278 getTagNumber(
int dpno);
294 getPointOffset(
int sampleNo,
295 int dataPointNo)
const;
357 addTaggedValue(
int tagKey,
363 addTaggedValue(
int tagKey,
395 setTaggedValue(
int tagKey,
401 setTaggedValue(
int tagKey,
440 getOffsetForTag(
int tag)
const;
459 getVectorROC()
const;
487 getTagLookup()
const;
501 isCurrentTag(
int tag)
const;
683 getDefaultOffset()
const;
704 static const int m_defaultValueOffset = 0;
775 #endif // __ESCRIPT_DATATAGGED_H__
static const int maxRank
The maximum number of dimensions a datapoint can have.
Definition: DataTypes.h:68
virtual DataTypes::RealVectorType::size_type getLength() const
getLength
Definition: DataTagged.h:779
#define CHECK_FOR_EX_WRITE
Definition: DataTagged.cpp:38
int MPI_Status
Definition: EsysMPI.h:43
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:28
int getTagFromSampleNo(DataTypes::dim_t sampleNo) const
Returns the tag associated with the given sample number.
Definition: FunctionSpace.cpp:142
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:73
const DataMapType & getTagLookup() const
getTagLookup
Definition: DataTagged.h:772
virtual void swapaxes(DataAbstract *ev, int axis0, int axis1)
swaps components axis0 and axis1
Definition: DataTagged.cpp:1246
void addTag(int tagKey)
addTag - does not modify the default value for this object. ** Not unit tested **
Definition: DataTagged.cpp:683
virtual void setToZero()
sets all values to zero
Definition: DataTagged.cpp:1389
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:172
void complicate()
Definition: DataTagged.cpp:1699
virtual void eigenvalues(DataAbstract *ev)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
Definition: DataTagged.cpp:1281
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataConstant.cpp:870
DataTypes::RealVectorType::reference getDataByTagRW(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDataByTag
Definition: DataTagged.cpp:1015
DataTypes::RealVectorType & getVectorRW()
Return a reference to the underlying DataVector.
Definition: DataTagged.cpp:1641
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:961
virtual void trace(DataAbstract *ev, int axis_offset)
Computes the trace of a matrix.
Definition: DataTagged.cpp:1176
DataTypes::RealVectorType::size_type getDefaultOffset() const
Returns the offset in the structure which stores the default value.
Definition: DataTagged.h:734
const typedef ElementType & const_reference
Definition: DataVectorAlt.h:86
bool checkShape(const ShapeType &s1, const ShapeType &s2)
Test if two shapes are equal.
Definition: DataTypes.h:327
DataConstant stores a single data point which represents the entire function space.
Definition: DataConstant.h:48
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:637
DataTypes::RealVectorType::reference getDefaultValueRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDefaultValue
Definition: DataTagged.h:741
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:313
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:84
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:101
static const int m_defaultValueOffset
Definition: DataTagged.h:715
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:341
DataTypes::RealVectorType::const_reference getDataByTagRO(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.cpp:1004
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:663
DataTypes::CplxVectorType m_data_c
Definition: DataTagged.h:719
Definition: FunctionSpace.h:45
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:186
bool canTag() const
Returns true if this function space support tags.
Definition: FunctionSpace.cpp:303
const DataTypes::RealVectorType & getVectorRO() const
Definition: DataTagged.cpp:1648
std::map< int, int > DataMapType
Definition: DataTagged.h:68
#define MPI_INT
Definition: EsysMPI.h:44
virtual bool hasInf() const
Return true if data contains Inf or -Inf.
Definition: DataTagged.cpp:841
Definition: LapackInverseHelper.h:37
Simulates a full dataset accessible via sampleNo and dataPointNo.
Definition: DataTagged.h:55
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:622
#define MPI_COMM_WORLD
Definition: EsysMPI.h:46
Definition: DataException.h:37
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:914
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:65
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:70
Contains the types to represent Shapes, Regions, RegionLoop ranges and vectors of data as well as the...
Definition: DataTypes.cpp:85
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:279
virtual void setSlice(const DataAbstract *other, const DataTypes::RegionType ®ion)
setSlice
Definition: DataTagged.cpp:391
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataTagged.cpp:1211
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:66
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:89
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:652
DataTypes::ShapeType getResultSliceShape(const RegionType ®ion)
Determine the shape of the specified slice region.
Definition: DataTypes.cpp:171
DataTypes::CplxVectorType & getVectorRWC()
Definition: DataTagged.cpp:1654
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:633
void setTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
setTaggedValue
Definition: DataTagged.cpp:495
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:1667
DataTypes::RealVectorType m_data_r
Definition: DataTagged.h:718
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataTagged.cpp:1674
virtual DataAbstract * deepCopy() const
Return a deep copy of the current object.
Definition: DataTagged.cpp:304
void addTaggedValues(const TagListType &tagKeys, const FloatBatchType &values, const ShapeType &vShape)
addTaggedValues
Definition: DataTagged.cpp:552
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:205
size_t getTagCount() const
Return the number of tags which have been given values (+the default)
Definition: DataTagged.cpp:1693
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
getPointOffset
Definition: DataTagged.cpp:980
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:311
bool m_iscompl
Definition: DataAbstract.h:574
virtual int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataTagged.cpp:1355
virtual void antihermitian(DataAbstract *ev)
Computes an antihermitian matrix (A - A*) / 2.
Definition: DataTagged.cpp:1150
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:486
virtual void antisymmetric(DataAbstract *ev)
Computes a antisymmetric matrix (A - AT) / 2.
Definition: DataTagged.cpp:1087
std::vector< std::pair< int, int > > RegionLoopRangeType
Definition: DataTypes.h:67
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:133
virtual DataAbstract * getSlice(const DataTypes::RegionType ®ion) const
getSlice
Definition: DataTagged.cpp:332
DataTypes::RealVectorType::const_reference getDefaultValueRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.h:748
const int * borrowListOfTagsInUse() const
Definition: FunctionSpace.cpp:280
const DataTypes::CplxVectorType & getVectorROC() const
Definition: DataTagged.cpp:1661
virtual void replaceInf(DataTypes::real_t value)
replaces all (+/-)Inf values with value
Definition: DataTagged.cpp:876
Definition: AbstractContinuousDomain.cpp:22
size_type size() const
Return the number of elements in this DataVectorAlt.
Definition: DataVectorAlt.h:237
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:72
virtual void symmetric(DataAbstract *ev)
Computes a symmetric matrix (A + AT) / 2.
Definition: DataTagged.cpp:1050
DataTypes::RealVectorType::size_type getOffsetForTag(int tag) const
getOffsetForTag
Definition: DataTagged.cpp:993
bool isCurrentTag(int tag) const
isCurrentTag
Definition: DataTagged.h:726
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:204
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:93
DataMapType m_offsetLookup
Definition: DataTagged.h:711
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:1317
bool isComplex() const
true if the components of datapoints are complex
Definition: DataAbstract.cpp:68
void addTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
addTaggedValue
Definition: DataTagged.cpp:606
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:674
ElementType & reference
Definition: DataVectorAlt.h:85
std::vector< DataTypes::RealVectorType::ElementType > FloatBatchType
Definition: DataTagged.h:63
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:150
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:645
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:76
virtual int getTagNumber(int dpno)
Return the tag number associated with the given data-point number according to the associated functio...
Definition: DataTagged.cpp:465
virtual DataTypes::real_t * getSampleDataByTag(int tag, DataTypes::real_t dummy=0)
getSampleDataByTag
Definition: DataTagged.cpp:729
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:77
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:926
virtual void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataTagged.cpp:1545
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:240
DataTagged(const FunctionSpace &what, const DataTypes::ShapeType &shape, const int tags[], const DataTypes::RealVectorType &data)
Alternative Constructor for DataTagged.
Definition: DataTagged.cpp:49
virtual void hermitian(DataAbstract *ev)
Computes an hermitian matrix (A + A*) / 2.
Definition: DataTagged.cpp:1122
int getNumberOfTagsInUse() const
Returns the number of tags in use.
Definition: FunctionSpace.cpp:275
std::vector< int > TagListType
Definition: DataTagged.h:62
bool hasNaN() const
Return true if any one of the datapoints contains a NaN.
Definition: DataTagged.cpp:758
void replaceNaN(DataTypes::real_t value)
replaces all NaN values with value
Definition: DataTagged.cpp:793
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:748