escript::DataLazy Class Reference

Wraps an expression tree of other DataObjects. The data will be evaluated when required. More...

`#include <DataLazy.h>`

Inheritance diagram for escript::DataLazy:

## Public Member Functions

| DataLazy (DataAbstract_ptr p)
| Create an IDENTITY DataLazy for the given DataAbstract. More...
| DataLazy (DataAbstract_ptr left, ES_optype op)
| Produce a DataLazy for a unary operation. More...
| DataLazy (DataAbstract_ptr left, ES_optype op, double tol)
| Produce a DataLazy for a unary operation. More...
| DataLazy (DataAbstract_ptr left, ES_optype op, int axis_offset)
| Produce a DataLazy for a unary operation which requires a parameter. More...
| DataLazy (DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op)
| Produce a DataLazy for a binary operation. More...
| DataLazy (DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op, int axis_offset, int transpose)
| Produce a DataLazy for a binary operation with additional paramters. More...
| DataLazy (DataAbstract_ptr left, ES_optype op, const int axis0, const int axis1)
| Produce a DataLazy for a unary operation which requires two integer parameters. More...
| DataLazy (DataAbstract_ptr mask, DataAbstract_ptr left, DataAbstract_ptr right)
| Produce a DataLazy for a unary operation which requires two integer parameters. More...
| ~DataLazy ()
DataReady_ptr | resolve ()
| Evaluate the lazy expression. More...
std::string | toString () const
| Write the data as a string. More...
DataAbstract * | deepCopy () const
| Return a deep copy of the current object. More...
DataAbstract * | zeroedCopy () const
| Return an object with the same type, domain (and tags if appropriate) as this, but all values are zeroed. More...
DataTypes::RealVectorType::size_type | getLength () const
| This method throws an exception. It does not really make sense to ask this question of lazy data. More...
DataAbstract * | getSlice (const DataTypes::RegionType &region) const
| Return the given slice from this object. More...
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 container holding the point data. More...
DataTypes::RealVectorType::size_type | getPointOffset (int sampleNo, int dataPointNo)
size_t | getMaxSampleSize () const
const DataTypes::RealVectorType * | resolveSample (int sampleNo, size_t &roffset) const
| Compute the value of the expression for the given sample. More...
const DataTypes::CplxVectorType * | resolveTypedSample (int sampleNo, size_t &roffset, DataTypes::cplx_t dummy) const
const DataTypes::RealVectorType * | resolveTypedSample (int sampleNo, size_t &roffset, DataTypes::real_t dummy) const
bool | actsExpanded () const
| if resolve() was called would it produce expanded data. More...
virtual void | setToZero ()
| Produces an IDENTITY DataLazy containing zero. The result will have the same shape and functionspace as before. More...
void | resolveGroupWorker (std::vector< DataLazy * > &dats)
Public Member Functions inherited from escript::DataAbstract
DataAbstract_ptr | getPtr ()
| Return shared pointer managing this object. More...
const_DataAbstract_ptr | getPtr () const
| DataAbstract (const FunctionSpace &what, const ShapeType &shape, bool isDataEmpty=false, bool isCplx=false)
| Constructor for DataAbstract. More...
virtual | ~DataAbstract ()
| Destructor for DataAbstract. More...
virtual void | dump (const std::string fileName) const
| dumps the object into a netCDF file More...
int | getNumDPPSample () const
| Return the number of data points per sample. More...
int | getNumSamples () const
| Return the number of samples. More...
bool | hasNoSamples () const
const DataTypes::ShapeType & | getShape () const
| Return the shape information for the point data. More...
unsigned int | getRank () const
| Return the rank information for the point data. More...
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 thrown. More...
virtual DataTypes::cplx_t * | getSampleDataByTag (int tag, DataTypes::cplx_t dummy)
| Return the complex sample data for the given tag key. NB: If the data isn't tagged an exception will be thrown. More...
virtual size_t | getTagCount () const
| Return number of tagged values stored in the data object. More...
void | operandCheck (const DataAbstract &right) const
| Check this and the given RHS operands are compatible. Throws an exception if they aren't. More...
bool | validSamplePointNo (int samplePointNo) const
| Return true if a valid sample point number. More...
bool | validSampleNo (int sampleNo) const
| Return true if a valid sample number. More...
const FunctionSpace & | getFunctionSpace () const
| Return the function space associated with this Data object. More...
virtual void | setTaggedValue (int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
| setTaggedValue More...
virtual void | setTaggedValue (int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::CplxVectorType &value, int dataOffset=0)
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. More...
virtual void | copyToDataPoint (const int sampleNo, const int dataPointNo, const DataTypes::cplx_t value)
virtual void | copyToDataPoint (const int sampleNo, const int dataPointNo, const WrappedArray &value)
| Copy the array object to the data point dataPointNo of sample sampleNo in this object. More...
virtual int | getTagNumber (int dpno)
| Return the tag number associated with the given data-point number. More...
virtual void | symmetric (DataAbstract *ev)
| Computes a symmetric matrix (A + AT) / 2. More...
virtual void | antisymmetric (DataAbstract *ev)
| Computes a antisymmetric matrix (A - AT) / 2. More...
virtual void | hermitian (DataAbstract *ev)
| Computes a symmetric matrix (A + A*) / 2. More...
virtual void | antihermitian (DataAbstract *ev)
| Computes a antisymmetric matrix (A - A*) / 2. More...
virtual void | trace (DataAbstract *ev, int axis_offset)
| Computes the trace of a matrix. More...
virtual void | transpose (DataAbstract *ev, int axis_offset)
| Transpose each data point of this Data object around the given axis. More...
virtual void | swapaxes (DataAbstract *ev, int axis0, int axis1)
| swaps components axis0 and axis1 More...
virtual void | eigenvalues (DataAbstract *ev)
| solves the eigenvalue problem this*V=ev*V for the eigenvalues ev More...
virtual int | matrixInverse (DataAbstract *out) const
| invert square matricies More...
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 More...
virtual void | reorderByReferenceIDs (DataTypes::dim_t *reference_ids)
| reorders data sample ordered by reference_ids to the ordering of the functions space More...
unsigned int | getNoValues () const
| Return the number of values in the shape for this object. More...
bool | isLazy () const
virtual bool | isConstant () const
virtual bool | isExpanded () const
virtual bool | isTagged () const
bool | isEmpty () const
bool | isComplex () const
| true if the components of datapoints are complex More...
virtual void | complicate ()

## Private Types

typedef DataAbstract | parent
typedef DataTypes::ShapeType | ShapeType

## Private Member Functions

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 DataLazy into an IDENTITY storing the value of the expression. This method uses the original methods on the Data class to evaluate the expressions. For this reason, it should not be used on DataExpanded instances. (To do so would defeat the purpose of using DataLazy in the first place). More...
DataReady_ptr | collapseToReady () const
| Evaluates the expression using methods on Data. This does the work for the collapse method. For reasons of efficiency do not call this method on DataExpanded nodes. More...
void | resolveToIdentity ()
| resolve the expression can store it in the current node The current node will be converted to an identity node. More...
void | makeIdentity (const DataReady_ptr &p)
| helper method for resolveToIdentity and the identity constructor More...
DataReady_ptr | resolveNodeWorker ()
| resolve to a ReadyData object using storage at nodes More...
DataReady_ptr | resolveNodeWorkerCplx ()

## Private Attributes

int * | m_sampleids
DataTypes::RealVectorType | m_samples_r
DataTypes::CplxVectorType | m_samples_c
DataReady_ptr | m_id
DataLazy_ptr | m_left
DataLazy_ptr | m_right
DataLazy_ptr | m_mask
ES_optype | m_op
ES_opgroup | m_opgroup
size_t | m_samplesize
char | m_readytype
int | m_axis_offset
int | m_transpose
int | m_SL
int | m_SM
int | m_SR
double | m_tol
size_t | m_children
size_t | m_height

## Additional Inherited Members

Public Types inherited from escript::DataAbstract
typedef DataTypes::ShapeType | ShapeType
Protected Attributes inherited from escript::DataAbstract
int | m_noSamples
int | m_noDataPointsPerSample
bool | m_iscompl

## Detailed Description

Wraps an expression tree of other DataObjects. The data will be evaluated when required.

NOTE: This class assumes that the Data being pointed at are immutable.

## Member Typedef Documentation

## parent

typedef DataAbstract escript::DataLazy::parent

private

## ShapeType

typedef DataTypes::ShapeType escript::DataLazy::ShapeType

private

## Constructor & Destructor Documentation

## DataLazy() [1/8]

escript::DataLazy::DataLazy | ( | DataAbstract_ptr | p | ) |

Create an IDENTITY DataLazy for the given DataAbstract.

Parameters

  p | DataAbstract to be wrapped.

Exceptions

  DataException | if p is lazy data or it is not constant, tagged or expanded.

References LAZYDEBUG, m_id, m_samplesize, and makeIdentity().

## DataLazy() [2/8]

escript::DataLazy::DataLazy | ( | DataAbstract_ptr | left,
|  | ES_optype | op
| ) |  |

Produce a DataLazy for a unary operation.

Parameters

  left | DataAbstract to be operated on.
  op | unary operation to perform.

Exceptions

  DataException | if op is not a unary operation or if p cannot be converted to a DataLazy. Note that IDENTITY is not considered a unary operation.

References collapse(), escript::DataAbstract::DataLazy, escript::G_NP1OUT, escript::G_REDUCTION, escript::G_UNARY, escript::G_UNARY_C, escript::G_UNARY_R, escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), escript::IDENTITY, LazyNodeSetup(), m_children, m_height, escript::DataAbstract::m_iscompl, m_left, m_readytype, m_samplesize, and SIZELIMIT.

