Go to the documentation of this file.
18 #ifndef __ESCRIPT_DATAABSTRACT_H__
19 #define __ESCRIPT_DATAABSTRACT_H__
26 #include <boost/scoped_ptr.hpp>
143 dump(
const std::string fileName)
const;
150 getNumDPPSample()
const;
157 getNumSamples()
const;
162 return getNumSamples()==0;
194 int dataPointNo)
const = 0;
249 validSamplePointNo(
int samplePointNo)
const;
256 validSampleNo(
int sampleNo)
const;
265 getFunctionSpace()
const;
298 setTaggedValue(
int tagKey,
305 setTaggedValue(
int tagKey,
322 copyToDataPoint(
const int sampleNo,
const int dataPointNo,
const DataTypes::real_t value);
325 copyToDataPoint(
const int sampleNo,
const int dataPointNo,
const DataTypes::cplx_t value);
336 copyToDataPoint(
const int sampleNo,
const int dataPointNo,
const WrappedArray& value);
348 getTagNumber(
int dpno);
503 bool isEmpty()
const;
508 bool isComplex()
const;
510 #ifdef SLOWSHARECHECK
521 #pragma omp critical // because two treads could try
525 shared=shared_from_this().use_count()>2;
536 bool exclusivewritecalled;
547 virtual void complicate();
607 return ((0 <= sampleNo) && (sampleNo <
m_noSamples));
616 throw DataException(
"Error - Operations (getNumDPPSample) not permitted on instances of DataEmpty.");
627 throw DataException(
"Error - Operations (getNumSamples) not permitted on instances of DataEmpty.");
646 throw DataException(
"Error - Operations (getShape) not permitted on instances of DataEmpty.");
657 throw DataException(
"Error - Operations (getRank) not permitted on instances of DataEmpty.");
668 throw DataException(
"Error - Operations (getNoValues) not permitted on instances of DataEmpty.");
675 #endif // __ESCRIPT_DATAABSTRACT_H__
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
std::string shapeToString(const DataTypes::ShapeType &shape)
Return the given shape as a string.
Definition: DataTypes.cpp:117
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:52
virtual DataReady_ptr resolve()=0
Return a data object with all points resolved.
virtual int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataAbstract.cpp:264
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:33
virtual void setToZero()
sets values to zero
Definition: DataAbstract.cpp:270
DataTypes::ShapeType m_shape
Definition: DataAbstract.h:574
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:963
virtual DataTypes::real_t * getSampleDataByTag(int tag, DataTypes::real_t dummy=0)
Return the real sample data for the given tag key. NB: If the data isn't tagged an exception will be ...
Definition: DataAbstract.cpp:145
int m_noDataPointsPerSample
Definition: DataAbstract.h:560
virtual void reorderByReferenceIDs(DataTypes::dim_t *reference_ids)
reorders data sample ordered by reference_ids to the ordering of the functions space
Definition: DataAbstract.cpp:276
int getRank(const DataTypes::ShapeType &shape)
Return the rank (number of dimensions) of the given shape.
Definition: DataTypes.h:225
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: DataAbstract.cpp:191
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:52
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:639
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: DataAbstract.cpp:257
Definition: WrappedArray.h:33
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:50
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:103
virtual bool actsExpanded() const
Return true if this Data is expanded or resolves to expanded. That is, if it has a separate value for...
Definition: DataAbstract.h:497
bool validSampleNo(int sampleNo) const
Return true if a valid sample number.
Definition: DataAbstract.h:605
bool hasNoSamples() const
Definition: DataAbstract.h:160
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:343
virtual DataAbstract * zeroedCopy() const =0
Return an object with the same type, domain (and tags if appropriate) as this, but all values are zer...
boost::shared_ptr< const DataReady > const_DataReady_ptr
Definition: DataAbstract.h:60
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:653
virtual void trace(DataAbstract *ev, int axis_offset)
Computes the trace of a matrix.
Definition: DataAbstract.cpp:235
#define ESCRIPT_MAX_DATA_RANK
Definition: Data.h:39
boost::shared_ptr< const DataAbstract > const_DataAbstract_ptr
Definition: DataAbstract.h:55
bool isEmpty() const
Definition: DataAbstract.h:591
Definition: FunctionSpace.h:36
virtual bool isExpanded() const
Definition: DataAbstract.h:487
virtual std::string toString() const =0
Write the data as a string.
virtual void swapaxes(DataAbstract *ev, int axis0, int axis1)
swaps components axis0 and axis1
Definition: DataAbstract.cpp:241
Definition: DataReady.h:37
#define REFCOUNT_BASE_CLASS(x)
Definition: Pointers.h:31
bool m_isempty
Definition: DataAbstract.h:586
Typedefs and macros for reference counted storage.
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:612
Definition: DataException.h:28
virtual void antisymmetric(DataAbstract *ev)
Computes a antisymmetric matrix (A - AT) / 2.
Definition: DataAbstract.cpp:217
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:916
index_t dim_t
Definition: DataTypes.h:66
virtual void eigenvalues(DataAbstract *ev)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
Definition: DataAbstract.cpp:252
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:44
bool validSamplePointNo(int samplePointNo) const
Return true if a valid sample point number.
Definition: DataAbstract.h:598
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...
virtual size_t getTagCount() const
Return number of tagged values stored in the data object.
Definition: DataAbstract.cpp:158
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:45
virtual void complicate()
Definition: DataAbstract.cpp:281
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:91
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:642
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:623
virtual void symmetric(DataAbstract *ev)
Computes a symmetric matrix (A + AT) / 2.
Definition: DataAbstract.cpp:211
virtual ~DataAbstract()
Destructor for DataAbstract.
Definition: DataAbstract.cpp:99
bool m_iscompl
Definition: DataAbstract.h:564
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:488
unsigned int m_novalues
Definition: DataAbstract.h:578
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:121
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataAbstract.cpp:246
int m_noSamples
Definition: DataAbstract.h:555
Definition: AbstractContinuousDomain.cpp:23
virtual void setTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
setTaggedValue
Definition: DataAbstract.cpp:166
virtual bool isTagged() const
Definition: DataAbstract.h:501
virtual bool isConstant() const
Definition: DataAbstract.h:483
Definition: DataAbstract.h:63
void operandCheck(const DataAbstract &right) const
Check this and the given RHS operands are compatible. Throws an exception if they aren't.
Definition: DataAbstract.cpp:105
virtual void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataAbstract.cpp:137
std::string toString() const
Returns a text description of the function space.
Definition: FunctionSpace.cpp:118
virtual DataAbstract * deepCopy() const =0
Return a deep copy of the current object.
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:664
virtual DataTypes::RealVectorType::size_type getLength() const =0
Return the number of doubles stored for this Data object.
FunctionSpace m_functionSpace
Definition: DataAbstract.h:570
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:152
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:635
virtual DataAbstract * getSlice(const DataTypes::RegionType ®ion) const =0
Return the given slice from this object.
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:55
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:57
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:67
virtual int getTagNumber(int dpno)
Return the tag number associated with the given data-point number.
Definition: DataAbstract.cpp:184
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:242
virtual void antihermitian(DataAbstract *ev)
Computes a antisymmetric matrix (A - A*) / 2.
Definition: DataAbstract.cpp:229
virtual void hermitian(DataAbstract *ev)
Computes a symmetric matrix (A + A*) / 2.
Definition: DataAbstract.cpp:223
unsigned int m_rank
Definition: DataAbstract.h:582
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:750
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:49