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:

escript::DataAbstract

List of all members.

Public Member Functions

 DataLazy (DataAbstract_ptr p)
 Create an IDENTITY DataLazy for the given DataAbstract.
 DataLazy (DataAbstract_ptr left, ES_optype op)
 Produce a DataLazy for a unary operation.
 DataLazy (DataAbstract_ptr left, ES_optype op, double tol)
 Produce a DataLazy for a unary operation.
 DataLazy (DataAbstract_ptr left, ES_optype op, int axis_offset)
 Produce a DataLazy for a unary operation which requires a parameter.
 DataLazy (DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op)
 Produce a DataLazy for a binary operation.
 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.
 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.
 ~DataLazy ()
DataReady_ptr resolve ()
 Evaluate the lazy expression.
std::string toString () const
 Write the data as a string.
DataAbstractdeepCopy ()
 Return a deep copy of the current object.
ValueType::size_type getLength () const
 This method throws an exception. It does not really make sense to ask this question of lazy data.
DataAbstractgetSlice (const DataTypes::RegionType &region) const
 Return the given slice from this object.
DataTypes::ValueType::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.
DataTypes::ValueType::size_type getPointOffset (int sampleNo, int dataPointNo)
int getBuffsRequired () const
size_t getMaxSampleSize () const
size_t getSampleBufferSize () const
const ValueTyperesolveSample (BufferGroup &bg, int sampleNo, size_t &roffset)
 Compute the value of the expression for the given sample.
bool actsExpanded () const
 if resolve() was called would it produce expanded data.
virtual void setToZero ()
 Produces an IDENTITY DataLazy containing zero. The result will have the same shape and functionspace as before.

Private Types

typedef DataAbstract parent
typedef DataTypes::ValueType ValueType
typedef DataTypes::ShapeType ShapeType

Private Member Functions

void LazyNodeSetup ()
const DataTypes::ValueTyperesolveNodeUnary (int tid, int sampleNo, size_t &roffset)
const DataTypes::ValueTyperesolveNodeSample (int tid, int sampleNo, size_t &roffset)
const DataTypes::ValueTyperesolveNodeBinary (int tid, int sampleNo, size_t &roffset)
const DataTypes::ValueTyperesolveNodeNP1OUT (int tid, int sampleNo, size_t &roffset)
const DataTypes::ValueTyperesolveNodeNP1OUT_P (int tid, int sampleNo, size_t &roffset)
const DataTypes::ValueTyperesolveNodeTProd (int tid, int sampleNo, size_t &roffset)
const DataTypes::ValueTyperesolveNodeNP1OUT_2P (int tid, int sampleNo, size_t &roffset)
void intoString (std::ostringstream &oss) const
void collapse ()
 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).
DataReady_ptr collapseToReady ()
 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.
void resolveToIdentity ()
 resolve the expression can store it in the current node The current node will be converted to an identity node.
void makeIdentity (const DataReady_ptr &p)
 helper method for resolveToIdentity and the identity constructor
DataReady_ptr resolveVectorWorker ()
 resolve to a ReadyData object using a vector buffer.
DataReady_ptr resolveNodeWorker ()
 resolve to a ReadyData object using storage at nodes
const ValueTyperesolveVectorSample (ValueType &v, size_t offset, int sampleNo, size_t &roffset)
 Compute the value of the expression for the given sample - using the vector buffer approach.
ValueTyperesolveUnary (ValueType &v, size_t offset, int sampleNo, size_t &roffset) const
 Compute the value of the expression (unary operation) for the given sample.
ValueTyperesolveNP1OUT (ValueType &v, size_t offset, int sampleNo, size_t &roffset) const
 Compute the value of the expression (unary non-pointwise operation) for the given sample.
DataTypes::ValueTyperesolveNP1OUT_P (ValueType &v, size_t offset, int sampleNo, size_t &roffset) const
 Compute the value of the expression (unary operation) for the given sample.
DataTypes::ValueTyperesolveNP1OUT_2P (ValueType &v, size_t offset, int sampleNo, size_t &roffset) const
 Compute the value of the expression (unary operation with int params) for the given sample.
ValueTyperesolveBinary (ValueType &v, size_t offset, int sampleNo, size_t &roffset) const
 Compute the value of the expression (binary operation) for the given sample.
DataTypes::ValueTyperesolveTProd (ValueType &v, size_t offset, int sampleNo, size_t &roffset) const
 Compute the value of the expression (tensor product) for the given sample.