## DataLazy() [3/8]

escript::DataLazy::DataLazy | ( | DataAbstract_ptr | left,
|  | ES_optype | op,
|  | double | tol
| ) |  |

Produce a DataLazy for a unary operation.

Parameters

  left | DataAbstract to be operated on.
  op | unary operation to perform.
  tol | tolerance for operation

Exceptions

  DataException | if op is not a unary operation or if p cannot be converted to a DataLazy. Note that IDENTITY is not considered a unary operation.

References collapse(), escript::DataAbstract::DataLazy, escript::G_UNARY_P, escript::G_UNARY_PR, escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::IDENTITY, LAZYDEBUG, LazyNodeSetup(), m_children, m_height, escript::DataAbstract::m_iscompl, m_left, m_op, m_opgroup, m_readytype, m_samplesize, and SIZELIMIT.

## DataLazy() [4/8]

escript::DataLazy::DataLazy | ( | DataAbstract_ptr | left,
|  | ES_optype | op,
|  | int | axis_offset
| ) |  |

Produce a DataLazy for a unary operation which requires a parameter.

Parameters

  left | DataAbstract to be operated on.
  op | unary operation to perform.
  axis_offset | the parameter for the operation

Exceptions

  DataException | if op is not a unary operation or if p cannot be converted to a DataLazy. Note that IDENTITY is not considered a unary operation.

