Go to the documentation of this file.
18 #ifndef __ESCRIPT_DATAABSTRACT_H__
19 #define __ESCRIPT_DATAABSTRACT_H__
26 #include <boost/scoped_ptr.hpp>
111 toString()
const = 0;
118 deepCopy()
const =0 ;
126 zeroedCopy()
const =0 ;
143 dump(
const std::string fileName)
const;
150 getNumDPPSample()
const;
157 getNumSamples()
const;
162 return getNumSamples()==0;
193 getPointOffset(
int sampleNo,
194 int dataPointNo)
const = 0;
204 getLength()
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);
483 isConstant()
const {
return false;}
487 isExpanded()
const {
return false;}
497 actsExpanded()
const {
return false;}
501 isTagged()
const {
return false;}
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();
560 int m_noDataPointsPerSample;
578 unsigned int m_novalues;
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:29
std::string shapeToString(const DataTypes::ShapeType &shape)
Return the given shape as a string.
Definition: DataTypes.cpp:116
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:76
virtual int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataAbstract.cpp:263
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:32
virtual void setToZero()
sets values to zero
Definition: DataAbstract.cpp:269
DataTypes::ShapeType m_shape
Definition: DataAbstract.h:586
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 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:144
int m_noDataPointsPerSample
Definition: DataAbstract.h:572
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:275
int getRank(const DataTypes::ShapeType &shape)
Return the rank (number of dimensions) of the given shape.
Definition: DataTypes.h:244
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:190
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:64
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
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:256
Definition: WrappedArray.h:31
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
bool validSampleNo(int sampleNo) const
Return true if a valid sample number.
Definition: DataAbstract.h:617
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
boost::shared_ptr< const DataReady > const_DataReady_ptr
Definition: DataAbstract.h:72
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:665
virtual void trace(DataAbstract *ev, int axis_offset)
Computes the trace of a matrix.
Definition: DataAbstract.cpp:234
#define ESCRIPT_MAX_DATA_RANK
Definition: Data.h:38
boost::shared_ptr< const DataAbstract > const_DataAbstract_ptr
Definition: DataAbstract.h:67
bool isEmpty() const
Definition: DataAbstract.h:603
Definition: FunctionSpace.h:47
virtual void swapaxes(DataAbstract *ev, int axis0, int axis1)
swaps components axis0 and axis1
Definition: DataAbstract.cpp:240
#define REFCOUNT_BASE_CLASS(x)
Definition: Pointers.h:30
bool m_isempty
Definition: DataAbstract.h:598
Typedefs and macros for reference counted storage.
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:624
Definition: DataException.h:39
virtual void antisymmetric(DataAbstract *ev)
Computes a antisymmetric matrix (A - AT) / 2.
Definition: DataAbstract.cpp:216
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
virtual void eigenvalues(DataAbstract *ev)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
Definition: DataAbstract.cpp:251
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:68
bool validSamplePointNo(int samplePointNo) const
Return true if a valid sample point number.
Definition: DataAbstract.h:610
virtual size_t getTagCount() const
Return number of tagged values stored in the data object.
Definition: DataAbstract.cpp:157
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:69
virtual void complicate()
Definition: DataAbstract.cpp:280
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
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:635
virtual void symmetric(DataAbstract *ev)
Computes a symmetric matrix (A + AT) / 2.
Definition: DataAbstract.cpp:210
virtual ~DataAbstract()
Destructor for DataAbstract.
Definition: DataAbstract.cpp:98
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
unsigned int m_novalues
Definition: DataAbstract.h:590
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:135
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataAbstract.cpp:245
int m_noSamples
Definition: DataAbstract.h:567
Definition: AbstractContinuousDomain.cpp:23
virtual void setTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
setTaggedValue
Definition: DataAbstract.cpp:165
Definition: DataAbstract.h:74
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:104
virtual void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataAbstract.cpp:136
std::string toString() const
Returns a text description of the function space.
Definition: FunctionSpace.cpp:117
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:676
FunctionSpace m_functionSpace
Definition: DataAbstract.h:582
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
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:69
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:79
virtual int getTagNumber(int dpno)
Return the tag number associated with the given data-point number.
Definition: DataAbstract.cpp:183
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
virtual void antihermitian(DataAbstract *ev)
Computes a antisymmetric matrix (A - A*) / 2.
Definition: DataAbstract.cpp:228
virtual void hermitian(DataAbstract *ev)
Computes a symmetric matrix (A + A*) / 2.
Definition: DataAbstract.cpp:222
unsigned int m_rank
Definition: DataAbstract.h:594
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
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:60