escript  Revision_
Public Types | Public Member Functions | Private Types | Private Attributes | Static Private Attributes | List of all members
escript::DataTagged Class Reference

Simulates a full dataset accessible via sampleNo and dataPointNo. More...

#include <DataTagged.h>

Inheritance diagram for escript::DataTagged:
escript::DataReady escript::DataAbstract

Public Types

typedef std::vector< int > TagListType
 
typedef DataTypes::ValueType ValueType
 
typedef std::vector< ValueType::ElementTypeValueBatchType
 
typedef std::map< int, int > DataMapType
 
- Public Types inherited from escript::DataAbstract
typedef DataTypes::ValueType ValueType
 
typedef DataTypes::ShapeType ShapeType
 

Public Member Functions

 DataTagged ()
 Default constructor for DataTagged. More...
 
 DataTagged (const FunctionSpace &what, const DataTypes::ShapeType &shape, const int tags[], const ValueType &data)
 Alternative Constructor for DataTagged. More...
 
 DataTagged (const FunctionSpace &what, const DataTypes::ShapeType &shape, const TagListType &tags, const ValueType &data)
 Alternative Constructor for DataTagged. More...
 
 DataTagged (const DataTagged &other)
 Copy Constructor for DataTagged. Performs a deep copy from the given DataTagged object. T. More...
 
 DataTagged (const DataConstant &other)
 Copy Constructor for DataTagged. Construct a DataTagged object from a DataConstant object. The default value will be the value of the DataConstant object. T. More...
 
 DataTagged (const FunctionSpace &what, const DataTypes::ShapeType &shape, const DataTypes::ValueType &defaultvalue, const DataTagged *tagsource=0)
 Copies the tags from a DataTagged into a new Data Tagged and assigns them the default value. ** Not unit tested **. More...
 
virtual ~DataTagged ()
 Destructor. More...
 
bool isTagged () const
 
bool hasNaN () const
 Return true if any one of the datapoints contains a NaN. More...
 
void replaceNaN (double value)
 replaces all NaN values with value More...
 
virtual DataAbstractdeepCopy ()
 Return a deep copy of the current object. More...
 
virtual double * getSampleDataByTag (int tag)
 getSampleDataByTag More...
 
virtual std::string toString () const
 Write the data as a string. Writes out each tag, including the default, and the data-point which is associated with each tag. T. More...
 
virtual void dump (const std::string fileName) const
 dumps the object into a netCDF file More...
 
virtual int matrixInverse (DataAbstract *out) const
 invert square matricies More...
 
virtual void setToZero ()
 sets all values to zero More...
 
virtual int getTagNumber (int dpno)
 Return the tag number associated with the given data-point number according to the associated function space. T. More...
 
virtual ValueType::size_type getPointOffset (int sampleNo, int dataPointNo) const
 getPointOffset More...
 
virtual ValueType::size_type getPointOffset (int sampleNo, int dataPointNo)
 
void addTaggedValues (const TagListType &tagKeys, const ValueBatchType &values, const ShapeType &vShape)
 addTaggedValues More...
 
void addTaggedValues (const TagListType &tagKeys, const ValueType &values, const ShapeType &vShape)
 
void addTaggedValue (int tagKey, const DataTypes::ShapeType &pointshape, const ValueType &value, int dataOffset=0)
 addTaggedValue More...
 
void addTag (int tagKey)
 addTag - does not modify the default value for this object. ** Not unit tested ** More...
 
void setTaggedValue (int tagKey, const DataTypes::ShapeType &pointshape, const ValueType &value, int dataOffset=0)
 setTaggedValue More...
 
DataTypes::ValueType::reference getDataByTagRW (int tag, DataTypes::ValueType::size_type i)
 getDataByTag More...
 
DataTypes::ValueType::const_reference getDataByTagRO (int tag, DataTypes::ValueType::size_type i) const
 
DataTypes::ValueType::size_type getOffsetForTag (int tag) const
 getOffsetForTag More...
 
DataTypes::ValueTypegetVectorRW ()
 Return a reference to the underlying DataVector. More...
 
const DataTypes::ValueTypegetVectorRO () const
 
const DataMapTypegetTagLookup () const
 getTagLookup More...
 
bool isCurrentTag (int tag) const
 isCurrentTag More...
 