References collapse(), escript::DataAbstract::DataLazy, escript::G_NP1OUT_P, escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), escript::IDENTITY, LAZYDEBUG, LazyNodeSetup(), m_children, m_height, escript::DataAbstract::m_iscompl, m_left, m_op, m_readytype, m_samplesize, and SIZELIMIT.

## DataLazy() [5/8]

escript::DataLazy::DataLazy | ( | DataAbstract_ptr | left,
|  | DataAbstract_ptr | right,
|  | ES_optype | op
| ) |  |

Produce a DataLazy for a binary operation.

Parameters

  left | left operand
  right | right operand
  op | unary operation to perform.

Exceptions

  DataException | if op is not a binary operation or if left or right cannot be converted to a DataLazy.

References escript::Data::borrowDataPtr(), collapse(), escript::DataAbstract::DataLazy, escript::G_BINARY, escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), escript::IDENTITY, LAZYDEBUG, LazyNodeSetup(), m_children, m_height, escript::DataAbstract::m_iscompl, m_left, m_op, m_readytype, m_right, m_samplesize, escript::makePromote(), and SIZELIMIT.

## DataLazy() [6/8]

escript::DataLazy::DataLazy | ( | DataAbstract_ptr | left,
|  | DataAbstract_ptr | right,
|  | ES_optype | op,
|  | int | axis_offset,
|  | int | transpose
| ) |  |

Produce a DataLazy for a binary operation with additional paramters.

Parameters

  left | left operand
  right | right operand
  op | unary operation to perform.
  axis_offset |
  transpose |

Exceptions

  DataException | if op is not a binary operation requiring parameters or if left or right cannot be converted to a DataLazy.

References escript::Data::borrowDataPtr(), collapse(), escript::DataAbstract::DataLazy, escript::G_TENSORPROD, escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), escript::IDENTITY, LAZYDEBUG, LazyNodeSetup(), m_children, m_height, escript::DataAbstract::m_iscompl, m_left, m_op, m_readytype, m_right, m_samplesize, escript::makePromote(), SIZELIMIT, and escript::DataAbstract::transpose().

## DataLazy() [7/8]

escript::DataLazy::DataLazy | ( | DataAbstract_ptr | left,
|  | ES_optype | op,
|  | const int | axis0,
|  | const int | axis1
| ) |  |

Produce a DataLazy for a unary operation which requires two integer parameters.

Parameters

  left | DataAbstract to be operated on.
  op | unary operation to perform.
  axis0 | the first parameter for the operation
  axis1 | the second parameter for the operation

Exceptions

  DataException | if op is not a unary operation or if p cannot be converted to a DataLazy. Note that IDENTITY is not considered a unary operation.

References collapse(), escript::DataAbstract::DataLazy, escript::G_NP1OUT_2P, escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), escript::IDENTITY, LAZYDEBUG, LazyNodeSetup(), m_children, m_height, escript::DataAbstract::m_iscompl, m_left, m_op, m_readytype, m_samplesize, and SIZELIMIT.

## DataLazy() [8/8]

escript::DataLazy::DataLazy | ( | DataAbstract_ptr | mask,
|  | DataAbstract_ptr | left,
|  | DataAbstract_ptr | right
| ) |  |

Produce a DataLazy for a unary operation which requires two integer parameters.

Parameters

  mask | scalar mask to select values.
  left | DataAbstract to use for true mask.
  right | DataAbstract to use for false mask.

References collapse(), escript::DataAbstract::DataLazy, escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::IDENTITY, LAZYDEBUG, LazyNodeSetup(), m_children, m_height, escript::DataAbstract::m_iscompl, m_left, m_mask, m_op, m_readytype, m_right, m_samplesize, escript::makePromote(), and SIZELIMIT.

## ~DataLazy()

escript::DataLazy::~DataLazy | ( |  | ) |

References m_sampleids.

## Member Function Documentation

## actsExpanded()

bool escript::DataLazy::actsExpanded | ( |  | ) | const

virtual

if resolve() was called would it produce expanded data.

Reimplemented from escript::DataAbstract.

References m_readytype.

## collapse()

void escript::DataLazy::collapse | ( |  | ) | const

private

Converts the DataLazy into an IDENTITY storing the value of the expression. This method uses the original methods on the Data class to evaluate the expressions. For this reason, it should not be used on DataExpanded instances. (To do so would defeat the purpose of using DataLazy in the first place).

References collapseToReady(), escript::getOpgroup(), escript::IDENTITY, m_children, m_height, m_id, m_op, m_opgroup, and m_readytype.

Referenced by DataLazy(), getPointOffset(), resolveNodeSample(), resolveNodeWorker(), and resolveNodeWorkerCplx().

## collapseToReady()

DataReady_ptr escript::DataLazy::collapseToReady | ( |  | ) | const

private

