Go to the documentation of this file.
19 #if !defined escript_DataExpanded_20040323_H
20 #define escript_DataExpanded_20040323_H
44 class DataExpanded :
public DataReady {
66 const FunctionSpace& what);
236 dump(
const std::string fileName)
const;
270 int dataPointNo)
const;
511 int noDataPointsPerSample,
525 copy(
const DataConstant& value);
537 copy(
const WrappedArray& value);
570 copyToDataPoint(
const int sampleNo,
const int dataPointNo,
const WrappedArray& value);
static const int maxRank
The maximum number of dimensions a datapoint can have.
Definition: DataTypes.h:71
#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
virtual void trace(DataAbstract *ev, int axis_offset)
Computes the trace of a matrix.
Definition: DataExpanded.cpp:935
virtual void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataExpanded.cpp:1334
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:76
virtual void setSlice(const DataAbstract *value, const DataTypes::RegionType ®ion)
Copy the specified region from the given value.
Definition: DataExpanded.cpp:289
bool isExpanded() const
Definition: DataExpanded.h:162
void replaceNaN(DataTypes::real_t value)
replaces all NaN values with value
Definition: DataExpanded.cpp:459
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
virtual DataAbstract * deepCopy() const
Return a deep copy of the current object.
Definition: DataExpanded.cpp:264
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataConstant.cpp:871
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
int m_noDataPointsPerSample
Definition: DataAbstract.h:572
DataReady parent
Definition: DataExpanded.h:58
DataTypes::dim_t getNumSamples() const
Returns the number of samples.
Definition: FunctionSpace.h:180
void setTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
setTaggedValue
Definition: DataExpanded.cpp:1405
DataTypes::dim_t getReferenceIDOfSample(DataTypes::dim_t sampleNo) const
Returns the reference number associated with the given sample number. This function is not efficient....
Definition: FunctionSpace.h:135
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataExpanded.cpp:1525
bool checkShape(const ShapeType &s1, const ShapeType &s2)
Test if two shapes are equal.
Definition: DataTypes.h:330
DataTypes::RealVectorType m_data_r
Definition: DataExpanded.h:587
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
Definition: WrappedArray.h:31
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
virtual void replaceInf(DataTypes::real_t value)
replaces all (+/-)Inf values with value
Definition: DataExpanded.cpp:544
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:88
bool isComplex() const
Definition: WrappedArray.h:70
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
virtual void copyToDataPoint(const int sampleNo, const int dataPointNo, const DataTypes::real_t value)
Copy a double value to the data point dataPointNo of sample sampleNo in this object.
Definition: DataExpanded.cpp:712
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
void copyFromArrayToOffset(const WrappedArray &value, size_type offset, size_type copies)
Definition: DataVectorAlt.h:411
virtual DataAbstract * getSlice(const DataTypes::RegionType ®ion) const
Factory method that returns a newly created DataExpanded. The caller is reponsible for managing the o...
Definition: DataExpanded.cpp:284
virtual void setToZero()
sets all values to zero
Definition: DataExpanded.cpp:1159
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataExpanded.cpp:974
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:665
#define CHECK_FOR_EX_WRITE
Definition: DataExpanded.cpp:58
virtual void antihermitian(DataAbstract *ev)
Computes an antihermitian matrix (A - A*) / 2.
Definition: DataExpanded.cpp:906
virtual std::string toString() const
Return a textual representation of the data.
Definition: DataExpanded.cpp:593
bool actsExpanded() const
Return true if this Data is expanded or resolves to expanded. That is, if it has a separate value for...
Definition: DataExpanded.h:169
virtual void eigenvalues(DataAbstract *ev)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
Definition: DataExpanded.cpp:1051
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
Definition: DataReady.h:48
void copy(const DataConstant &value)
Copy the given data point value to all data points in this object.
Definition: DataExpanded.cpp:350
virtual int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataExpanded.cpp:1121
void complicate()
Definition: DataExpanded.cpp:640
Definition: LapackInverseHelper.h:39
unsigned int getRank() const
Definition: WrappedArray.h:76
Simulates a full dataset accessible via sampleNo and dataPointNo.
Definition: DataTagged.h:57
DataExpanded(const WrappedArray &value, const FunctionSpace &what)
Constructor for DataExpanded.
Definition: DataExpanded.cpp:63
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:624
Definition: DataException.h:39
DataAbstract(const FunctionSpace &what, const ShapeType &shape, bool isDataEmpty=false, bool isCplx=false)
Constructor for DataAbstract.
Definition: DataAbstract.cpp:75
int getNumDataPointsPerSample() const
Definition: FunctionSpace.h:189
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
index_t dim_t
Definition: DataTypes.h:90
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...
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
Return the offset for the given given data point. This returns the offset in bytes for the given poin...
Definition: DataExpanded.cpp:621
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 DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const =0
Return the offset for the given sample. This returns the offset for the given point into the containe...
int getNumDPPSample() const
Returns the number of data points per sample.
Definition: FunctionSpace.h:186
bool hasNaN() const
Return true if any value in the data contains a NaN.
Definition: DataExpanded.cpp:423
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:69
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
void copyFromArray(const WrappedArray &value, size_type copies)
Populates the vector with the data from value. This method currently throws an exception if the speci...
Definition: DataVectorAlt.h:507
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:635
virtual void antisymmetric(DataAbstract *ev)
Computes a antisymmetric matrix (A - AT) / 2.
Definition: DataExpanded.cpp:839
void copyPoint(RealVectorType &dest, vec_size_type doffset, vec_size_type nvals, const RealVectorType &src, vec_size_type soffset)
Copy a point from one vector to another. Note: This version does not check to see if shapes are the s...
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataTagged.cpp:1675
const DataTypes::CplxVectorType & getVectorROC() const
Definition: DataExpanded.cpp:1520
virtual void reorderByReferenceIDs(DataTypes::dim_t *reference_ids)
reorders data sample ordered by reference_ids to the ordering of the functions space
Definition: DataExpanded.cpp:1470
Give a short description of what DataExpanded does.
Definition: DataExpanded.h:56
virtual DataAbstract * zeroedCopy() const
Return an object with the same type, domain (and tags if appropriate) as this, but all values are zer...
Definition: DataExpanded.cpp:270
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
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
getPointOffset
Definition: DataTagged.cpp:981
bool m_iscompl
Definition: DataAbstract.h:576
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataExpanded.cpp:1531
const DataTypes::RealVectorType & getVectorRO() const
Definition: DataExpanded.cpp:1509
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
std::vector< std::pair< int, int > > RegionLoopRangeType
Definition: DataTypes.h:70
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:135
escript::DataTypes::DataVectorAlt< real_t > RealVectorType
Vector to store underlying data.
Definition: DataVector.h:43
int m_noSamples
Definition: DataAbstract.h:567
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:85
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.
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
DataTypes::RealVectorType & getVectorRW()
Return a a reference to the underlying DataVector.
Definition: DataExpanded.cpp:1503
Definition: DataAbstract.h:74
virtual void hermitian(DataAbstract *ev)
Computes an hermitian matrix (A + A*) / 2.
Definition: DataExpanded.cpp:881
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
virtual bool hasInf() const
Return true if data contains Inf or -Inf.
Definition: DataExpanded.cpp:508
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:94
DataReady(const FunctionSpace &what, const ShapeType &shape, bool isDataEmpty=false)
Definition: DataReady.cpp:35
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: DataExpanded.cpp:1090
bool isComplex() const
true if the components of datapoints are complex
Definition: DataAbstract.cpp:69
virtual DataTypes::RealVectorType::size_type getLength() const
Return the number of doubles stored for the Data.
Definition: DataExpanded.cpp:651
const DataTypes::dim_t * borrowSampleReferenceIDs() const
Returns a borrowed reference to the list of sample reference IDs.
Definition: FunctionSpace.cpp:198
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:676
virtual void swapaxes(DataAbstract *ev, int axis0, int axis1)
swaps components axis0 and axis1
Definition: DataExpanded.cpp:1012
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
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
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:79
virtual void symmetric(DataAbstract *ev)
Computes a symmetric matrix (A + AT) / 2.
Definition: DataExpanded.cpp:801
void initialise(int noSamples, int noDataPointsPerSample, bool cplx)
Common initialisation called from constructors.
Definition: DataExpanded.cpp:404
virtual ~DataExpanded()
Default destructor for DataExpanded.
Definition: DataExpanded.cpp:260
DataTypes::CplxVectorType & getVectorRWC()
Definition: DataExpanded.cpp:1514
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
DataTypes::CplxVectorType m_data_c
Definition: DataExpanded.h:588
escript::DataTypes::DataVectorAlt< cplx_t > CplxVectorType
Definition: DataVector.h:44
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