Private Attributes

DataReady_ptr m_id
DataLazy_ptr m_left
DataLazy_ptr m_right
ES_optype m_op
int m_buffsRequired
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_maxsamplesize
size_t m_children
size_t m_height
int * m_sampleids
DataVector m_samples


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

Reimplemented from escript::DataAbstract.

Reimplemented from escript::DataAbstract.


Constructor & Destructor Documentation

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().

Referenced by DataLazy(), and deepCopy().

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 escript::calcBuffs(), DataLazy(), escript::G_NP1OUT, escript::G_UNARY, escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), LazyNodeSetup(), m_buffsRequired, m_children, m_height, m_left, m_maxsamplesize, m_op, m_readytype, m_right, m_samplesize, and SIZELIMIT.

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 escript::calcBuffs(), DataLazy(), escript::G_UNARY_P, escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), LAZYDEBUG, LazyNodeSetup(), m_height, m_left, m_maxsamplesize, m_op, m_readytype, m_right, m_samplesize, and SIZELIMIT.

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 escript::calcBuffs(), DataLazy(), escript::G_NP1OUT_P, escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), LAZYDEBUG, LazyNodeSetup(), m_children, m_height, m_left, m_maxsamplesize, m_op, m_readytype, m_right, m_samplesize, and SIZELIMIT.

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(), escript::calcBuffs(), DataLazy(), escript::G_BINARY, escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), LAZYDEBUG, LazyNodeSetup(), m_buffsRequired, m_children, m_height, m_left, m_maxsamplesize, m_op, m_readytype, m_right, m_samplesize, and SIZELIMIT.

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(), escript::calcBuffs(), DataLazy(), escript::G_TENSORPROD, escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), LAZYDEBUG, LazyNodeSetup(), m_children, m_height, m_left, m_maxsamplesize, m_op, m_readytype, m_right, m_samplesize, and SIZELIMIT.

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 escript::calcBuffs(), DataLazy(), escript::G_NP1OUT_2P, escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::getOpgroup(), LAZYDEBUG, LazyNodeSetup(), m_height, m_left, m_maxsamplesize, m_op, m_readytype, m_right, m_samplesize, and SIZELIMIT.

escript::DataLazy::~DataLazy (  ) 

References m_sampleids, and m_samples.


Member Function Documentation

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().

std::string escript::DataLazy::toString (  )  const [virtual]

DataAbstract * escript::DataLazy::deepCopy (  )  [virtual]

DataTypes::ValueType::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.

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.

DataTypes::ValueType::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.

Referenced by resolveNP1OUT_2P(), and resolveNP1OUT_P().

DataTypes::ValueType::size_type escript::DataLazy::getPointOffset ( int  sampleNo,
int  dataPointNo 
) [virtual]

int escript::DataLazy::getBuffsRequired (  )  const

Returns:
the number of samples which need to be stored to evaluate the expression.

size_t escript::DataLazy::getMaxSampleSize (  )  const

Returns:
the largest samplesize required to evaluate the expression.

References m_maxsamplesize.

Referenced by resolveBinary().

size_t escript::DataLazy::getSampleBufferSize (  )  const [virtual]

Returns:
the size of the buffer required to evaulate a sample for this object

Implements escript::DataAbstract.

References m_maxsamplesize.

const DataTypes::ValueType * escript::DataLazy::resolveSample ( BufferGroup bg,
int  sampleNo,
size_t &  roffset 
)

Compute the value of the expression for the given sample.

Returns:
Vector which stores the value of the subexpression for the given sample.
Parameters:
bg A BufferGroup to store intermediate results.
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 escript::BufferGroup::getBuffer(), escript::BufferGroup::getOffset(), resolveNodeSample(), and resolveVectorSample().

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

bool escript::DataLazy::actsExpanded (  )  const [virtual]

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

Reimplemented from escript::DataAbstract.

References m_readytype.

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.

References privdebug.

void escript::DataLazy::LazyNodeSetup (  )  [private]

Allocates sample storage at each node

References m_sampleids, m_samples, m_samplesize, omp_get_max_threads(), and escript::DataVector::resize().

Referenced by DataLazy().

const DataTypes::ValueType * escript::DataLazy::resolveNodeUnary ( int  tid,
int  sampleNo,
size_t &  roffset 
) [private]