Evaluates the expression using methods on Data. This does the work for the collapse method. For reasons of efficiency do not call this method on DataExpanded nodes.

References escript::Data::abs(), escript::ABS, escript::Data::acos(), escript::ACOS, escript::Data::acosh(), escript::ACOSH, escript::ADD, escript::Data::antihermitian(), escript::Data::antisymmetric(), escript::Data::asin(), escript::ASIN, escript::Data::asinh(), escript::ASINH, escript::Data::atan(), escript::ATAN, escript::Data::atanh(), escript::ATANH, escript::Data::borrowReadyPtr(), escript::C_GeneralTensorProduct(), escript::Data::complicate(), escript::Data::copy(), escript::Data::cos(), escript::COS, escript::Data::cosh(), escript::COSH, escript::DIV, escript::Data::erf(), escript::ERF, escript::Data::exp(), escript::EXP, escript::EZ, escript::G_BINARY, escript::G_TENSORPROD, escript::GEZ, escript::GZ, escript::HER, escript::Data::hermitian(), escript::IDENTITY, escript::LEZ, escript::Data::log(), escript::LOG, escript::Data::log10(), escript::LOG10, escript::LZ, m_axis_offset, m_id, m_left, m_op, m_opgroup, m_readytype, m_right, m_tol, m_transpose, escript::MAXVAL, escript::Data::minval(), escript::MINVAL, escript::MUL, escript::Data::neg(), escript::NEG, escript::NEZ, escript::NHER, escript::NSYM, escript::Data::oneOver(), escript::opToString(), escript::POS, escript::POW, escript::Data::powD(), escript::PROD, escript::PROM, escript::RECIP, escript::Data::sign(), escript::SIGN, escript::Data::sin(), escript::SIN, escript::Data::sinh(), escript::SINH, escript::Data::sqrt(), escript::SQRT, escript::SUB, escript::SWAP, escript::Data::swapaxes(), escript::SYM, escript::Data::symmetric(), escript::Data::tan(), escript::TAN, escript::Data::tanh(), escript::TANH, escript::Data::trace(), escript::TRACE, escript::TRANS, escript::Data::transpose(), escript::Data::whereNegative(), escript::Data::whereNonNegative(), escript::Data::whereNonPositive(), escript::Data::whereNonZero(), escript::Data::wherePositive(), and escript::Data::whereZero().

Referenced by collapse().

## deepCopy()

DataAbstract * escript::DataLazy::deepCopy | ( |  | ) | const

virtual

Return a deep copy of the current object.

Implements escript::DataAbstract.

References escript::DataAbstract::DataLazy, escript::G_BINARY, escript::G_CONDEVAL, escript::G_IDENTITY, escript::G_NP1OUT, escript::G_NP1OUT_2P, escript::G_NP1OUT_P, escript::G_REDUCTION, escript::G_TENSORPROD, escript::G_UNARY, escript::G_UNARY_C, escript::G_UNARY_P, escript::G_UNARY_PR, escript::G_UNARY_R, m_axis_offset, m_id, m_left, m_mask, m_op, m_opgroup, m_right, m_tol, m_transpose, and escript::opToString().

## getLength()

DataTypes::RealVectorType::size_type escript::DataLazy::getLength | ( |  | ) | const

virtual

This method throws an exception. It does not really make sense to ask this question of lazy data.

Implements escript::DataAbstract.

## getMaxSampleSize()

size_t escript::DataLazy::getMaxSampleSize | ( |  | ) | const

Returns
  the largest samplesize required to evaluate the expression.

## getPointOffset() [1/2]

DataTypes::RealVectorType::size_type escript::DataLazy::getPointOffset | ( | int | sampleNo,
|  | int | dataPointNo
| ) |  |

References collapse(), escript::IDENTITY, m_id, m_left, m_op, m_readytype, and m_right.

## getPointOffset() [2/2]

DataTypes::RealVectorType::size_type escript::DataLazy::getPointOffset | ( | int | sampleNo,
|  | int | dataPointNo
| ) |  | const

virtual

Return the offset for the given sample. This returns the offset for the given point into the container holding the point data.

Parameters

  sampleNo | - Input - sample number.
  dataPointNo | - Input - data point number.

Implements escript::DataAbstract.

References escript::IDENTITY, m_id, m_left, m_op, m_readytype, and m_right.

## getSlice()

DataAbstract * escript::DataLazy::getSlice | ( | const DataTypes::RegionType & | region | ) | const

virtual

Return the given slice from this object.

NB: The caller is responsible for managing the object created.

Implements escript::DataAbstract.

## intoString()

void escript::DataLazy::intoString | ( | std::ostringstream & | oss | ) | const

private

Does the work for toString.

References escript::G_BINARY, escript::G_CONDEVAL, escript::G_IDENTITY, escript::G_NP1OUT, escript::G_NP1OUT_2P, escript::G_NP1OUT_P, escript::G_REDUCTION, escript::G_TENSORPROD, escript::G_UNARY, escript::G_UNARY_C, escript::G_UNARY_P, escript::G_UNARY_PR, escript::G_UNARY_R, escript::DataAbstract::isComplex(), m_axis_offset, m_id, m_left, m_mask, m_op, m_opgroup, m_right, m_transpose, and escript::opToString().

Referenced by toString().

## intoTreeString()

void escript::DataLazy::intoTreeString | ( | std::ostringstream & | oss,
|  | std::string | indent
| ) |  | const

