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;
242 operandCheck(
const DataAbstract& right)
const;
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);
398 trace(DataAbstract* ev,
int axis_offset);
408 transpose(DataAbstract* ev,
int axis_offset);
419 swapaxes(DataAbstract* ev,
int axis0,
int axis1);
436 matrixInverse(DataAbstract* out)
const;
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: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:79
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:588
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:574
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:247
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:66
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:32
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:92
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
bool validSampleNo(int sampleNo) const
Return true if a valid sample number.
Definition: DataAbstract.h:619
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
boost::shared_ptr< const DataReady > const_DataReady_ptr
Definition: DataAbstract.h:74
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:667
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:69
bool isEmpty() const
Definition: DataAbstract.h:605
Definition: FunctionSpace.h:49
virtual void swapaxes(DataAbstract *ev, int axis0, int axis1)
swaps components axis0 and axis1
Definition: DataAbstract.cpp:241
#define REFCOUNT_BASE_CLASS(x)
Definition: Pointers.h:31
bool m_isempty
Definition: DataAbstract.h:600
Typedefs and macros for reference counted storage.
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:626
Definition: DataException.h:41
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:93
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:71
bool validSamplePointNo(int samplePointNo) const
Return true if a valid sample point number.
Definition: DataAbstract.h:612
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:72
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:656
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:637
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
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:592
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:139
escript::DataTypes::DataVectorAlt< real_t > RealVectorType
Vector to store underlying data.
Definition: DataVector.h:44
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:569
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
Definition: DataAbstract.h:76
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
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:678
FunctionSpace m_functionSpace
Definition: DataAbstract.h:584
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:649
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:82
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:71
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:81
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
escript::DataTypes::DataVectorAlt< cplx_t > CplxVectorType
Definition: DataVector.h:45
unsigned int m_rank
Definition: DataAbstract.h:596
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:62