const DataTypes::ValueType * escript::DataLazy::resolveNodeSample ( int  tid,
int  sampleNo,
size_t &  roffset 
) [private]

const DataTypes::ValueType * escript::DataLazy::resolveNodeBinary ( int  tid,
int  sampleNo,
size_t &  roffset 
) [private]

const DataTypes::ValueType * escript::DataLazy::resolveNodeNP1OUT ( int  tid,
int  sampleNo,
size_t &  roffset 
) [private]

const DataTypes::ValueType * escript::DataLazy::resolveNodeNP1OUT_P ( int  tid,
int  sampleNo,
size_t &  roffset 
) [private]

const DataTypes::ValueType * escript::DataLazy::resolveNodeTProd ( int  tid,
int  sampleNo,
size_t &  roffset 
) [private]

const DataTypes::ValueType * escript::DataLazy::resolveNodeNP1OUT_2P ( int  tid,
int  sampleNo,
size_t &  roffset 
) [private]

void escript::DataLazy::intoString ( std::ostringstream &  oss  )  const [private]

void escript::DataLazy::collapse (  )  [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::IDENTITY, m_id, m_op, and m_readytype.

Referenced by getPointOffset(), resolveNodeSample(), resolveNodeWorker(), resolveVectorSample(), and resolveVectorWorker().

DataReady_ptr escript::DataLazy::collapseToReady (  )  [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::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::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::getOpgroup(), escript::GEZ, escript::GZ, 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_readytype, m_right, m_tol, m_transpose, escript::MUL, escript::Data::neg(), escript::NEG, escript::NEZ, escript::Data::nonsymmetric(), escript::NSYM, escript::Data::oneOver(), escript::opToString(), escript::POS, escript::PROD, 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().

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, m_op, makeIdentity(), resolveNodeWorker(), and resolveVectorWorker().

Referenced by resolve().

void escript::DataLazy::makeIdentity ( const DataReady_ptr p  )  [private]

helper method for resolveToIdentity and the identity constructor

References escript::IDENTITY, m_axis_offset, m_height, m_id, m_left, m_maxsamplesize, m_op, m_readytype, m_right, m_samplesize, m_SL, m_SM, m_SR, and m_transpose.

Referenced by DataLazy(), and resolveToIdentity().

DataReady_ptr escript::DataLazy::resolveVectorWorker (  )  [private]

DataReady_ptr escript::DataLazy::resolveNodeWorker (  )  [private]

const DataTypes::ValueType * escript::DataLazy::resolveVectorSample ( ValueType v,
size_t  offset,
int  sampleNo,
size_t &  roffset 
) [private]

Compute the value of the expression for the given sample - using the vector buffer approach.

Returns:
Vector which stores the value of the subexpression for the given sample.
Parameters:
v A vector to store intermediate results.
offset Index in v to begin storing results.
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 collapse(), escript::G_BINARY, escript::G_NP1OUT, escript::G_NP1OUT_2P, escript::G_NP1OUT_P, escript::G_TENSORPROD, escript::G_UNARY, escript::G_UNARY_P, escript::getOpgroup(), escript::IDENTITY, LAZYDEBUG, m_id, m_op, m_readytype, escript::opToString(), resolveBinary(), resolveNP1OUT(), resolveNP1OUT_2P(), resolveNP1OUT_P(), resolveTProd(), resolveUnary(), and toString().

Referenced by resolveSample(), and resolveVectorWorker().

DataTypes::ValueType * escript::DataLazy::resolveUnary ( ValueType v,
size_t  offset,
int  sampleNo,
size_t &  roffset 
) const [private]

Compute the value of the expression (unary operation) for the given sample.

Returns:
Vector which stores the value of the subexpression for the given sample.
Parameters:
v A vector to store intermediate results.
offset Index in v to begin storing results.
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. If the result is stored in v it should be stored at the offset given. Everything from offset to the end of v should be considered available for this method to use.

References escript::ABS, escript::ACOS, escript::ACOSH, escript::ASIN, escript::ASINH, escript::ATAN, escript::ATANH, escript::COS, escript::COSH, escript::ERF, escript::EXP, escript::EZ, escript::fsign(), escript::GEZ, escript::GZ, escript::LEZ, escript::LOG, escript::LOG10, escript::LZ, m_left, m_op, m_readytype, m_samplesize, m_tol, escript::NEG, escript::NEZ, escript::opToString(), escript::POS, escript::RECIP, escript::SIGN, escript::SIN, escript::SINH, escript::SQRT, escript::TAN, escript::TANH, and escript::tensor_unary_operation().

Referenced by resolveVectorSample().

DataTypes::ValueType * escript::DataLazy::resolveNP1OUT ( ValueType v,
size_t  offset,
int  sampleNo,
size_t &  roffset 
) const [private]

Compute the value of the expression (unary non-pointwise operation) for the given sample.

Returns:
Vector which stores the value of the subexpression for the given sample.
Parameters:
v A vector to store intermediate results.
offset Index in v to begin storing results.
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. If the result is stored in v it should be stored at the offset given. Everything from offset to the end of v should be considered available for this method to use.

This method differs from the one above in that deals with operations that are not point-wise. That is, the answer cannot just be written on top of the input. Extra buffers are required for these operations.

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), LAZYDEBUG, m_left, m_op, m_readytype, m_samplesize, escript::DataMaths::nonsymmetric(), escript::NSYM, escript::opToString(), escript::SYM, and escript::DataMaths::symmetric().

Referenced by resolveVectorSample().

DataTypes::ValueType * escript::DataLazy::resolveNP1OUT_P ( ValueType v,
size_t  offset,
int  sampleNo,
size_t &  roffset 
) const [private]

Compute the value of the expression (unary operation) for the given sample.

Returns:
Vector which stores the value of the subexpression for the given sample.
Parameters:
v A vector to store intermediate results.
offset Index in v to begin storing results.
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. If the result is stored in v it should be stored at the offset given. Everything from offset to the end of v should be considered available for this method to use.

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), getPointOffset(), escript::DataAbstract::getShape(), LAZYDEBUG, m_axis_offset, m_left, m_op, m_readytype, escript::opToString(), escript::DataTypes::pointToString(), escript::DataMaths::trace(), escript::TRACE, escript::TRANS, and escript::DataMaths::transpose().