private

Warning
  internal use only!!

References escript::G_BINARY, escript::G_IDENTITY, escript::G_NP1OUT, escript::G_NP1OUT_2P, escript::G_NP1OUT_P, escript::G_REDUCTION, escript::G_TENSORPROD, escript::G_UNARY, escript::G_UNARY_C, escript::G_UNARY_P, escript::G_UNARY_PR, escript::G_UNARY_R, escript::DataAbstract::isComplex(), m_axis_offset, m_id, m_left, m_op, m_opgroup, escript::DataAbstract::m_rank, m_right, m_samplesize, m_transpose, and escript::opToString().

Referenced by toString().

## LazyNodeSetup()

void escript::DataLazy::LazyNodeSetup | ( |  | ) |

private

Allocates sample storage at each node

Referenced by DataLazy().

## makeIdentity()

void escript::DataLazy::makeIdentity | ( | const DataReady_ptr & | p | ) |

private

helper method for resolveToIdentity and the identity constructor

References escript::getOpgroup(), escript::IDENTITY, m_axis_offset, m_children, m_height, m_id, escript::DataAbstract::m_iscompl, m_left, m_op, m_opgroup, m_readytype, m_right, m_samplesize, m_SL, m_SM, m_SR, and m_transpose.

Referenced by DataLazy(), and resolveToIdentity().

## resolve()

DataReady_ptr escript::DataLazy::resolve | ( |  | ) |

virtual

Evaluate the lazy expression.

Returns
  A DataReady with the value of the lazy expresion.

Implements escript::DataAbstract.

References m_id, and resolveToIdentity().

## resolveGroupWorker()

void escript::DataLazy::resolveGroupWorker | ( | std::vector< DataLazy * > & | dats | ) |

References escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getNoValues(), escript::FunctionSpace::getNumSamples(), escript::DataAbstract::getPtr(), escript::DataAbstract::getShape(), escript::IDENTITY, m_op, m_readytype, and m_samplesize.

## resolveNodeBinary()

const DataTypes::RealVectorType * escript::DataLazy::resolveNodeBinary | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::ADD, escript::DIV, LAZYDEBUG, m_left, m_op, m_right, m_samples_r, m_samplesize, escript::MUL, escript::opToString(), escript::POW, escript::DataTypes::shapeToString(), escript::SUB, and toString().

Referenced by resolveNodeSample().

## resolveNodeBinaryCplx()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeBinaryCplx | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::ADD, escript::DIV, LAZYDEBUG, m_left, m_op, m_right, m_samples_c, m_samplesize, escript::MUL, escript::opToString(), escript::POW, escript::DataTypes::shapeToString(), escript::SUB, and toString().

Referenced by resolveNodeSampleCplx().

## resolveNodeCondEval()

const DataTypes::RealVectorType * escript::DataLazy::resolveNodeCondEval | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::CONDEVAL, m_left, m_mask, m_op, m_readytype, m_right, m_samples_r, and m_samplesize.

Referenced by resolveNodeSample().

## resolveNodeCondEvalCplx()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeCondEvalCplx | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::CONDEVAL, m_left, m_mask, m_op, m_readytype, m_right, m_samples_c, and m_samplesize.

Referenced by resolveNodeSampleCplx().

## resolveNodeNP1OUT()

const DataTypes::RealVectorType * escript::DataLazy::resolveNodeNP1OUT | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::antisymmetric(), escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), escript::IDENTITY, m_left, m_op, m_readytype, m_samples_r, m_samplesize, escript::NSYM, escript::opToString(), escript::SYM, and escript::symmetric().

Referenced by resolveNodeSample().

## resolveNodeNP1OUT_2P()

const DataTypes::RealVectorType * escript::DataLazy::resolveNodeNP1OUT_2P | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), escript::IDENTITY, m_axis_offset, m_left, m_op, m_readytype, m_samples_r, m_samplesize, m_transpose, escript::opToString(), escript::SWAP, and escript::swapaxes().

Referenced by resolveNodeSample().

## resolveNodeNP1OUT_2PCplx()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeNP1OUT_2PCplx | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), escript::IDENTITY, m_axis_offset, m_left, m_op, m_readytype, m_samples_c, m_samplesize, m_transpose, escript::opToString(), escript::SWAP, and escript::swapaxes().

Referenced by resolveNodeSampleCplx().

## resolveNodeNP1OUT_P()

const DataTypes::RealVectorType * escript::DataLazy::resolveNodeNP1OUT_P | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), escript::IDENTITY, m_axis_offset, m_left, m_op, m_readytype, m_samples_r, m_samplesize, escript::opToString(), escript::trace(), escript::TRACE, escript::TRANS, and escript::transpose().

Referenced by resolveNodeSample().

## resolveNodeNP1OUT_PCplx()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeNP1OUT_PCplx | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), escript::IDENTITY, m_axis_offset, m_left, m_op, m_readytype, m_samples_c, m_samplesize, escript::opToString(), escript::trace(), escript::TRACE, escript::TRANS, and escript::transpose().

Referenced by resolveNodeSampleCplx().

## resolveNodeNP1OUTCplx()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeNP1OUTCplx | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::antihermitian(), escript::antisymmetric(), escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), escript::HER, escript::hermitian(), escript::IDENTITY, m_left, m_op, m_readytype, m_samples_c, m_samplesize, escript::NHER, escript::NSYM, escript::opToString(), escript::SYM, and escript::symmetric().

