18 #if !defined escript_DataAbstract_20040315_H
19 #define escript_DataAbstract_20040315_H
25 #include <boost/scoped_ptr.hpp>
84 DataAbstract_ptr getPtr();
86 const_DataAbstract_ptr getPtr()
const;
99 DataAbstract(
const FunctionSpace& what,
const ShapeType& shape,
bool isDataEmpty=
false);
116 toString()
const = 0;
141 dump(
const std::string fileName)
const;
149 getNumDPPSample()
const;
157 getNumSamples()
const;
190 getPointOffset(
int sampleNo,
191 int dataPointNo)
const = 0;
196 getPointOffset(
int sampleNo,
197 int dataPointNo) = 0;
217 getSampleDataByTag(
int tag);
228 operandCheck(
const DataAbstract& right)
const;
236 validSamplePointNo(
int samplePointNo)
const;
244 validSampleNo(
int sampleNo)
const;
254 getFunctionSpace()
const;
289 setTaggedValue(
int tagKey,
308 copyToDataPoint(
const int sampleNo,
const int dataPointNo,
const double value);
320 copyToDataPoint(
const int sampleNo,
const int dataPointNo,
const WrappedArray& value);
333 getTagNumber(
int dpno);
366 trace(DataAbstract* ev,
int axis_offset);
377 transpose(DataAbstract* ev,
int axis_offset);
389 swapaxes(DataAbstract* ev,
int axis0,
int axis1);
408 matrixInverse(DataAbstract* out)
const;
442 reorderByReferenceIDs(
int *reference_ids);
507 return m_lazyshared || (m_owners.size()>1);
517 bool checkNoSharing()
const;
584 return ((0 <= sampleNo) && (sampleNo <
m_noSamples));
593 throw DataException(
"Error - Operations not permitted on instances of DataEmpty.");
604 throw DataException(
"Error - Operations not permitted on instances of DataEmpty.");
623 throw DataException(
"Error - Operations not permitted on instances of DataEmpty.");
634 throw DataException(
"Error - Operations not permitted on instances of DataEmpty.");
645 throw DataException(
"Error - Operations not permitted on instances of DataEmpty.");
Give a short description of what FunctionSpace does.
Definition: FunctionSpace.h:46
DataVector implements an arbitrarily long vector of data values. DataVector is the underlying data co...
Definition: DataVector.h:44
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:32
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:67
boost::shared_ptr< const DataAbstract > const_DataAbstract_ptr
Definition: DataAbstract.h:54
Definition: DataReady.h:35
bool isShared() const
Is this object owned by more than one Data object.
Definition: DataAbstract.h:505
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:39
boost::shared_ptr< const DataReady > const_DataReady_ptr
Definition: DataAbstract.h:59
int m_noDataPointsPerSample
Definition: DataAbstract.h:538
bool validSampleNo(int sampleNo) const
Return true if a valid sample number.
Definition: DataAbstract.h:582
void transpose(const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataMaths.h:394
virtual bool isTagged() const
Definition: DataAbstract.h:482
bool m_lazyshared
Definition: DataAbstract.h:563
DataTypes::ShapeType m_shape
Definition: DataAbstract.h:547
#define REFCOUNT_BASE_CLASS(x)
Definition: Pointers.h:29
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:38
void swapaxes(const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset, int axis0, int axis1)
swaps the components axis0 and axis1.
Definition: DataMaths.h:538
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:51
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:477
void eigenvalues(const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset)
solves a local eigenvalue problem
Definition: DataMaths.h:689
void symmetric(const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset)
computes a symmetric matrix from your square matrix A: (A + transpose(A)) / 2
Definition: DataMaths.h:197
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:641
bool validSamplePointNo(int samplePointNo) const
Return true if a valid sample point number.
Definition: DataAbstract.h:575
virtual bool isExpanded() const
Definition: DataAbstract.h:466
Typedefs and macros for reference counted storage.
unsigned int m_novalues
Definition: DataAbstract.h:551
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:589
int isEmpty(escriptDataC *data)
Returns the true if the data are empty or data is NULL.
Definition: DataC.cpp:117
bool m_isempty
Definition: DataAbstract.h:559
Data represents a collection of datapoints.
Definition: Data.h:71
void eigenvalues_and_eigenvectors(const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset, DataTypes::ValueType &V, const DataTypes::ShapeType &VShape, DataTypes::ValueType::size_type VOffset, const double tol=1.e-13)
solves a local eigenvalue problem
Definition: DataMaths.h:750
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:120
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:600
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:619
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:102
int m_noSamples
Definition: DataAbstract.h:533
DataException exception class.
Definition: DataException.h:35
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:64
bool isEmpty() const
Definition: DataAbstract.h:568
Definition: DataAbstract.h:61
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:612
void nonsymmetric(const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset)
computes a nonsymmetric matrix from your square matrix A: (A - transpose(A)) / 2
Definition: DataMaths.h:246
unsigned int m_rank
Definition: DataAbstract.h:555
int getRank(const DataTypes::ShapeType &shape)
Return the rank (number of dimensions) of the given shape.
Definition: DataTypes.h:167
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:56
long size_type
Definition: DataVector.h:60
Definition: WrappedArray.h:29
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:630
FunctionSpace m_functionSpace
Definition: DataAbstract.h:543
virtual bool isConstant() const
Definition: DataAbstract.h:461
int getLength(struct escriptDataC *data)
Definition: DataC.cpp:97
DataTypes::ValueType ValueType
Definition: DataAbstract.h:66
std::vector< Data * > m_owners
Definition: DataAbstract.h:562
void trace(const DataTypes::ValueType &in, const DataTypes::ShapeType &inShape, DataTypes::ValueType::size_type inOffset, DataTypes::ValueType &ev, const DataTypes::ShapeType &evShape, DataTypes::ValueType::size_type evOffset, int axis_offset)
computes the trace of a matrix
Definition: DataMaths.h:295