Go to the documentation of this file.
18 #ifndef __ESCRIPT_DATALAZY_H__
19 #define __ESCRIPT_DATALAZY_H__
179 int dataPointNo)
const;
390 #endif // __ESCRIPT_DATALAZY_H__
void tensor_unary_array_operation_real(const size_t size, const IN *arg1, DataTypes::real_t *argRes, escript::ES_optype operation, DataTypes::real_t tol=0)
Definition: ArrayOps.h:684
const DataTypes::RealVectorType * resolveNodeNP1OUT(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1391
@ IDENTITY
Definition: ES_optype.h:30
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
@ MINVAL
Definition: ES_optype.h:70
Return the minimum value of the two given values.
Definition: ArrayOps.h:74
@ SIGN
Definition: ES_optype.h:51
Data erf() const
Return the error function erf of each data point of this Data object.
Definition: Data.cpp:2111
ES_optype m_op
Definition: DataLazy.h:241
const DataTypes::CplxVectorType * resolveNodeSampleCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1175
Data sign() const
Return the sign of each data point of this Data object. -1 for negative values, zero for zero values,...
Definition: Data.cpp:2157
std::string shapeToString(const DataTypes::ShapeType &shape)
Return the given shape as a string.
Definition: DataTypes.cpp:117
Data oneOver() const
Returns 1./ Data object.
Definition: Data.cpp:1246
const DataTypes::CplxVectorType * resolveNodeUnaryCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1274
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:51
Data atanh() const
Return the atanh of each data point of this Data object.
Definition: Data.cpp:2136
Data atan() const
Return the atan of each data point of this Data object.
Definition: Data.cpp:2082
@ LZ
Definition: ES_optype.h:59
const DataTypes::RealVectorType * resolveNodeBinary(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1774
Data antihermitian() const
Return the anti-hermitian part of a matrix which is half the matrix minus its hermitian.
Definition: Data.cpp:2808
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:33
Data cos() const
Return the cos of each data point of this Data object.
Definition: Data.cpp:2053
real_t ElementType
Definition: DataVectorAlt.h:43
size_t m_height
Definition: DataLazy.h:256
@ COSH
Definition: ES_optype.h:43
const DataTypes::RealVectorType * resolveSample(int sampleNo, size_t &roffset) const
Compute the value of the expression for the given sample.
Definition: DataLazy.cpp:2336
const DataTypes::CplxVectorType * resolveNodeNP1OUTCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1466
Return the maximum value of the two given values.
Definition: ArrayOps.h:59
Data whereNonNegative() const
Return a Data with a 1 for +ive or 0 values and a 0 for -ive values.
Definition: Data.cpp:1275
Data tan() const
Return the tan of each data point of this Data object.
Definition: Data.cpp:2060
char m_readytype
Definition: DataLazy.h:246
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
@ POS
Definition: ES_optype.h:54
size_t getMaxSampleSize() const
double m_tol
Definition: DataLazy.h:253
const DataTypes::CplxVectorType * resolveNodeNP1OUT_2PCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1658
const DataTypes::RealVectorType * resolveNodeTProd(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:2224
DataAbstract_ptr borrowDataPtr(void) const
Definition: Data.cpp:4628
int m_SL
Definition: DataLazy.h:250
DataAbstract_ptr getPtr()
Return shared pointer managing this object.
Definition: DataAbstract.cpp:39
virtual void setToZero()
Produces an IDENTITY DataLazy containing zero. The result will have the same shape and functionspace ...
Definition: DataLazy.cpp:2986
Data sinh() const
Return the sinh of each data point of this Data object.
Definition: Data.cpp:2089
Data abs() const
Return the absolute value of each data point of this Data object.
Definition: Data.cpp:2165
@ PROM
Definition: ES_optype.h:83
@ SQRT
Definition: ES_optype.h:56
@ G_UNARY_R
Definition: ES_optype.h:96
int * m_sampleids
Definition: DataLazy.h:235
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:52
@ SWAP
Definition: ES_optype.h:69
@ EXP
Definition: ES_optype.h:55
@ NSYM
Definition: ES_optype.h:65
Data swapaxes(const int axis0, const int axis1) const
swaps the components axis0 and axis1
Definition: Data.cpp:2665
const DataTypes::CplxVectorType * resolveNodeNP1OUT_PCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1574
const DataTypes::CplxVectorType * resolveNodeReductionCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1372
DataReady_ptr m_id
Definition: DataLazy.h:239
friend class DataLazy
Definition: DataAbstract.h:550
Data exp() const
Return the exponential function of each data point of this Data object.
Definition: Data.cpp:2191
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:50
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
@ NHER
Definition: ES_optype.h:74
@ G_UNARY_C
Definition: ES_optype.h:103
DataTypes::RealVectorType::size_type getLength() const
This method throws an exception. It does not really make sense to ask this question of lazy data.
Definition: DataLazy.cpp:2915
@ SINH
Definition: ES_optype.h:42
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
const std::string & opToString(ES_optype op)
Definition: ES_optype.cpp:89
DataReady_ptr resolveNodeWorker()
resolve to a ReadyData object using storage at nodes
Definition: DataLazy.cpp:2544
@ G_NP1OUT_P
Definition: ES_optype.h:98
@ TRANS
Definition: ES_optype.h:67
ES_opgroup m_opgroup
Definition: DataLazy.h:242
@ G_BINARY
Definition: ES_optype.h:93
@ ATANH
Definition: ES_optype.h:48
#define ESCRIPT_MAX_DATA_RANK
Definition: Data.h:39
@ LOG
Definition: ES_optype.h:50
@ G_UNARY_P
Definition: ES_optype.h:95
const DataTypes::RealVectorType * resolveNodeNP1OUT_P(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1527
const DataTypes::CplxVectorType * resolveNodeUnary_C(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1437
@ SUB
Definition: ES_optype.h:32
Definition: FunctionSpace.h:36
Data tanh() const
Return the tanh of each data point of this Data object.
Definition: Data.cpp:2103
@ ACOS
Definition: ES_optype.h:40
const DataTypes::CplxVectorType * resolveNodeCondEvalCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1729
DataLazy_ptr makePromote(DataLazy_ptr p)
Definition: DataLazy.cpp:115
void complicate()
Definition: Data.cpp:6057
@ G_CONDEVAL
Definition: ES_optype.h:102
@ G_NP1OUT_2P
Definition: ES_optype.h:100
@ TANH
Definition: ES_optype.h:44
Data whereZero(DataTypes::real_t tol=0.0) const
Return a Data with a 1 for 0 values and a 0 for +ive or -ive values.
Definition: Data.cpp:1297
Data C_GeneralTensorProduct(Data &arg_0, Data &arg_1, int axis_offset=0, int transpose=0)
Compute a tensor product of two Data objects.
Definition: Data.cpp:3690
~DataLazy()
Definition: DataLazy.cpp:919
@ ERF
Definition: ES_optype.h:45
int getNumberOfThreads()
returns the number of threads
Definition: Utils.cpp:85
const DataTypes::CplxVectorType * resolveNodeTProdCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:2278
@ NEG
Definition: ES_optype.h:53
@ G_IDENTITY
Definition: ES_optype.h:92
Data powD(const Data &right) const
Return the given power of each data point of this Data object.
Definition: Data.cpp:3337
DataReady_ptr collapseToReady() const
Evaluates the expression using methods on Data. This does the work for the collapse method....
Definition: DataLazy.cpp:931
DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
Return the offset for the given sample. This returns the offset for the given point into the containe...
Definition: DataLazy.cpp:2956
@ GZ
Definition: ES_optype.h:58
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:612
void resolveGroupWorker(std::vector< DataLazy * > &dats)
Definition: DataLazy.cpp:2464
Data represents a collection of datapoints.
Definition: Data.h:64
Definition: DataException.h:28
Data whereNonPositive() const
Return a Data with a 1 for -ive or 0 values and a 0 for +ive values.
Definition: Data.cpp:1286
DataReady_ptr resolveNodeWorkerCplx()
Definition: DataLazy.cpp:2602
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
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:43
Contains the types to represent Shapes, Regions, RegionLoop ranges and vectors of data as well as the...
Definition: DataTypes.cpp:88
@ ABS
Definition: ES_optype.h:52
Data symmetric() const
Return the symmetric part of a matrix which is half the matrix plus its transpose.
Definition: Data.cpp:2722
DataAbstract * getSlice(const DataTypes::RegionType ®ion) const
Return the given slice from this object.
Definition: DataLazy.cpp:2922
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
Return the offset for the given given data point. This returns the offset in bytes for the given poin...
Definition: DataExpanded.cpp:622
void matrix_matrix_product(const int SL, const int SM, const int SR, const LEFT *A, const RIGHT *B, RES *C, int transpose)
Definition: ArrayOps.h:564
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:44
Data sin() const
Return the sin of each data point of this Data object.
Definition: Data.cpp:2046
#define SIZELIMIT
Definition: DataLazy.cpp:47
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:642
@ G_UNARY
Definition: ES_optype.h:94
DataTypes::ShapeType ShapeType
Definition: DataLazy.h:52
@ G_REDUCTION
Definition: ES_optype.h:101
Data acosh() const
Return the acosh of each data point of this Data object.
Definition: Data.cpp:2129
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:623
@ ACOSH
Definition: ES_optype.h:47
Data cosh() const
Return the cosh of each data point of this Data object.
Definition: Data.cpp:2096
@ MUL
Definition: ES_optype.h:33
void LazyNodeSetup()
Definition: DataLazy.cpp:408
Data trace(int axis_offset) const
Return the trace of a matrix.
Definition: Data.cpp:2848
DataAbstract parent
Definition: DataLazy.h:51
int m_SR
Definition: DataLazy.h:250
@ ADD
Definition: ES_optype.h:31
@ GEZ
Definition: ES_optype.h:60
const DataTypes::RealVectorType * resolveNodeNP1OUT_2P(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1621
Give a short description of what DataExpanded does.
Definition: DataExpanded.h:44
DataLazy_ptr m_right
Definition: DataLazy.h:240
const DataTypes::CplxVectorType * resolveNodeBinaryCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1997
ES_opgroup
Definition: ES_optype.h:90
DataLazy_ptr m_left
Definition: DataLazy.h:240
@ TRACE
Definition: ES_optype.h:68
void intoString(std::ostringstream &oss) const
Definition: DataLazy.cpp:2681
@ LEZ
Definition: ES_optype.h:61
@ CONDEVAL
Definition: ES_optype.h:72
const std::string & groupToString(ES_opgroup g)
Definition: ES_optype.cpp:105
@ DIV
Definition: ES_optype.h:34
EscriptParams escriptParams
Definition: EscriptParams.cpp:29
DataTypes::CplxVectorType m_samples_c
Definition: DataLazy.h:237
bool m_iscompl
Definition: DataAbstract.h:564
DataLazy_ptr m_mask
Definition: DataLazy.h:240
ES_opgroup getOpgroup(ES_optype op)
Definition: ES_optype.cpp:99
size_t m_samplesize
Definition: DataLazy.h:244
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
DataTypes::RealVectorType m_samples_r
Definition: DataLazy.h:236
@ RECIP
Definition: ES_optype.h:57
@ G_NP1OUT
Definition: ES_optype.h:97
int getLazyStrFmt() const
Definition: EscriptParams.h:41
ES_optype
Definition: ES_optype.h:28
Data transpose(int axis_offset) const
Transpose each data point of this Data object around the given axis.
Definition: Data.cpp:2903
escript::DataTypes::DataVectorAlt< real_t > RealVectorType
Vector to store underlying data.
Definition: DataVector.h:44
Data hermitian() const
Return the hermitian part of a matrix which is half the matrix plus its adjoint.
Definition: Data.cpp:2781
DataAbstract * deepCopy() const
Return a deep copy of the current object.
Definition: DataLazy.cpp:2879
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataAbstract.cpp:246
bool actsExpanded() const
if resolve() was called would it produce expanded data.
Definition: DataLazy.cpp:3001
Data whereNegative() const
Return a Data with a 1 for -ive values and a 0 for +ive or 0 values.
Definition: Data.cpp:1264
Data minval() const
Return the minimum value of each data point of this Data object.
Definition: Data.cpp:2656
Data log() const
Return the natural log of each data point of this Data object.
Definition: Data.cpp:2150
void resolveToIdentity()
resolve the expression can store it in the current node The current node will be converted to an iden...
Definition: DataLazy.cpp:2418
boost::shared_ptr< const DataLazy > const_DataLazy_ptr
Definition: DataLazy.h:46
DataReady_ptr borrowReadyPtr(void) const
Definition: Data.cpp:4635
size_t m_children
Definition: DataLazy.h:255
Definition: AbstractContinuousDomain.cpp:23
Data wherePositive() const
Return a Data with a 1 for +ive values and a 0 for 0 or -ive values.
Definition: Data.cpp:1253
int m_axis_offset
Definition: DataLazy.h:248
@ PROD
Definition: ES_optype.h:66
std::string pointToString(const RealVectorType &data, const ShapeType &shape, int offset, const std::string &prefix)
Display a single value (with the specified shape) from the data.
@ LOG10
Definition: ES_optype.h:49
DataTypes::RealVectorType & getVectorRW()
Return a a reference to the underlying DataVector.
Definition: DataExpanded.cpp:1504
void collapse() const
Converts the DataLazy into an IDENTITY storing the value of the expression. This method uses the orig...
Definition: DataLazy.cpp:1100
void intoTreeString(std::ostringstream &oss, std::string indent) const
Definition: DataLazy.cpp:2789
Data antisymmetric() const
Return the antisymmetric part of a matrix which is half the matrix minus its transpose.
Definition: Data.cpp:2745
Definition: DataAbstract.h:63
@ SYM
Definition: ES_optype.h:64
Describes binary operations performed on DataVector.
Data asinh() const
Return the asinh of each data point of this Data object.
Definition: Data.cpp:2122
int m_transpose
Definition: DataLazy.h:249
@ SIN
Definition: ES_optype.h:36
@ EZ
Definition: ES_optype.h:63
Data whereNonZero(DataTypes::real_t tol=0.0) const
Return a Data with a 0 for 0 values and a 1 for +ive or -ive values.
Definition: Data.cpp:1304
const DataTypes::RealVectorType * resolveNodeReduction(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1320
void makeIdentity(const DataReady_ptr &p)
helper method for resolveToIdentity and the identity constructor
Definition: DataLazy.cpp:2434
bool isComplex() const
true if the components of datapoints are complex
Definition: DataAbstract.cpp:70
Data log10() const
Return the log to base 10 of each data point of this Data object.
Definition: Data.cpp:2143
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:664
DataTypes::real_t reductionOpVector(const DataTypes::RealVectorType &left, const DataTypes::ShapeType &leftShape, DataTypes::RealVectorType::size_type offset, BinaryFunction operation, DataTypes::real_t initial_value)
Perform the given data point reduction operation on the data point specified by the given offset into...
Definition: DataVectorOps.h:1397
void copy(const Data &other)
Make this object a deep copy of "other".
Definition: Data.cpp:777
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
@ POW
Definition: ES_optype.h:35
const DataTypes::CplxVectorType * resolveTypedSample(int sampleNo, size_t &roffset, DataTypes::cplx_t dummy) const
Definition: DataLazy.cpp:2389
Data neg() const
Return the negation of each data point of this Data object.
Definition: Data.cpp:2172
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:635
const DataTypes::RealVectorType * resolveNodeUnary(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1225
@ TAN
Definition: ES_optype.h:38
int m_SM
Definition: DataLazy.h:250
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:54
Data acos() const
Return the acos of each data point of this Data object.
Definition: Data.cpp:2074
@ G_TENSORPROD
Definition: ES_optype.h:99
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:57
DataReady_ptr resolve()
Evaluate the lazy expression.
Definition: DataLazy.cpp:2455
const DataTypes::RealVectorType * resolveNodeCondEval(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1694
DataTypes::CplxVectorType & getVectorRWC()
Definition: DataExpanded.cpp:1515
boost::shared_ptr< DataLazy > DataLazy_ptr
Definition: DataLazy.h:43
void tensor_unary_array_operation(const size_t size, const IN *arg1, OUT *argRes, escript::ES_optype operation, DataTypes::real_t tol=0)
Definition: ArrayOps.h:762
std::string toString() const
Write the data as a string.
Definition: DataLazy.cpp:2660
Data asin() const
Return the asin of each data point of this Data object.
Definition: Data.cpp:2067
@ ASIN
Definition: ES_optype.h:39
Data sqrt() const
Return the square root of each data point of this Data object.
Definition: Data.cpp:2198
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
const DataTypes::RealVectorType * resolveNodeSample(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1119
@ G_UNARY_PR
Definition: ES_optype.h:104
@ COS
Definition: ES_optype.h:37
@ ASINH
Definition: ES_optype.h:46
void tensor_unary_promote(const size_t size, const DataTypes::real_t *arg1, DataTypes::cplx_t *argRes)
Definition: ArrayOps.h:748
escript::DataTypes::DataVectorAlt< cplx_t > CplxVectorType
Definition: DataVector.h:45
@ ATAN
Definition: ES_optype.h:41
@ MAXVAL
Definition: ES_optype.h:71
static const ShapeType scalarShape
Use this instead of creating empty shape objects for scalars.
Definition: DataTypes.h:47
unsigned int m_rank
Definition: DataAbstract.h:582
DataAbstract * zeroedCopy() const
Return an object with the same type, domain (and tags if appropriate) as this, but all values are zer...
Definition: DataLazy.cpp:2903
@ NEZ
Definition: ES_optype.h:62
@ HER
Definition: ES_optype.h:73
#define LAZYDEBUG(X)
Definition: DataLazy.cpp:33
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:49