Referenced by resolveNodeSampleCplx().

## resolveNodeReduction()

const DataTypes::RealVectorType * escript::DataLazy::resolveNodeReduction | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::DataAbstract::getNumDPPSample(), escript::IDENTITY, m_left, m_op, m_readytype, m_samples_r, m_samplesize, escript::MAXVAL, escript::MINVAL, escript::DataTypes::noValues(), escript::opToString(), and escript::reductionOpVector().

Referenced by resolveNodeSample().

## resolveNodeReductionCplx()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeReductionCplx | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::IDENTITY, m_op, and m_readytype.

Referenced by resolveNodeSampleCplx().

## resolveNodeSample()

const DataTypes::RealVectorType * escript::DataLazy::resolveNodeSample | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References collapse(), escript::G_BINARY, escript::G_CONDEVAL, escript::G_NP1OUT, escript::G_NP1OUT_2P, escript::G_NP1OUT_P, escript::G_REDUCTION, escript::G_TENSORPROD, escript::G_UNARY, escript::G_UNARY_P, escript::G_UNARY_PR, escript::G_UNARY_R, escript::groupToString(), escript::IDENTITY, LAZYDEBUG, m_id, m_op, m_opgroup, m_readytype, m_sampleids, m_samples_r, m_samplesize, escript::opToString(), resolveNodeBinary(), resolveNodeCondEval(), resolveNodeNP1OUT(), resolveNodeNP1OUT_2P(), resolveNodeNP1OUT_P(), resolveNodeReduction(), resolveNodeTProd(), resolveNodeUnary(), and toString().

Referenced by resolveNodeWorker(), resolveSample(), and resolveTypedSample().

## resolveNodeSampleCplx()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeSampleCplx | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::G_BINARY, escript::G_CONDEVAL, escript::G_NP1OUT, escript::G_NP1OUT_2P, escript::G_NP1OUT_P, escript::G_REDUCTION, escript::G_TENSORPROD, escript::G_UNARY, escript::G_UNARY_C, escript::G_UNARY_P, escript::IDENTITY, LAZYDEBUG, m_id, m_op, m_opgroup, m_readytype, m_sampleids, m_samples_c, m_samplesize, escript::opToString(), resolveNodeBinaryCplx(), resolveNodeCondEvalCplx(), resolveNodeNP1OUT_2PCplx(), resolveNodeNP1OUT_PCplx(), resolveNodeNP1OUTCplx(), resolveNodeReductionCplx(), resolveNodeTProdCplx(), resolveNodeUnary_C(), resolveNodeUnaryCplx(), and toString().

Referenced by resolveNodeWorkerCplx(), and resolveTypedSample().

## resolveNodeTProd()

const DataTypes::RealVectorType * escript::DataLazy::resolveNodeTProd | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), LAZYDEBUG, m_left, m_op, m_right, m_samples_r, m_samplesize, m_SL, m_SM, m_SR, m_transpose, escript::matrix_matrix_product(), escript::opToString(), escript::DataTypes::pointToString(), escript::PROD, escript::DataTypes::shapeToString(), and toString().

Referenced by resolveNodeSample().

## resolveNodeTProdCplx()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeTProdCplx | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), LAZYDEBUG, m_left, m_op, m_right, m_samples_c, m_samplesize, m_SL, m_SM, m_SR, m_transpose, escript::matrix_matrix_product(), escript::opToString(), escript::DataTypes::pointToString(), escript::PROD, escript::DataTypes::shapeToString(), and toString().

Referenced by resolveNodeSampleCplx().

## resolveNodeUnary()

const DataTypes::RealVectorType * escript::DataLazy::resolveNodeUnary | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::G_UNARY_PR, escript::G_UNARY_R, escript::IDENTITY, m_left, m_op, m_opgroup, m_readytype, m_samples_r, m_samplesize, m_tol, escript::POS, escript::tensor_unary_array_operation(), and escript::tensor_unary_array_operation_real().

Referenced by resolveNodeSample().

## resolveNodeUnary_C()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeUnary_C | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::IDENTITY, m_left, m_op, m_readytype, m_samples_c, m_samplesize, escript::opToString(), and escript::PROM.

Referenced by resolveNodeSampleCplx().

## resolveNodeUnaryCplx()