DataTypes::ValueType::reference getDefaultValueRW (DataTypes::ValueType::size_type i)
 getDefaultValue More...
 
DataTypes::ValueType::const_reference getDefaultValueRO (DataTypes::ValueType::size_type i) const
 
virtual ValueType::size_type getLength () const
 getLength More...
 
virtual DataAbstractgetSlice (const DataTypes::RegionType &region) const
 getSlice More...
 
 DataTagged (const DataTagged &other, const DataTypes::RegionType &region)
 Slice Constructor for DataTagged. More...
 
virtual void setSlice (const DataAbstract *other, const DataTypes::RegionType &region)
 setSlice More...
 
virtual void symmetric (DataAbstract *ev)
 Computes a symmetric matrix (A + AT) / 2. More...
 
virtual void nonsymmetric (DataAbstract *ev)
 Computes a nonsymmetric matrix (A - AT) / 2. More...
 
virtual void trace (DataAbstract *ev, int axis_offset)
 Computes the trace of a matrix. More...
 
virtual void swapaxes (DataAbstract *ev, int axis0, int axis1)
 swaps components axis0 and axis1 More...
 
virtual void transpose (DataAbstract *ev, int axis_offset)
 Transpose each data point of this Data object around the given axis. More...
 
virtual void eigenvalues (DataAbstract *ev)
 solves the eigenvalue problem this*V=ev*V for the eigenvalues ev 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...
 
DataTypes::ValueType::size_type getDefaultOffset () const
 Returns the offset in the structure which stores the default value. More...
 
size_t getTagCount () const
 Return the number of tags which have been given values (+the default) More...
 
- Public Member Functions inherited from escript::DataReady
 DataReady (const FunctionSpace &what, const ShapeType &shape, bool isDataEmpty=false)
 
 ~DataReady ()
 
double * getSampleDataRW (ValueType::size_type sampleNo)
 Return the sample data for the given sample number. More...
 
const double * getSampleDataRO (ValueType::size_type sampleNo) const
 
DataTypes::ValueType::const_reference getDataAtOffsetRO (DataTypes::ValueType::size_type i) const
 get a reference to the beginning of a data point More...
 
DataTypes::ValueType::reference getDataAtOffsetRW (DataTypes::ValueType::size_type i)
 
DataReady_ptr resolve ()
 Return a data object with all points resolved. More...
 
- 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)
 Constructor for DataAbstract. More...
 
virtual ~DataAbstract ()
 Destructor for DataAbstract. More...
 
int getNumDPPSample () const
 Return the number of data points per sample. More...
 
int getNumSamples () const
 Return the number of samples. More...
 
const DataTypes::ShapeTypegetShape () const
 Return the shape information for the point data. More...
 
unsigned int getRank () const
 Return the rank information for the point data. 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 FunctionSpacegetFunctionSpace () const
 Return the function space associated with this Data object. More...
 
virtual void copyToDataPoint (const int sampleNo, const int dataPointNo, const double 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 WrappedArray &value)
 Copy the array object to the data point dataPointNo of sample sampleNo in this object. More...
 