Referenced by resolveVectorSample().

DataTypes::ValueType * escript::DataLazy::resolveNP1OUT_2P ( ValueType v,
size_t  offset,
int  sampleNo,
size_t &  roffset 
) const [private]

Compute the value of the expression (unary operation with int params) for the given sample.

Returns:
Vector which stores the value of the subexpression for the given sample.
Parameters:
v A vector to store intermediate results.
offset Index in v to begin storing results.
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. If the result is stored in v it should be stored at the offset given. Everything from offset to the end of v should be considered available for this method to use.

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), getPointOffset(), escript::DataAbstract::getShape(), LAZYDEBUG, m_axis_offset, m_left, m_op, m_readytype, m_transpose, escript::opToString(), escript::SWAP, and escript::DataMaths::swapaxes().

Referenced by resolveVectorSample().

DataTypes::ValueType * escript::DataLazy::resolveBinary ( ValueType v,
size_t  offset,
int  sampleNo,
size_t &  roffset 
) const [private]

Compute the value of the expression (binary operation) for the given sample.

Returns:
Vector which stores the value of the subexpression for the given sample.
Parameters:
v A vector to store intermediate results.
offset Index in v to begin storing results.
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. If the result is stored in v it should be stored at the offset given. Everything from offset to the end of v should be considered available for this method to use.

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

Referenced by resolveVectorSample().

DataTypes::ValueType * escript::DataLazy::resolveTProd ( ValueType v,
size_t  offset,
int  sampleNo,
size_t &  roffset 
) const [private]

Compute the value of the expression (tensor product) for the given sample.

Returns:
Vector which stores the value of the subexpression for the given sample.
Parameters:
v A vector to store intermediate results.
offset Index in v to begin storing results.
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. If the result is stored in v it should be stored at the offset given. Everything from offset to the end of v should be considered available for this method to use.

References escript::DataAbstract::getNoValues(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getShape(), LAZYDEBUG, m_left, m_op, m_right, 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 resolveVectorSample().


Member Data Documentation

Referenced by DataLazy().

int escript::DataLazy::m_SL [private]

int escript::DataLazy::m_SM [private]

int escript::DataLazy::m_SR [private]

double escript::DataLazy::m_tol [private]

Referenced by DataLazy().

size_t escript::DataLazy::m_height [private]

Referenced by DataLazy(), and makeIdentity().


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

Generated on Mon Aug 10 10:04:45 2009 for ESYS13 by  doxygen 1.5.6