const DataTypes::CplxVectorType * escript::DataLazy::resolveNodeUnaryCplx | ( | int | tid,
|  | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

private

References escript::IDENTITY, m_left, m_op, m_readytype, m_samples_c, m_samplesize, m_tol, escript::POS, escript::PROM, escript::tensor_unary_array_operation(), and escript::tensor_unary_promote().

Referenced by resolveNodeSampleCplx().

## resolveNodeWorker()

DataReady_ptr escript::DataLazy::resolveNodeWorker | ( |  | ) |

private

resolve to a ReadyData object using storage at nodes

References collapse(), escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getNoValues(), escript::getNumberOfThreads(), escript::DataAbstract::getNumSamples(), escript::DataExpanded::getPointOffset(), escript::DataAbstract::getShape(), escript::DataExpanded::getVectorRW(), escript::IDENTITY, LAZYDEBUG, m_id, m_op, m_readytype, m_samplesize, and resolveNodeSample().

Referenced by resolveToIdentity().

## resolveNodeWorkerCplx()

DataReady_ptr escript::DataLazy::resolveNodeWorkerCplx | ( |  | ) |

private

References collapse(), escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getNoValues(), escript::getNumberOfThreads(), escript::DataAbstract::getNumSamples(), escript::DataExpanded::getPointOffset(), escript::DataAbstract::getShape(), escript::DataExpanded::getVectorRWC(), escript::IDENTITY, LAZYDEBUG, m_id, m_op, m_readytype, m_samplesize, and resolveNodeSampleCplx().

Referenced by resolveToIdentity().

## resolveSample()

const DataTypes::RealVectorType * escript::DataLazy::resolveSample | ( | int | sampleNo,
|  | size_t & | roffset
| ) |  | const

Compute the value of the expression for the given sample.

Returns
  Vector which stores the value of the subexpression for the given sample.

Parameters

  sampleNo | Sample number to evaluate.
  roffset | (output parameter) the offset in the return vector where the result begins.

The return value will be an existing vector so do not deallocate it.

References resolveNodeSample().

Referenced by escript::Data::getSampleDataRO().

## resolveToIdentity()

void escript::DataLazy::resolveToIdentity | ( |  | ) |

private

resolve the expression can store it in the current node The current node will be converted to an identity node.

References escript::IDENTITY, escript::DataAbstract::isComplex(), m_op, makeIdentity(), resolveNodeWorker(), and resolveNodeWorkerCplx().

Referenced by resolve().

## resolveTypedSample() [1/2]

const DataTypes::CplxVectorType * escript::DataLazy::resolveTypedSample | ( | int | sampleNo,
|  | size_t & | roffset,
|  | DataTypes::cplx_t | dummy
| ) |  | const

References resolveNodeSampleCplx().

Referenced by escript::Data::lazyAlgWorker().

## resolveTypedSample() [2/2]

const DataTypes::RealVectorType * escript::DataLazy::resolveTypedSample | ( | int | sampleNo,
|  | size_t & | roffset,
|  | DataTypes::real_t | dummy
| ) |  | const

References resolveNodeSample().

## setToZero()

void escript::DataLazy::setToZero | ( |  | ) |

virtual

Produces an IDENTITY DataLazy containing zero. The result will have the same shape and functionspace as before.

Reimplemented from escript::DataAbstract.

## toString()

std::string escript::DataLazy::toString | ( |  | ) | const

virtual

Write the data as a string.

Implements escript::DataAbstract.

References escript::escriptParams, escript::EscriptParams::getLazyStrFmt(), intoString(), intoTreeString(), and m_height.

Referenced by resolveNodeBinary(), resolveNodeBinaryCplx(), resolveNodeSample(), resolveNodeSampleCplx(), resolveNodeTProd(), and resolveNodeTProdCplx().

## zeroedCopy()

DataAbstract * escript::DataLazy::zeroedCopy | ( |  | ) | const

virtual

Return an object with the same type, domain (and tags if appropriate) as this, but all values are zeroed.

Implements escript::DataAbstract.

References escript::DataAbstract::DataLazy, and m_id.

## Member Data Documentation

## m_axis_offset

int escript::DataLazy::m_axis_offset

private

Referenced by collapseToReady(), deepCopy(), intoString(), intoTreeString(), makeIdentity(), resolveNodeNP1OUT_2P(), resolveNodeNP1OUT_2PCplx(), resolveNodeNP1OUT_P(), and resolveNodeNP1OUT_PCplx().

## m_children

size_t escript::DataLazy::m_children

mutable private

Referenced by collapse(), DataLazy(), and makeIdentity().

## m_height

size_t escript::DataLazy::m_height

mutable private

Referenced by collapse(), DataLazy(), makeIdentity(), and toString().

## m_id

DataReady_ptr escript::DataLazy::m_id

mutable private

Referenced by collapse(), collapseToReady(), DataLazy(), deepCopy(), getPointOffset(), intoString(), intoTreeString(), makeIdentity(), resolve(), resolveNodeSample(), resolveNodeSampleCplx(), resolveNodeWorker(), resolveNodeWorkerCplx(), and zeroedCopy().

## m_left

DataLazy_ptr escript::DataLazy::m_left

mutable private

Referenced by collapseToReady(), DataLazy(), deepCopy(), getPointOffset(), intoString(), intoTreeString(), makeIdentity(), resolveNodeBinary(), resolveNodeBinaryCplx(), resolveNodeCondEval(), resolveNodeCondEvalCplx(), resolveNodeNP1OUT(), resolveNodeNP1OUT_2P(), resolveNodeNP1OUT_2PCplx(), resolveNodeNP1OUT_P(), resolveNodeNP1OUT_PCplx(), resolveNodeNP1OUTCplx(), resolveNodeReduction(), resolveNodeTProd(), resolveNodeTProdCplx(), resolveNodeUnary(), resolveNodeUnary_C(), and resolveNodeUnaryCplx().

## m_mask

DataLazy_ptr escript::DataLazy::m_mask

private

Referenced by DataLazy(), deepCopy(), intoString(), resolveNodeCondEval(), and resolveNodeCondEvalCplx().

## m_op

ES_optype escript::DataLazy::m_op

mutable private

Referenced by collapse(), collapseToReady(), DataLazy(), deepCopy(), getPointOffset(), intoString(), intoTreeString(), makeIdentity(), resolveGroupWorker(), resolveNodeBinary(), resolveNodeBinaryCplx(), resolveNodeCondEval(), resolveNodeCondEvalCplx(), resolveNodeNP1OUT(), resolveNodeNP1OUT_2P(), resolveNodeNP1OUT_2PCplx(), resolveNodeNP1OUT_P(), resolveNodeNP1OUT_PCplx(), resolveNodeNP1OUTCplx(), resolveNodeReduction(), resolveNodeReductionCplx(), resolveNodeSample(), resolveNodeSampleCplx(), resolveNodeTProd(), resolveNodeTProdCplx(), resolveNodeUnary(), resolveNodeUnary_C(), resolveNodeUnaryCplx(), resolveNodeWorker(), resolveNodeWorkerCplx(), and resolveToIdentity().

## m_opgroup

ES_opgroup escript::DataLazy::m_opgroup

mutable private

Referenced by collapse(), collapseToReady(), DataLazy(), deepCopy(), intoString(), intoTreeString(), makeIdentity(), resolveNodeSample(), resolveNodeSampleCplx(), and resolveNodeUnary().

## m_readytype

char escript::DataLazy::m_readytype

private

Referenced by actsExpanded(), collapse(), collapseToReady(), DataLazy(), getPointOffset(), makeIdentity(), resolveGroupWorker(), resolveNodeCondEval(), resolveNodeCondEvalCplx(), resolveNodeNP1OUT(), resolveNodeNP1OUT_2P(), resolveNodeNP1OUT_2PCplx(), resolveNodeNP1OUT_P(), resolveNodeNP1OUT_PCplx(), resolveNodeNP1OUTCplx(), resolveNodeReduction(), resolveNodeReductionCplx(), resolveNodeSample(), resolveNodeSampleCplx(), resolveNodeUnary(), resolveNodeUnary_C(), resolveNodeUnaryCplx(), resolveNodeWorker(), and resolveNodeWorkerCplx().

## m_right

DataLazy_ptr escript::DataLazy::m_right

private

Referenced by collapseToReady(), DataLazy(), deepCopy(), getPointOffset(), intoString(), intoTreeString(), makeIdentity(), resolveNodeBinary(), resolveNodeBinaryCplx(), resolveNodeCondEval(), resolveNodeCondEvalCplx(), resolveNodeTProd(), and resolveNodeTProdCplx().

## m_sampleids

int* escript::DataLazy::m_sampleids

private

Referenced by resolveNodeSample(), resolveNodeSampleCplx(), and ~DataLazy().

## m_samples_c

DataTypes::CplxVectorType escript::DataLazy::m_samples_c

mutable private

Referenced by resolveNodeBinaryCplx(), resolveNodeCondEvalCplx(), resolveNodeNP1OUT_2PCplx(), resolveNodeNP1OUT_PCplx(), resolveNodeNP1OUTCplx(), resolveNodeSampleCplx(), resolveNodeTProdCplx(), resolveNodeUnary_C(), and resolveNodeUnaryCplx().

## m_samples_r

DataTypes::RealVectorType escript::DataLazy::m_samples_r

mutable private

Referenced by resolveNodeBinary(), resolveNodeCondEval(), resolveNodeNP1OUT(), resolveNodeNP1OUT_2P(), resolveNodeNP1OUT_P(), resolveNodeReduction(), resolveNodeSample(), resolveNodeTProd(), and resolveNodeUnary().

## m_samplesize

size_t escript::DataLazy::m_samplesize

private

Referenced by DataLazy(), intoTreeString(), makeIdentity(), resolveGroupWorker(), resolveNodeBinary(), resolveNodeBinaryCplx(), resolveNodeCondEval(), resolveNodeCondEvalCplx(), resolveNodeNP1OUT(), resolveNodeNP1OUT_2P(), resolveNodeNP1OUT_2PCplx(), resolveNodeNP1OUT_P(), resolveNodeNP1OUT_PCplx(), resolveNodeNP1OUTCplx(), resolveNodeReduction(), resolveNodeSample(), resolveNodeSampleCplx(), resolveNodeTProd(), resolveNodeTProdCplx(), resolveNodeUnary(), resolveNodeUnary_C(), resolveNodeUnaryCplx(), resolveNodeWorker(), and resolveNodeWorkerCplx().

## m_SL

int escript::DataLazy::m_SL

private

Referenced by makeIdentity(), resolveNodeTProd(), and resolveNodeTProdCplx().

## m_SM

int escript::DataLazy::m_SM

private

Referenced by makeIdentity(), resolveNodeTProd(), and resolveNodeTProdCplx().

## m_SR

int escript::DataLazy::m_SR

private

Referenced by makeIdentity(), resolveNodeTProd(), and resolveNodeTProdCplx().

## m_tol

double escript::DataLazy::m_tol

private

Referenced by collapseToReady(), deepCopy(), resolveNodeUnary(), and resolveNodeUnaryCplx().

## m_transpose

int escript::DataLazy::m_transpose

private

Referenced by collapseToReady(), deepCopy(), intoString(), intoTreeString(), makeIdentity(), resolveNodeNP1OUT_2P(), resolveNodeNP1OUT_2PCplx(), resolveNodeTProd(), and resolveNodeTProdCplx().

The documentation for this class was generated from the following files:

- DataLazy.h
- DataLazy.cpp