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
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.");
Typedefs and macros for reference counted storage.
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:33
#define REFCOUNT_BASE_CLASS(x)
Definition: Pointers.h:31
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:121
Definition: DataAbstract.h:63
bool isEmpty() const
Definition: DataAbstract.h:591
virtual DataAbstract * deepCopy() const =0
Return a deep copy of the current object.
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:612
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:664
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:642
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
int m_noSamples
Definition: DataAbstract.h:555
virtual bool isConstant() const
Definition: DataAbstract.h:483
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...
bool hasNoSamples() const
Definition: DataAbstract.h:160
FunctionSpace m_functionSpace
Definition: DataAbstract.h:570
bool m_iscompl
Definition: DataAbstract.h:564
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:623
virtual DataReady_ptr resolve()=0
Return a data object with all points resolved.
virtual DataAbstract * zeroedCopy() const =0
Return an object with the same type, domain (and tags if appropriate) as this, but all values are zer...
bool m_isempty
Definition: DataAbstract.h:586
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:653
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:67
bool validSamplePointNo(int samplePointNo) const
Return true if a valid sample point number.
Definition: DataAbstract.h:598
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:635
unsigned int m_rank
Definition: DataAbstract.h:582
virtual std::string toString() const =0
Write the data as a string.
virtual bool isTagged() const
Definition: DataAbstract.h:501
virtual DataTypes::RealVectorType::size_type getLength() const =0
Return the number of doubles stored for this Data object.
unsigned int m_novalues
Definition: DataAbstract.h:578
DataTypes::ShapeType m_shape
Definition: DataAbstract.h:574
int m_noDataPointsPerSample
Definition: DataAbstract.h:560
bool validSampleNo(int sampleNo) const
Return true if a valid sample number.
Definition: DataAbstract.h:605
virtual DataAbstract * getSlice(const DataTypes::RegionType ®ion) const =0
Return the given slice from this object.
virtual bool isExpanded() const
Definition: DataAbstract.h:487
Definition: DataException.h:28
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:49
Definition: DataReady.h:37
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:50
Definition: FunctionSpace.h:36
Definition: WrappedArray.h:33
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:55
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:45
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:52
int getRank(const DataTypes::ShapeType &shape)
Return the rank (number of dimensions) of the given shape.
Definition: DataTypes.h:225
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:44
index_t dim_t
Definition: DataTypes.h:66
Definition: AbstractContinuousDomain.cpp:23
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
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
boost::shared_ptr< const DataReady > const_DataReady_ptr
Definition: DataAbstract.h:60
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
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:52
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
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 DataAbstract > const_DataAbstract_ptr
Definition: DataAbstract.h:55
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
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
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
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
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:57