Go to the documentation of this file.
17 #ifndef __ESCRIPT_DATAABSTRACT_H__
18 #define __ESCRIPT_DATAABSTRACT_H__
25 #include <boost/scoped_ptr.hpp>
110 toString()
const = 0;
117 deepCopy()
const =0 ;
125 zeroedCopy()
const =0 ;
142 dump(
const std::string fileName)
const;
149 getNumDPPSample()
const;
156 getNumSamples()
const;
161 return getNumSamples()==0;
192 getPointOffset(
int sampleNo,
193 int dataPointNo)
const = 0;
203 getLength()
const = 0;
248 validSamplePointNo(
int samplePointNo)
const;
255 validSampleNo(
int sampleNo)
const;
264 getFunctionSpace()
const;
297 setTaggedValue(
int tagKey,
304 setTaggedValue(
int tagKey,
321 copyToDataPoint(
const int sampleNo,
const int dataPointNo,
const DataTypes::real_t value);
324 copyToDataPoint(
const int sampleNo,
const int dataPointNo,
const DataTypes::cplx_t value);
335 copyToDataPoint(
const int sampleNo,
const int dataPointNo,
const WrappedArray& value);
347 getTagNumber(
int dpno);
482 isConstant()
const {
return false;}
486 isExpanded()
const {
return false;}
496 actsExpanded()
const {
return false;}
500 isTagged()
const {
return false;}
502 bool isEmpty()
const;
507 bool isComplex()
const;
509 #ifdef SLOWSHARECHECK
520 #pragma omp critical // because two treads could try
524 shared=shared_from_this().use_count()>2;
535 bool exclusivewritecalled;
546 virtual void complicate();
559 int m_noDataPointsPerSample;
577 unsigned int m_novalues;
606 return ((0 <= sampleNo) && (sampleNo <
m_noSamples));
615 throw DataException(
"Error - Operations (getNumDPPSample) not permitted on instances of DataEmpty.");
626 throw DataException(
"Error - Operations (getNumSamples) not permitted on instances of DataEmpty.");
645 throw DataException(
"Error - Operations (getShape) not permitted on instances of DataEmpty.");
656 throw DataException(
"Error - Operations (getRank) not permitted on instances of DataEmpty.");
667 throw DataException(
"Error - Operations (getNoValues) not permitted on instances of DataEmpty.");
674 #endif // __ESCRIPT_DATAABSTRACT_H__
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:28
std::string shapeToString(const DataTypes::ShapeType &shape)
Return the given shape as a string.
Definition: DataTypes.cpp:115
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:73
virtual int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataAbstract.cpp:262
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:31
virtual void setToZero()
sets values to zero
Definition: DataAbstract.cpp:268
DataTypes::ShapeType m_shape
Definition: DataAbstract.h:584
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 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:143
int m_noDataPointsPerSample
Definition: DataAbstract.h:570
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:274
int getRank(const DataTypes::ShapeType &shape)
Return the rank (number of dimensions) of the given shape.
Definition: DataTypes.h:241
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:189
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:62
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
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:255
Definition: WrappedArray.h:30
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
bool validSampleNo(int sampleNo) const
Return true if a valid sample number.
Definition: DataAbstract.h:615
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
boost::shared_ptr< const DataReady > const_DataReady_ptr
Definition: DataAbstract.h:70
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:663
virtual void trace(DataAbstract *ev, int axis_offset)
Computes the trace of a matrix.
Definition: DataAbstract.cpp:233
#define ESCRIPT_MAX_DATA_RANK
Definition: Data.h:37
boost::shared_ptr< const DataAbstract > const_DataAbstract_ptr
Definition: DataAbstract.h:65
bool isEmpty() const
Definition: DataAbstract.h:601
Definition: FunctionSpace.h:45
virtual void swapaxes(DataAbstract *ev, int axis0, int axis1)
swaps components axis0 and axis1
Definition: DataAbstract.cpp:239
#define REFCOUNT_BASE_CLASS(x)
Definition: Pointers.h:29
bool m_isempty
Definition: DataAbstract.h:596
Typedefs and macros for reference counted storage.
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:622
Definition: DataException.h:37
virtual void antisymmetric(DataAbstract *ev)
Computes a antisymmetric matrix (A - AT) / 2.
Definition: DataAbstract.cpp:215
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
index_t dim_t
Definition: DataTypes.h:87
virtual void eigenvalues(DataAbstract *ev)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
Definition: DataAbstract.cpp:250
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:65
bool validSamplePointNo(int samplePointNo) const
Return true if a valid sample point number.
Definition: DataAbstract.h:608
virtual size_t getTagCount() const
Return number of tagged values stored in the data object.
Definition: DataAbstract.cpp:156
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:66
virtual void complicate()
Definition: DataAbstract.cpp:279
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
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:633
virtual void symmetric(DataAbstract *ev)
Computes a symmetric matrix (A + AT) / 2.
Definition: DataAbstract.cpp:209
virtual ~DataAbstract()
Destructor for DataAbstract.
Definition: DataAbstract.cpp:97
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
unsigned int m_novalues
Definition: DataAbstract.h:588
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:133
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataAbstract.cpp:244
int m_noSamples
Definition: DataAbstract.h:565
Definition: AbstractContinuousDomain.cpp:22
virtual void setTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
setTaggedValue
Definition: DataAbstract.cpp:164
Definition: DataAbstract.h:72
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:103
virtual void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataAbstract.cpp:135
std::string toString() const
Returns a text description of the function space.
Definition: FunctionSpace.cpp:116
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:674
FunctionSpace m_functionSpace
Definition: DataAbstract.h:580
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
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:67
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:77
virtual int getTagNumber(int dpno)
Return the tag number associated with the given data-point number.
Definition: DataAbstract.cpp:182
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
virtual void antihermitian(DataAbstract *ev)
Computes a antisymmetric matrix (A - A*) / 2.
Definition: DataAbstract.cpp:227
virtual void hermitian(DataAbstract *ev)
Computes a symmetric matrix (A + A*) / 2.
Definition: DataAbstract.cpp:221
unsigned int m_rank
Definition: DataAbstract.h:592
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
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:58