DataLazy.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __ESCRIPT_DATALAZY_H__
#define __ESCRIPT_DATALAZY_H__
#include "system_dep.h"
#include "DataAbstract.h"
#include "ArrayOps.h" // for tensor_binary_op
#include "DataVector.h" // for ElementType
#include "ES_optype.h"
#include <string>
//#define LAZY_NODE_STORAGE
namespace escript {
class DataLazy;
typedef POINTER_WRAPPER_CLASS(DataLazy) DataLazy_ptr;
typedef POINTER_WRAPPER_CLASS(const DataLazy) const_DataLazy_ptr;
class DataLazy : public DataAbstract
{
typedef DataAbstract parent;
typedef DataTypes::ShapeType ShapeType;
public:
ESCRIPT_DLL_API
DataLazy(DataAbstract_ptr p);
ESCRIPT_DLL_API
DataLazy(DataAbstract_ptr left, ES_optype op);
ESCRIPT_DLL_API
DataLazy(DataAbstract_ptr left, ES_optype op, double tol);
ESCRIPT_DLL_API
DataLazy(DataAbstract_ptr left, ES_optype op, int axis_offset);
ESCRIPT_DLL_API
DataLazy(DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op);
ESCRIPT_DLL_API
DataLazy(DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op, int axis_offset, int transpose);
ESCRIPT_DLL_API
DataLazy(DataAbstract_ptr left, ES_optype op, const int axis0, const int axis1);
ESCRIPT_DLL_API
DataLazy(DataAbstract_ptr mask, DataAbstract_ptr left, DataAbstract_ptr right/*, double tol*/);
ESCRIPT_DLL_API
~DataLazy();
ESCRIPT_DLL_API
DataReady_ptr
resolve();
ESCRIPT_DLL_API
std::string
toString() const;
ESCRIPT_DLL_API
DataAbstract*
deepCopy() const;
ESCRIPT_DLL_API
DataAbstract*
zeroedCopy() const;
ESCRIPT_DLL_API
DataTypes::RealVectorType::size_type
getLength() const;
ESCRIPT_DLL_API
DataAbstract*
getSlice(const DataTypes::RegionType& region) const;
DataTypes::RealVectorType::size_type
getPointOffset(int sampleNo,
int dataPointNo) const;
DataTypes::RealVectorType::size_type
getPointOffset(int sampleNo,
int dataPointNo);
ESCRIPT_DLL_API
size_t
getMaxSampleSize() const;
ESCRIPT_DLL_API
const DataTypes::RealVectorType*
resolveSample(int sampleNo, size_t& roffset) const;
ESCRIPT_DLL_API
const DataTypes::CplxVectorType*
resolveTypedSample(int sampleNo, size_t& roffset, DataTypes::cplx_t dummy) const;
ESCRIPT_DLL_API
const DataTypes::RealVectorType*
resolveTypedSample(int sampleNo, size_t& roffset, DataTypes::real_t dummy) const;
ESCRIPT_DLL_API
bool
actsExpanded() const;
ESCRIPT_DLL_API
virtual void
setToZero();
ESCRIPT_DLL_API
void
resolveGroupWorker(std::vector<DataLazy*>& dats);
private:
int* m_sampleids; // may be NULL
mutable DataTypes::RealVectorType m_samples_r;
mutable DataTypes::CplxVectorType m_samples_c;
mutable DataReady_ptr m_id; // For IDENTITY nodes, stores a wrapped value.
mutable DataLazy_ptr m_left, m_right, m_mask; // operands for operation.
mutable ES_optype m_op; // operation to perform.
mutable ES_opgroup m_opgroup; // type of operation to perform
size_t m_samplesize; // number of values required to store a sample
char m_readytype; // E for expanded, T for tagged, C for constant
int m_axis_offset; // required extra info for general tensor product
int m_transpose; // offset and transpose are used for swapaxes as well
int m_SL, m_SM, m_SR; // computed properties used in general tensor product
double m_tol; // required extra info for <>0 and ==0
mutable size_t m_children;
mutable size_t m_height;
void LazyNodeSetup();
const DataTypes::RealVectorType*
resolveNodeUnary(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeUnaryCplx(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::RealVectorType*
resolveNodeReduction(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeReductionCplx(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::RealVectorType*
resolveNodeSample(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeSampleCplx(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::RealVectorType*
resolveNodeBinary(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeBinaryCplx(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::RealVectorType*
resolveNodeNP1OUT(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeNP1OUTCplx(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::RealVectorType*
resolveNodeNP1OUT_P(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeNP1OUT_PCplx(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::RealVectorType*
resolveNodeTProd(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeTProdCplx(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::RealVectorType*
resolveNodeNP1OUT_2P(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeNP1OUT_2PCplx(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::RealVectorType*
resolveNodeCondEval(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeCondEvalCplx(int tid, int sampleNo, size_t& roffset) const;
const DataTypes::CplxVectorType*
resolveNodeUnary_C(int tid, int sampleNo, size_t& roffset) const;
void
intoString(std::ostringstream& oss) const;
void
intoTreeString(std::ostringstream& oss,std::string indent) const;
void
collapse() const; // converts the node into an IDENTITY node
DataReady_ptr
collapseToReady() const;
void
resolveToIdentity();
void
makeIdentity(const DataReady_ptr& p);
DataReady_ptr
resolveNodeWorker();
DataReady_ptr
resolveNodeWorkerCplx();
};
// If an expression is already complex, return the same expression.
// Otherwise, return the old expression with a promote operation
// above it
DataLazy_ptr makePromote(DataLazy_ptr p);
}
#endif // __ESCRIPT_DATALAZY_H__
escript::tensor_unary_array_operation_real
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
escript::DataLazy::resolveNodeNP1OUT
const DataTypes::RealVectorType * resolveNodeNP1OUT(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1391
escript::IDENTITY
@ IDENTITY
Definition: ES_optype.h:58
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
escript::MINVAL
@ MINVAL
Definition: ES_optype.h:98
escript::FMin
Return the minimum value of the two given values.
Definition: ArrayOps.h:73
escript::SIGN
@ SIGN
Definition: ES_optype.h:79
escript::Data::erf
Data erf() const
Return the error function erf of each data point of this Data object.
Definition: Data.cpp:2111
escript::DataLazy::m_op
ES_optype m_op
Definition: DataLazy.h:255
escript::DataLazy::resolveNodeSampleCplx
const DataTypes::CplxVectorType * resolveNodeSampleCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1175
escript::Data::sign
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
escript::DataTypes::shapeToString
std::string shapeToString(const DataTypes::ShapeType &shape)
Return the given shape as a string.
Definition: DataTypes.cpp:117
escript::Data::oneOver
Data oneOver() const
Returns 1./ Data object.
Definition: Data.cpp:1246
escript::DataLazy::resolveNodeUnaryCplx
const DataTypes::CplxVectorType * resolveNodeUnaryCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1274
escript::DataTypes::real_t
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:79
escript::Data::atanh
Data atanh() const
Return the atanh of each data point of this Data object.
Definition: Data.cpp:2136
escript::Data::atan
Data atan() const
Return the atan of each data point of this Data object.
Definition: Data.cpp:2082
escript::LZ
@ LZ
Definition: ES_optype.h:87
escript::DataLazy::resolveNodeBinary
const DataTypes::RealVectorType * resolveNodeBinary(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1774
escript::Data::antihermitian
Data antihermitian() const
Return the anti-hermitian part of a matrix which is half the matrix minus its hermitian.
Definition: Data.cpp:2808
POINTER_WRAPPER_CLASS
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:33
escript::Data::cos
Data cos() const
Return the cos of each data point of this Data object.
Definition: Data.cpp:2053
escript::DataTypes::DataVectorAlt< real_t >::ElementType
real_t ElementType
Definition: DataVectorAlt.h:85
escript::DataLazy::m_height
size_t m_height
Definition: DataLazy.h:270
escript::COSH
@ COSH
Definition: ES_optype.h:71
escript::DataLazy::resolveSample
const DataTypes::RealVectorType * resolveSample(int sampleNo, size_t &roffset) const
Compute the value of the expression for the given sample.
Definition: DataLazy.cpp:2336
escript::DataLazy::resolveNodeNP1OUTCplx
const DataTypes::CplxVectorType * resolveNodeNP1OUTCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1466
escript::FMax
Return the maximum value of the two given values.
Definition: ArrayOps.h:58
escript::Data::whereNonNegative
Data whereNonNegative() const
Return a Data with a 1 for +ive or 0 values and a 0 for -ive values.
Definition: Data.cpp:1275
escript::Data::tan
Data tan() const
Return the tan of each data point of this Data object.
Definition: Data.cpp:2060
escript::DataLazy::m_readytype
char m_readytype
Definition: DataLazy.h:260
escript::antihermitian
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
escript::POS
@ POS
Definition: ES_optype.h:82
escript::DataLazy::getMaxSampleSize
size_t getMaxSampleSize() const
escript::DataLazy::m_tol
double m_tol
Definition: DataLazy.h:267
escript::DataLazy::resolveNodeNP1OUT_2PCplx
const DataTypes::CplxVectorType * resolveNodeNP1OUT_2PCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1658
escript::DataLazy::resolveNodeTProd
const DataTypes::RealVectorType * resolveNodeTProd(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:2224
escript::Data::borrowDataPtr
DataAbstract_ptr borrowDataPtr(void) const
Definition: Data.cpp:4628
escript::DataLazy::m_SL
int m_SL
Definition: DataLazy.h:264
escript::DataLazy::setToZero
virtual void setToZero()
Produces an IDENTITY DataLazy containing zero. The result will have the same shape and functionspace ...
Definition: DataLazy.cpp:2986
escript::Data::sinh
Data sinh() const
Return the sinh of each data point of this Data object.
Definition: Data.cpp:2089
escript::Data::abs
Data abs() const
Return the absolute value of each data point of this Data object.
Definition: Data.cpp:2165
escript::PROM
@ PROM
Definition: ES_optype.h:111
escript::SQRT
@ SQRT
Definition: ES_optype.h:84
escript::G_UNARY_R
@ G_UNARY_R
Definition: ES_optype.h:110
escript::DataLazy::m_sampleids
int * m_sampleids
Definition: DataLazy.h:249
escript::DataAbstract_ptr
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:66
escript::SWAP
@ SWAP
Definition: ES_optype.h:97
escript::EXP
@ EXP
Definition: ES_optype.h:83
escript::NSYM
@ NSYM
Definition: ES_optype.h:93
escript::Data::swapaxes
Data swapaxes(const int axis0, const int axis1) const
swaps the components axis0 and axis1
Definition: Data.cpp:2665
escript::DataLazy::resolveNodeNP1OUT_PCplx
const DataTypes::CplxVectorType * resolveNodeNP1OUT_PCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1574
escript::DataLazy::resolveNodeReductionCplx
const DataTypes::CplxVectorType * resolveNodeReductionCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1372
escript::DataLazy::m_id
DataReady_ptr m_id
Definition: DataLazy.h:253
escript::DataAbstract::DataLazy
friend class DataLazy
Definition: DataAbstract.h:564
escript::Data::exp
Data exp() const
Return the exponential function of each data point of this Data object.
Definition: Data.cpp:2191
escript::DataTypes::DataVectorAlt< real_t >::size_type
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:92
escript::symmetric
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
escript::DataTypes::DataVectorAlt< real_t >
escript::NHER
@ NHER
Definition: ES_optype.h:102
escript::G_UNARY_C
@ G_UNARY_C
Definition: ES_optype.h:117
escript::DataLazy::getLength
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
escript::SINH
@ SINH
Definition: ES_optype.h:70
escript::transpose
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
escript::opToString
const std::string & opToString(ES_optype op)
Definition: ES_optype.cpp:89
escript::DataLazy::resolveNodeWorker
DataReady_ptr resolveNodeWorker()
resolve to a ReadyData object using storage at nodes
Definition: DataLazy.cpp:2544
escript::G_NP1OUT_P
@ G_NP1OUT_P
Definition: ES_optype.h:112
escript::TRANS
@ TRANS
Definition: ES_optype.h:95
escript::DataLazy::m_opgroup
ES_opgroup m_opgroup
Definition: DataLazy.h:256
escript::G_BINARY
@ G_BINARY
Definition: ES_optype.h:107
escript::ATANH
@ ATANH
Definition: ES_optype.h:76
ESCRIPT_MAX_DATA_RANK
#define ESCRIPT_MAX_DATA_RANK
Definition: Data.h:39
escript::LOG
@ LOG
Definition: ES_optype.h:78
DataLazy.h
escript::G_UNARY_P
@ G_UNARY_P
Definition: ES_optype.h:109
escript::DataLazy::resolveNodeNP1OUT_P
const DataTypes::RealVectorType * resolveNodeNP1OUT_P(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1527
escript::DataLazy::resolveNodeUnary_C
const DataTypes::CplxVectorType * resolveNodeUnary_C(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1437
escript::SUB
@ SUB
Definition: ES_optype.h:60
escript::FunctionSpace
Definition: FunctionSpace.h:49
escript::Data::tanh
Data tanh() const
Return the tanh of each data point of this Data object.
Definition: Data.cpp:2103
escript::ACOS
@ ACOS
Definition: ES_optype.h:68
escript::DataLazy::resolveNodeCondEvalCplx
const DataTypes::CplxVectorType * resolveNodeCondEvalCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1729
escript::makePromote
DataLazy_ptr makePromote(DataLazy_ptr p)
Definition: DataLazy.cpp:115
escript::Data::complicate
void complicate()
Definition: Data.cpp:6057
escript::G_CONDEVAL
@ G_CONDEVAL
Definition: ES_optype.h:116
escript::G_NP1OUT_2P
@ G_NP1OUT_2P
Definition: ES_optype.h:114
escript::TANH
@ TANH
Definition: ES_optype.h:72
escript::Data::whereZero
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
escript::C_GeneralTensorProduct
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
escript::DataLazy::~DataLazy
~DataLazy()
Definition: DataLazy.cpp:919
system_dep.h
escript::ERF
@ ERF
Definition: ES_optype.h:73
escript::getNumberOfThreads
int getNumberOfThreads()
returns the number of threads
Definition: Utils.cpp:85
escript::DataLazy::resolveNodeTProdCplx
const DataTypes::CplxVectorType * resolveNodeTProdCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:2278
escript::NEG
@ NEG
Definition: ES_optype.h:81
escript::G_IDENTITY
@ G_IDENTITY
Definition: ES_optype.h:106
escript::Data::powD
Data powD(const Data &right) const
Return the given power of each data point of this Data object.
Definition: Data.cpp:3337
escript::DataLazy::collapseToReady
DataReady_ptr collapseToReady() const
Evaluates the expression using methods on Data. This does the work for the collapse method....
Definition: DataLazy.cpp:931
escript::DataLazy::getPointOffset
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
escript::GZ
@ GZ
Definition: ES_optype.h:86
ArrayOps.h
escript::DataAbstract::getNumDPPSample
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:626
escript::DataLazy::resolveGroupWorker
void resolveGroupWorker(std::vector< DataLazy * > &dats)
Definition: DataLazy.cpp:2464
Utils.h
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
escript::DataException
Definition: DataException.h:41
escript::DataAbstract::DataAbstract
DataAbstract(const FunctionSpace &what, const ShapeType &shape, bool isDataEmpty=false, bool isCplx=false)
Constructor for DataAbstract.
Definition: DataAbstract.cpp:76
escript::Data::whereNonPositive
Data whereNonPositive() const
Return a Data with a 1 for -ive or 0 values and a 0 for +ive values.
Definition: Data.cpp:1286
escript::DataLazy::resolveNodeWorkerCplx
DataReady_ptr resolveNodeWorkerCplx()
Definition: DataLazy.cpp:2602
escript::hermitian
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
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:71
escript::DataTypes
Contains the types to represent Shapes, Regions, RegionLoop ranges and vectors of data as well as the...
Definition: DataTypes.cpp:87
escript::ABS
@ ABS
Definition: ES_optype.h:80
escript::Data::symmetric
Data symmetric() const
Return the symmetric part of a matrix which is half the matrix plus its transpose.
Definition: Data.cpp:2722
EscriptParams.h
escript::DataLazy::getSlice
DataAbstract * getSlice(const DataTypes::RegionType &region) const
Return the given slice from this object.
Definition: DataLazy.cpp:2922
escript::DataExpanded::getPointOffset
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
escript::matrix_matrix_product
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
escript::DataTypes::RegionType
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:72
DataAbstract.h
escript::Data::sin
Data sin() const
Return the sin of each data point of this Data object.
Definition: Data.cpp:2046
SIZELIMIT
#define SIZELIMIT
Definition: DataLazy.cpp:47
escript::DataTypes::noValues
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:91
escript::DataAbstract::getShape
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:656
escript::G_UNARY
@ G_UNARY
Definition: ES_optype.h:108
escript::DataLazy::ShapeType
DataTypes::ShapeType ShapeType
Definition: DataLazy.h:66
escript::G_REDUCTION
@ G_REDUCTION
Definition: ES_optype.h:115
escript::Data::acosh
Data acosh() const
Return the acosh of each data point of this Data object.
Definition: Data.cpp:2129
escript::DataAbstract::getNumSamples
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:637
escript::ACOSH
@ ACOSH
Definition: ES_optype.h:75
escript::Data::cosh
Data cosh() const
Return the cosh of each data point of this Data object.
Definition: Data.cpp:2096
escript::MUL
@ MUL
Definition: ES_optype.h:61
escript::DataLazy::LazyNodeSetup
void LazyNodeSetup()
Definition: DataLazy.cpp:408
escript::Data::trace
Data trace(int axis_offset) const
Return the trace of a matrix.
Definition: Data.cpp:2848
escript::DataLazy::parent
DataAbstract parent
Definition: DataLazy.h:65
escript::DataLazy::m_SR
int m_SR
Definition: DataLazy.h:264
escript::ADD
@ ADD
Definition: ES_optype.h:59
escript::GEZ
@ GEZ
Definition: ES_optype.h:88
escript::DataLazy::resolveNodeNP1OUT_2P
const DataTypes::RealVectorType * resolveNodeNP1OUT_2P(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1621
escript::DataAbstract::getPtr
DataAbstract_ptr getPtr()
Return shared pointer managing this object.
Definition: DataAbstract.cpp:39
escript::DataExpanded
Give a short description of what DataExpanded does.
Definition: DataExpanded.h:58
escript::DataLazy::m_right
DataLazy_ptr m_right
Definition: DataLazy.h:254
escript::DataLazy::resolveNodeBinaryCplx
const DataTypes::CplxVectorType * resolveNodeBinaryCplx(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1997
escript::ES_opgroup
ES_opgroup
Definition: ES_optype.h:103
escript::DataLazy::m_left
DataLazy_ptr m_left
Definition: DataLazy.h:254
escript::TRACE
@ TRACE
Definition: ES_optype.h:96
escript::DataLazy::intoString
void intoString(std::ostringstream &oss) const
Definition: DataLazy.cpp:2681
escript::LEZ
@ LEZ
Definition: ES_optype.h:89
escript::CONDEVAL
@ CONDEVAL
Definition: ES_optype.h:100
escript::groupToString
const std::string & groupToString(ES_opgroup g)
Definition: ES_optype.cpp:105
escript::DIV
@ DIV
Definition: ES_optype.h:62
escript::escriptParams
EscriptParams escriptParams
Definition: EscriptParams.cpp:43
escript::DataLazy::m_samples_c
DataTypes::CplxVectorType m_samples_c
Definition: DataLazy.h:251
escript::DataAbstract::m_iscompl
bool m_iscompl
Definition: DataAbstract.h:578
escript::DataLazy::m_mask
DataLazy_ptr m_mask
Definition: DataLazy.h:254
escript::getOpgroup
ES_opgroup getOpgroup(ES_optype op)
Definition: ES_optype.cpp:99
escript::DataLazy::m_samplesize
size_t m_samplesize
Definition: DataLazy.h:258
escript::swapaxes
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
escript::DataLazy::m_samples_r
DataTypes::RealVectorType m_samples_r
Definition: DataLazy.h:250
escript::RECIP
@ RECIP
Definition: ES_optype.h:85
escript::G_NP1OUT
@ G_NP1OUT
Definition: ES_optype.h:111
escript::EscriptParams::getLazyStrFmt
int getLazyStrFmt() const
Definition: EscriptParams.h:69
escript::ES_optype
ES_optype
Definition: ES_optype.h:41
escript::Data::transpose
Data transpose(int axis_offset) const
Transpose each data point of this Data object around the given axis.
Definition: Data.cpp:2903
escript::DataTypes::RealVectorType
escript::DataTypes::DataVectorAlt< real_t > RealVectorType
Vector to store underlying data.
Definition: DataVector.h:44
escript::Data::hermitian
Data hermitian() const
Return the hermitian part of a matrix which is half the matrix plus its adjoint.
Definition: Data.cpp:2781
escript::DataLazy::deepCopy
DataAbstract * deepCopy() const
Return a deep copy of the current object.
Definition: DataLazy.cpp:2879
escript::DataAbstract::transpose
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataAbstract.cpp:246
escript::DataLazy::actsExpanded
bool actsExpanded() const
if resolve() was called would it produce expanded data.
Definition: DataLazy.cpp:3001
escript::Data::whereNegative
Data whereNegative() const
Return a Data with a 1 for -ive values and a 0 for +ive or 0 values.
Definition: Data.cpp:1264
escript::Data::minval
Data minval() const
Return the minimum value of each data point of this Data object.
Definition: Data.cpp:2656
escript::Data::log
Data log() const
Return the natural log of each data point of this Data object.
Definition: Data.cpp:2150
escript::DataLazy::resolveToIdentity
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
escript::const_DataLazy_ptr
boost::shared_ptr< const DataLazy > const_DataLazy_ptr
Definition: DataLazy.h:60
escript::Data::borrowReadyPtr
DataReady_ptr borrowReadyPtr(void) const
Definition: Data.cpp:4635
escript::DataLazy::m_children
size_t m_children
Definition: DataLazy.h:269
escript
Definition: AbstractContinuousDomain.cpp:23
DataVector.h
escript::Data::wherePositive
Data wherePositive() const
Return a Data with a 1 for +ive values and a 0 for 0 or -ive values.
Definition: Data.cpp:1253
escript::DataLazy::m_axis_offset
int m_axis_offset
Definition: DataLazy.h:262
escript::PROD
@ PROD
Definition: ES_optype.h:94
escript::DataTypes::pointToString
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.
escript::LOG10
@ LOG10
Definition: ES_optype.h:77
DataTypes.h
escript::DataExpanded::getVectorRW
DataTypes::RealVectorType & getVectorRW()
Return a a reference to the underlying DataVector.
Definition: DataExpanded.cpp:1504
escript::DataLazy::collapse
void collapse() const
Converts the DataLazy into an IDENTITY storing the value of the expression. This method uses the orig...
Definition: DataLazy.cpp:1100
escript::DataLazy::intoTreeString
void intoTreeString(std::ostringstream &oss, std::string indent) const
Definition: DataLazy.cpp:2789
escript::Data::antisymmetric
Data antisymmetric() const
Return the antisymmetric part of a matrix which is half the matrix minus its transpose.
Definition: Data.cpp:2745
escript::DataAbstract
Definition: DataAbstract.h:76
escript::SYM
@ SYM
Definition: ES_optype.h:92
DataVectorOps.h
Describes binary operations performed on DataVector.
escript::Data::asinh
Data asinh() const
Return the asinh of each data point of this Data object.
Definition: Data.cpp:2122
escript::DataLazy::m_transpose
int m_transpose
Definition: DataLazy.h:263
escript::SIN
@ SIN
Definition: ES_optype.h:64
escript::EZ
@ EZ
Definition: ES_optype.h:91
escript::Data::whereNonZero
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
escript::DataLazy::resolveNodeReduction
const DataTypes::RealVectorType * resolveNodeReduction(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1320
ES_optype.h
escript::DataLazy::makeIdentity
void makeIdentity(const DataReady_ptr &p)
helper method for resolveToIdentity and the identity constructor
Definition: DataLazy.cpp:2434
escript::DataAbstract::isComplex
bool isComplex() const
true if the components of datapoints are complex
Definition: DataAbstract.cpp:70
escript::Data::log10
Data log10() const
Return the log to base 10 of each data point of this Data object.
Definition: Data.cpp:2143
escript::DataAbstract::getNoValues
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:678
escript::reductionOpVector
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
Data.h
escript::Data::copy
void copy(const Data &other)
Make this object a deep copy of "other".
Definition: Data.cpp:777
escript::antisymmetric
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
escript::POW
@ POW
Definition: ES_optype.h:63
escript::DataLazy::resolveTypedSample
const DataTypes::CplxVectorType * resolveTypedSample(int sampleNo, size_t &roffset, DataTypes::cplx_t dummy) const
Definition: DataLazy.cpp:2389
escript::Data::neg
Data neg() const
Return the negation of each data point of this Data object.
Definition: Data.cpp:2172
escript::DataAbstract::getFunctionSpace
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:649
escript::DataLazy::resolveNodeUnary
const DataTypes::RealVectorType * resolveNodeUnary(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1225
escript::TAN
@ TAN
Definition: ES_optype.h:66
escript::DataLazy::m_SM
int m_SM
Definition: DataLazy.h:264
escript::DataTypes::cplx_t
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:82
escript::Data::acos
Data acos() const
Return the acos of each data point of this Data object.
Definition: Data.cpp:2074
escript::G_TENSORPROD
@ G_TENSORPROD
Definition: ES_optype.h:113
escript::DataReady_ptr
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:71
escript::DataLazy::resolve
DataReady_ptr resolve()
Evaluate the lazy expression.
Definition: DataLazy.cpp:2455
escript::DataLazy::resolveNodeCondEval
const DataTypes::RealVectorType * resolveNodeCondEval(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1694
escript::DataExpanded::getVectorRWC
DataTypes::CplxVectorType & getVectorRWC()
Definition: DataExpanded.cpp:1515
escript::DataLazy_ptr
boost::shared_ptr< DataLazy > DataLazy_ptr
Definition: DataLazy.h:57
escript::tensor_unary_array_operation
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
escript::DataLazy::toString
std::string toString() const
Write the data as a string.
Definition: DataLazy.cpp:2660
escript::Data::asin
Data asin() const
Return the asin of each data point of this Data object.
Definition: Data.cpp:2067
escript::ASIN
@ ASIN
Definition: ES_optype.h:67
escript::Data::sqrt
Data sqrt() const
Return the square root of each data point of this Data object.
Definition: Data.cpp:2198
escript::trace
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
escript::DataLazy::resolveNodeSample
const DataTypes::RealVectorType * resolveNodeSample(int tid, int sampleNo, size_t &roffset) const
Definition: DataLazy.cpp:1119
escript::G_UNARY_PR
@ G_UNARY_PR
Definition: ES_optype.h:118
escript::COS
@ COS
Definition: ES_optype.h:65
escript::ASINH
@ ASINH
Definition: ES_optype.h:74
escript::tensor_unary_promote
void tensor_unary_promote(const size_t size, const DataTypes::real_t *arg1, DataTypes::cplx_t *argRes)
Definition: ArrayOps.h:748
escript::DataTypes::CplxVectorType
escript::DataTypes::DataVectorAlt< cplx_t > CplxVectorType
Definition: DataVector.h:45
escript::ATAN
@ ATAN
Definition: ES_optype.h:69
escript::MAXVAL
@ MAXVAL
Definition: ES_optype.h:99
escript::DataTypes::scalarShape
static const ShapeType scalarShape
Use this instead of creating empty shape objects for scalars.
Definition: DataTypes.h:75
escript::DataAbstract::m_rank
unsigned int m_rank
Definition: DataAbstract.h:596
escript::DataLazy::zeroedCopy
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
escript::NEZ
@ NEZ
Definition: ES_optype.h:90
FunctionSpace.h
escript::HER
@ HER
Definition: ES_optype.h:101
LAZYDEBUG
#define LAZYDEBUG(X)
Definition: DataLazy.cpp:33
escript::DataLazy
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:62