virtual void reorderByReferenceIDs (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 actsExpanded () const
 Return true if this Data is expanded or resolves to expanded. That is, if it has a separate value for each datapoint in the sample. More...
 
bool isEmpty () const
 
void addOwner (Data *)
 
void removeOwner (Data *)
 
bool isShared () const
 Is this object owned by more than one Data object. More...
 

Private Types

typedef DataReady parent
 

Private Attributes

DataMapType m_offsetLookup
 
ValueType m_data
 

Static Private Attributes

static const int m_defaultValueOffset = 0
 

Additional Inherited Members

- Protected Member Functions inherited from escript::DataAbstract
bool checkNoSharing () const
 Returns true if this object is not shared. For internal use only. - It may not be particularly fast. More...
 
void makeLazyShared ()
 Marks this DataAbstract shared as LazyData For internal use only. More...
 
- Protected Attributes inherited from escript::DataAbstract
std::vector< Data * > m_owners
 
bool m_lazyshared
 

Detailed Description

Simulates a full dataset accessible via sampleNo and dataPointNo.

Description: Each data-point has an associated tag number, and a given tag can represent a range of dataPointNo and sampleNo. Each tag indexes only a single data-point. Thus only a single data-point needs to be stored for a range of sampleNo and dataPointNo values.

Member Typedef Documentation

typedef std::map<int, int> escript::DataTagged::DataMapType
typedef std::vector<int> escript::DataTagged::TagListType

Constructor & Destructor Documentation

escript::DataTagged::DataTagged ( )

Default constructor for DataTagged.

Description: Default constructor for DataTagged. Creates a DataTagged object for which the default data-point is a scalar data-point with value 0.0, and no other tag values are stored. T

References m_data, and escript::DataVector::resize().

Referenced by deepCopy(), and getSlice().

escript::DataTagged::DataTagged ( const FunctionSpace what,
const DataTypes::ShapeType shape,
const int  tags[],
const ValueType data 
)

Alternative Constructor for DataTagged.

Description: Alternative Constructor for DataTagged.

Parameters
what- Input - A description of what this data object represents.
shape- Input - The shape of each data-point.
tags- Input - An array of tags, one for each sample number (starts at tag[1]).
data- The data values for each tag. NB: no unit testing yet

References escript::FunctionSpace::canTag(), m_data, m_offsetLookup, escript::DataTypes::noValues(), and escript::DataVector::size().

escript::DataTagged::DataTagged ( const FunctionSpace what,
const DataTypes::ShapeType shape,
const TagListType tags,
const ValueType data 
)

Alternative Constructor for DataTagged.

Description: Alternative Constructor for DataTagged.

Parameters
what- Input - A description of what this data object represents.
shape- Input - The shape of each data-point.
tags- Input - An vector of tags, one for each sample number.
data- The data values for each tag. TODO Make sure to document the relationship between tags and data, ie: data also contains the default value

References escript::FunctionSpace::canTag(), m_data, m_offsetLookup, escript::DataTypes::noValues(), and escript::DataVector::size().

escript::DataTagged::DataTagged ( const DataTagged other)

Copy Constructor for DataTagged. Performs a deep copy from the given DataTagged object. T.

escript::DataTagged::DataTagged ( const DataConstant other)
escript::DataTagged::DataTagged ( const FunctionSpace what,
const DataTypes::ShapeType shape,
const DataTypes::ValueType defaultvalue,
const DataTagged tagsource = 0 
)

Copies the tags from a DataTagged into a new Data Tagged and assigns them the default value. ** Not unit tested **.

This is different from a deep copy because we are not copying shape or other information, just tags.

Parameters
what- Input - FunctionSpace for the new DataTagged
shape- Input - Shape for points in the new DataTagged
defaultvalue- Input - Default value for new DataTagged
tagsource- Input - A DataTagged object which supplies the tags.

References addTag(), escript::FunctionSpace::canTag(), getTagLookup(), m_data, escript::DataTypes::noValues(), escript::DataVector::resize(), and escript::DataVector::size().

virtual escript::DataTagged::~DataTagged ( )
inlinevirtual

Destructor.

escript::DataTagged::DataTagged ( const DataTagged other,
const DataTypes::RegionType region 
)

Member Function Documentation

void escript::DataTagged::addTag ( int  tagKey)

addTag - does not modify the default value for this object. ** Not unit tested **

Description: Add a single tag. The default value for this DataTagged will be associated with the tag. If this tag already has a value associated with it, then no change will be made.

Parameters
tagKey- Input - Integer tag. TODO: Make sure this is unit tested

References CHECK_FOR_EX_WRITE, escript::DataAbstract::getNoValues(), m_data, m_defaultValueOffset, m_offsetLookup, escript::DataVector::resize(), and escript::DataVector::size().

Referenced by addTaggedValues(), escript::Data::bessel(), escript::binaryOp(), escript::C_GeneralTensorProduct(), escript::C_TensorBinaryOperation(), escript::C_TensorUnaryOperation(), escript::Data::copyWithMask(), DataTagged(), eigenvalues(), eigenvalues_and_eigenvectors(), escript::Data::get_MPIComm(), matrixInverse(), nonsymmetric(), setSlice(), swapaxes(), symmetric(), trace(), and transpose().

void escript::DataTagged::addTaggedValue ( int  tagKey,
const DataTypes::ShapeType pointshape,
const ValueType value,
int  dataOffset = 0 
)

addTaggedValue

Description: Add a single tag and value to this DataTagged object. If this tag already has a value associated with it, setTaggedValue will be used to update this value.

Parameters
tagKey- Input - Integer tag.
pointshape- Shape of the value parameter
value- Input - Single DataArrayView value to be assigned to the tag.
dataOffset- Input - Offset of the beginning of the point in the value parameter

References CHECK_FOR_EX_WRITE, escript::DataTypes::checkShape(), escript::DataTypes::createShapeErrorMessage(), escript::DataAbstract::getNoValues(), escript::DataAbstract::getShape(), m_data, m_offsetLookup, escript::DataVector::resize(), setTaggedValue(), and escript::DataVector::size().

Referenced by addTaggedValues(), escript::condEval(), and setTaggedValue().

void escript::DataTagged::addTaggedValues ( const TagListType tagKeys,
const ValueBatchType values,
const ShapeType vShape 
)

addTaggedValues

Description: Add the given tags and values to this DataTagged object.

Parameters
tagKeys- Input - A vector of integer tags.
values- Input - A vector of doubles. If this is empty, the default value for this DataTagged will be used for all tags. If it contains one value all tag values will be assigned this value. Otherwise consecutive tags will be assigned consecutive values. If there is a mismatch between the number of keys and the number of values an exception will be generated.
vShape- shape of the datapoints in "values" T
void escript::DataTagged::addTaggedValues ( const TagListType tagKeys,
const ValueType values,
const ShapeType vShape 
)

Description: Add the given tags and values to this DataTagged object.

Parameters
tagKeys- Input - A vector of integer tags.
values- Input - A DataVector containing the datapoints. If this is empty, the default value for this DataTagged will be used for all tags. If it contains one value all tag values will be assigned this value. Otherwise consecutive tags will be assigned consecutive values. If there is a mismatch between the number of keys and the number of values an exception will be generated.
vShape- shape of the datapoints in "values"

TODO Makesure this is properly unit tested

References addTag(), addTaggedValue(), escript::DataAbstract::getNoValues(), and escript::DataVector::size().

DataAbstract * escript::DataTagged::deepCopy ( )
virtual

Return a deep copy of the current object.

Implements escript::DataAbstract.

References DataTagged().

void escript::DataTagged::dump ( const std::string  fileName) const
virtual
void escript::DataTagged::eigenvalues ( DataAbstract ev)
virtual

solves the eigenvalue problem this*V=ev*V for the eigenvalues ev

Parameters
ev- Output - eigenvalues in increasing order at each data point

Reimplemented from escript::DataAbstract.

References addTag(), escript::DataMaths::eigenvalues(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), and m_data.

void escript::DataTagged::eigenvalues_and_eigenvectors ( DataAbstract ev,
DataAbstract V,
const double  tol = 1.e-13 
)
virtual

solves the eigenvalue problem this*V=ev*V for the eigenvalues ev and eigenvectors V

Parameters
ev- Output - eigenvalues in increasing order at each data point
V- Output - corresponding eigenvectors. They are normalized such that their length is one and the first nonzero component is positive.
tol- Input - eigenvalue with relative distance tol are treated as equal.

Reimplemented from escript::DataAbstract.

References addTag(), escript::DataMaths::eigenvalues_and_eigenvectors(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), m_data, and V.

DataTypes::ValueType::const_reference escript::DataTagged::getDataByTagRO ( int  tag,
DataTypes::ValueType::size_type  i 
) const
DataTypes::ValueType::reference escript::DataTagged::getDataByTagRW ( int  tag,
DataTypes::ValueType::size_type  i 
)

getDataByTag

Return a pointer to the beginning of the datapoint with the specified tag. TODO Eventually these should be inlined.

Parameters
tag- Input - Integer key.
i- position in the underlying datastructure

References CHECK_FOR_EX_WRITE, m_data, m_defaultValueOffset, and m_offsetLookup.

Referenced by escript::Data::bessel(), escript::C_GeneralTensorProduct(), escript::C_TensorBinaryOperation(), escript::C_TensorUnaryOperation(), escript::dp_algorithm(), and escript::Data::get_MPIComm().

DataTypes::ValueType::size_type escript::DataTagged::getDefaultOffset ( ) const
inline
DataTypes::ValueType::const_reference escript::DataTagged::getDefaultValueRO ( DataTypes::ValueType::size_type  i) const
inline
DataTypes::ValueType::reference escript::DataTagged::getDefaultValueRW ( DataTypes::ValueType::size_type  i)
inline

getDefaultValue

Description: Return the default value. This value is associated with any tag which is not explicitly recorded in this DataTagged object's tag map.

Parameters
i- position in the underlying datastructure

Referenced by escript::Data::bessel(), escript::C_GeneralTensorProduct(), escript::C_TensorBinaryOperation(), escript::C_TensorUnaryOperation(), escript::condEval(), and escript::Data::get_MPIComm().

DataTypes::ValueType::size_type escript::DataTagged::getLength ( ) const
inlinevirtual

getLength

Description: Return the total number of doubles stored for this DataTagged object. T

Implements escript::DataAbstract.

DataTypes::ValueType::size_type escript::DataTagged::getOffsetForTag ( int  tag) const

getOffsetForTag

Parameters
tag
Returns
the offset of the beginning of the datapoint corresponding to tag.

Note: If the tag is not valid, the offset of the default value is returned instead.

References m_defaultValueOffset, and m_offsetLookup.

Referenced by escript::binaryOp(), escript::condEval(), escript::Data::copyWithMask(), escript::dp_algorithm(), eigenvalues(), eigenvalues_and_eigenvectors(), matrixInverse(), nonsymmetric(), setSlice(), swapaxes(), symmetric(), trace(), and transpose().

DataTypes::ValueType::size_type escript::DataTagged::getPointOffset ( int  sampleNo,
int  dataPointNo 
) const
virtual

getPointOffset

Description: Return the offset to the given data-point value in the underlying data vector.

Parameters
sampleNo- Input - sample number.
dataPointNo- Input - data-point number. T

Implements escript::DataAbstract.

References escript::DataAbstract::getFunctionSpace(), escript::FunctionSpace::getTagFromSampleNo(), m_defaultValueOffset, and m_offsetLookup.

Referenced by escript::C_GeneralTensorProduct(), escript::C_TensorBinaryOperation(), and escript::DataExpanded::DataExpanded().

DataTypes::ValueType::size_type escript::DataTagged::getPointOffset ( int  sampleNo,
int  dataPointNo 
)
virtual
double * escript::DataTagged::getSampleDataByTag ( int  tag)
virtual

getSampleDataByTag

Description: Return the data-point for the given tag. All of the data for the sample will be visible via the returned pointer.

This provides an interface into the data suitable for legacy C code. NB: need to do array bounds checking when accessing returned value! T

Reimplemented from escript::DataAbstract.

References CHECK_FOR_EX_WRITE, m_data, and m_offsetLookup.

DataAbstract * escript::DataTagged::getSlice ( const DataTypes::RegionType region) const
virtual

getSlice

Description: Factory method that returns a newly created DataTagged object generated by taking the specified slice from this DataTagged object. The caller is reponsible for managing the returned object. T

Implements escript::DataAbstract.

References DataTagged().

size_t escript::DataTagged::getTagCount ( ) const
virtual

Return the number of tags which have been given values (+the default)

Reimplemented from escript::DataAbstract.

References m_offsetLookup.

const DataTagged::DataMapType & escript::DataTagged::getTagLookup ( ) const
inline
int escript::DataTagged::getTagNumber ( int  dpno)
virtual

Return the tag number associated with the given data-point number according to the associated function space. T.

Reimplemented from escript::DataAbstract.

References escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getNumDPPSample(), escript::DataAbstract::getNumSamples(), and escript::FunctionSpace::getTagFromSampleNo().

const DataTypes::ValueType & escript::DataTagged::getVectorRO ( ) const
virtual
DataTypes::ValueType & escript::DataTagged::getVectorRW ( )
virtual
bool escript::DataTagged::hasNaN ( ) const
virtual

Return true if any one of the datapoints contains a NaN.

Implements escript::DataReady.

References m_data, escript::nancheck(), and escript::DataVector::size().

bool escript::DataTagged::isCurrentTag ( int  tag) const
inline

isCurrentTag

Description: Return true if the given tag exists within the DataTagged tag map.

NB: The DataTagged tag map does not necessarily coincide with the tag

keys in the associated function space. T

Referenced by escript::binaryOp(), and setSlice().

bool escript::DataTagged::isTagged ( ) const
inlinevirtual
int escript::DataTagged::matrixInverse ( DataAbstract out) const
virtual

invert square matricies

Parameters
out- Where to store the results
Returns
errorcode (0 indicates success)

Reimplemented from escript::DataAbstract.

References addTag(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getRank(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), m_data, and escript::DataMaths::matrix_inverse().

void escript::DataTagged::nonsymmetric ( DataAbstract ev)
virtual

Computes a nonsymmetric matrix (A - AT) / 2.

Parameters
ev- Output - nonsymmetric matrix

Reimplemented from escript::DataAbstract.

References addTag(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), m_data, and escript::DataMaths::nonsymmetric().

void escript::DataTagged::replaceNaN ( double  value)
virtual

replaces all NaN values with value

Implements escript::DataReady.

References m_data, escript::nancheck(), and escript::DataVector::size().

void escript::DataTagged::setSlice ( const DataAbstract other,
const DataTypes::RegionType region 
)
virtual

setSlice

Description: Copy the given Data object into the specified region in this object.

Parameters
other- Input - Data object to copy from.
region- Input - Region to copy into (NB: must have same shape as other!). T

Implements escript::DataReady.

References addTag(), CHECK_FOR_EX_WRITE, escript::DataTypes::checkShape(), escript::DataTypes::copySliceFrom(), escript::DataTypes::createShapeErrorMessage(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getRank(), escript::DataTypes::getResultSliceShape(), escript::DataAbstract::getShape(), escript::DataTypes::getSliceRegionLoopRange(), getVectorRO(), isCurrentTag(), m_data, and m_offsetLookup.

void escript::DataTagged::setTaggedValue ( int  tagKey,
const DataTypes::ShapeType pointshape,
const ValueType value,
int  dataOffset = 0 
)
virtual

setTaggedValue

Description: Assign the given value to the given tag.

Parameters
tagKey- Input - Integer tag.
pointshape- the shape of the value parameter
value- Input - Vector storing the datapoint to be assigned to the tag.
dataOffset- beginning of the datapoint within "value". T

Reimplemented from escript::DataAbstract.

References addTaggedValue(), CHECK_FOR_EX_WRITE, escript::DataTypes::checkShape(), escript::DataTypes::createShapeErrorMessage(), escript::DataAbstract::getNoValues(), escript::DataAbstract::getShape(), m_data, and m_offsetLookup.

Referenced by addTaggedValue().

void escript::DataTagged::setToZero ( )
virtual

sets all values to zero

Reimplemented from escript::DataAbstract.

References CHECK_FOR_EX_WRITE, m_data, and escript::DataVector::size().

void escript::DataTagged::swapaxes ( DataAbstract ev,
int  axis0,
int  axis1 
)
virtual

swaps components axis0 and axis1

Parameters
ev- Output - swapped components
axis0
axis1

Reimplemented from escript::DataAbstract.

References addTag(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), m_data, and escript::DataMaths::swapaxes().

void escript::DataTagged::symmetric ( DataAbstract ev)
virtual

Computes a symmetric matrix (A + AT) / 2.

Parameters
ev- Output - symmetric matrix

Reimplemented from escript::DataAbstract.

References addTag(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), m_data, and escript::DataMaths::symmetric().

string escript::DataTagged::toString ( ) const
virtual

Write the data as a string. Writes out each tag, including the default, and the data-point which is associated with each tag. T.

Implements escript::DataAbstract.

References getDefaultOffset(), escript::DataAbstract::getShape(), m_data, m_offsetLookup, and escript::DataTypes::pointToString().

void escript::DataTagged::trace ( DataAbstract ev,
int  axis_offset 
)
virtual

Computes the trace of a matrix.

Parameters
ev- Output - the trace of a matrix
axis_offset

Reimplemented from escript::DataAbstract.

References addTag(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), m_data, and escript::DataMaths::trace().

void escript::DataTagged::transpose ( DataAbstract ev,
int  axis_offset 
)
virtual

Transpose each data point of this Data object around the given axis.

Parameters
ev- Output - the transpose of a matrix
axis_offset

Reimplemented from escript::DataAbstract.

References addTag(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), m_data, and escript::DataMaths::transpose().

Member Data Documentation

ValueType escript::DataTagged::m_data
private
const int escript::DataTagged::m_defaultValueOffset = 0
staticprivate
DataMapType escript::DataTagged::m_offsetLookup
private

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