escript::DataTagged Class Reference

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

`#include <DataTagged.h>`

Inheritance diagram for escript::DataTagged:

## Public Types

typedef std::vector< int > | TagListType
typedef std::vector< DataTypes::RealVectorType::ElementType > | FloatBatchType
typedef std::vector< DataTypes::CplxVectorType::ElementType > | CplxBatchType
typedef std::map< int, int > | DataMapType
Public Types inherited from escript::DataAbstract
typedef DataTypes::ShapeType | ShapeType

## Public Member Functions

| DataTagged (const FunctionSpace &what, const DataTypes::ShapeType &shape, const int tags[], const DataTypes::RealVectorType &data)
| Alternative Constructor for DataTagged. More...
| DataTagged (const FunctionSpace &what, const DataTypes::ShapeType &shape, const int tags[], const DataTypes::CplxVectorType &data)
| DataTagged (const FunctionSpace &what, const DataTypes::ShapeType &shape, const TagListType &tags, const DataTypes::RealVectorType &data)
| DataTagged (const FunctionSpace &what, const DataTypes::ShapeType &shape, const TagListType &tags, const DataTypes::CplxVectorType &data)
| 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::RealVectorType &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...
| DataTagged (const FunctionSpace &what, const DataTypes::ShapeType &shape, const DataTypes::CplxVectorType &defaultvalue, const DataTagged *tagsource=0)
virtual | ~DataTagged ()
| Destructor. More...
bool | isTagged () const
bool | hasNaN () const
| Return true if any one of the datapoints contains a NaN. More...
void | replaceNaN (DataTypes::real_t value)
| replaces all NaN values with value More...
void | replaceNaN (DataTypes::cplx_t value)
| replaces all NaN values with value More...
virtual bool | hasInf () const
| Return true if data contains Inf or -Inf. More...
virtual void | replaceInf (DataTypes::real_t value)
| replaces all (+/-)Inf values with value More...
virtual void | replaceInf (DataTypes::cplx_t value)
| replaces all (+/-)Inf values with value More...
virtual DataAbstract * | deepCopy () const
| Return a deep copy of the current object. More...
virtual DataAbstract * | zeroedCopy () const
| Return an object with the same type, domain (and tags if appropriate) as this, but all values are zeroed. More...
virtual DataTypes::real_t * | getSampleDataByTag (int tag, DataTypes::real_t dummy=0)
| getSampleDataByTag 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 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 DataTypes::RealVectorType::size_type | getPointOffset (int sampleNo, int dataPointNo) const
| getPointOffset More...
void | addTaggedValues (const TagListType &tagKeys, const FloatBatchType &values, const ShapeType &vShape)
| addTaggedValues More...
void | addTaggedValues (const TagListType &tagKeys, const DataTypes::RealVectorType &values, const ShapeType &vShape)
void | addTaggedValue (int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
| addTaggedValue More...
void | addTaggedValue (int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::CplxVectorType &value, int dataOffset=0)
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 DataTypes::RealVectorType &value, int dataOffset=0)
| setTaggedValue More...
void | setTaggedValue (int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::CplxVectorType &value, int dataOffset=0)
DataTypes::RealVectorType::reference | getDataByTagRW (int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
| getDataByTag More...
DataTypes::RealVectorType::const_reference | getDataByTagRO (int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
DataTypes::CplxVectorType::reference | getDataByTagRW (int tag, DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
DataTypes::CplxVectorType::const_reference | getDataByTagRO (int tag, DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy) const
DataTypes::RealVectorType::size_type | getOffsetForTag (int tag) const
| getOffsetForTag More...
DataTypes::RealVectorType & | getVectorRW ()
| Return a reference to the underlying DataVector. More...
const DataTypes::RealVectorType & | getVectorRO () const
DataTypes::CplxVectorType & | getVectorRWC ()
const DataTypes::CplxVectorType & | getVectorROC () const
virtual DataTypes::RealVectorType & | getTypedVectorRW (DataTypes::real_t dummy)
| These versions use the type system rather than method name to determine return type. More...
virtual const DataTypes::RealVectorType & | getTypedVectorRO (DataTypes::real_t dummy) const
virtual DataTypes::CplxVectorType & | getTypedVectorRW (DataTypes::cplx_t dummy)
virtual const DataTypes::CplxVectorType & | getTypedVectorRO (DataTypes::cplx_t dummy) const
const DataMapType & | getTagLookup () const
| getTagLookup More...
bool | isCurrentTag (int tag) const
| isCurrentTag More...
DataTypes::RealVectorType::reference | getDefaultValueRW (DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
| getDefaultValue More...
DataTypes::RealVectorType::const_reference | getDefaultValueRO (DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
DataTypes::CplxVectorType::reference | getDefaultValueRW (DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
DataTypes::CplxVectorType::const_reference | getDefaultValueRO (DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy) const
virtual DataTypes::RealVectorType::size_type | getLength () const
| getLength More...
virtual DataAbstract * | getSlice (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 | antisymmetric (DataAbstract *ev)
| Computes a antisymmetric matrix (A - AT) / 2. More...
virtual void | hermitian (DataAbstract *ev)
| Computes an hermitian matrix (A + A*) / 2. More...
virtual void | antihermitian (DataAbstract *ev)
| Computes an antihermitian matrix (A - A*) / 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::RealVectorType::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...
void | complicate ()
Public Member Functions inherited from escript::DataReady
| DataReady (const FunctionSpace &what, const ShapeType &shape, bool isDataEmpty=false)
| ~DataReady ()
DataTypes::real_t * | getSampleDataRW (DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0)
| Return the sample data for the given sample number. More...
DataTypes::cplx_t * | getSampleDataRW (DataTypes::RealVectorType::size_type sampleNo, DataTypes::cplx_t dummy)
const DataTypes::real_t * | getSampleDataRO (DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0) const
const DataTypes::cplx_t * | getSampleDataRO (DataTypes::RealVectorType::size_type sampleNo, DataTypes::cplx_t dummy) const
DataTypes::RealVectorType::const_reference | getDataAtOffsetRO (DataTypes::RealVectorType::size_type i) const
| get a reference to the beginning of a data point More...
DataTypes::RealVectorType::reference | getDataAtOffsetRW (DataTypes::RealVectorType::size_type i)
DataTypes::CplxVectorType::const_reference | getDataAtOffsetROC (DataTypes::CplxVectorType::size_type i) const
DataTypes::CplxVectorType::reference | getDataAtOffsetRWC (DataTypes::CplxVectorType::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, bool isCplx=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...
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...
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 | 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 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 | 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
bool | isComplex () const
| true if the components of datapoints are complex More...

## Private Types

typedef DataReady | parent

## Private Attributes

DataMapType | m_offsetLookup
DataTypes::RealVectorType | m_data_r
DataTypes::CplxVectorType | m_data_c

## Static Private Attributes

static const int | m_defaultValueOffset = 0

## Additional Inherited Members

Protected Attributes inherited from escript::DataAbstract
int | m_noSamples
int | m_noDataPointsPerSample
bool | m_iscompl

## 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

## CplxBatchType

typedef std::vector<DataTypes::CplxVectorType::ElementType> escript::DataTagged::CplxBatchType

## DataMapType

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

## FloatBatchType

typedef std::vector<DataTypes::RealVectorType::ElementType> escript::DataTagged::FloatBatchType

## parent

typedef DataReady escript::DataTagged::parent

private

## TagListType

typedef std::vector<int> escript::DataTagged::TagListType

## Constructor & Destructor Documentation

## DataTagged() [1/9]

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

explicit

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_r, m_offsetLookup, escript::DataTypes::noValues(), and escript::DataTypes::DataVectorAlt< T >::size().

Referenced by deepCopy(), getSlice(), and zeroedCopy().

## DataTagged() [2/9]

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

explicit

References escript::FunctionSpace::canTag(), m_data_c, escript::DataAbstract::m_iscompl, m_offsetLookup, escript::DataTypes::noValues(), and escript::DataTypes::DataVectorAlt< T >::size().

## DataTagged() [3/9]

escript::DataTagged::DataTagged | ( | const FunctionSpace & | what,
|  | const DataTypes::ShapeType & | shape,
|  | const TagListType & | tags,
|  | const DataTypes::RealVectorType & | data
| ) |  |

explicit

     \brief
     Alternative Constructor for DataTagged.

     Description:
     Alternative Constructor for DataTagged.
     \param what - Input - A description of what this data object represents.
     \param shape - Input - The shape of each data-point.
     \param tags - Input - An vector of tags, one for each sample number.
     \param 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_r, m_offsetLookup, escript::DataTypes::noValues(), and escript::DataTypes::DataVectorAlt< T >::size().

## DataTagged() [4/9]

escript::DataTagged::DataTagged | ( | const FunctionSpace & | what,
|  | const DataTypes::ShapeType & | shape,
|  | const TagListType & | tags,
|  | const DataTypes::CplxVectorType & | data
| ) |  |

explicit

References escript::FunctionSpace::canTag(), m_data_c, escript::DataAbstract::m_iscompl, m_offsetLookup, escript::DataTypes::noValues(), and escript::DataTypes::DataVectorAlt< T >::size().

## DataTagged() [5/9]

escript::DataTagged::DataTagged | ( | const DataTagged & | other | ) |

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

References escript::DataAbstract::m_iscompl.

## DataTagged() [6/9]

escript::DataTagged::DataTagged | ( | const DataConstant & | other | ) |

explicit

Copy Constructor for DataTagged. Construct a DataTagged object from a DataConstant object. The default value will be the value of the DataConstant object. T.

References escript::FunctionSpace::canTag(), escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getNoValues(), escript::DataConstant::getTypedVectorRO(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, escript::DataAbstract::m_iscompl, and escript::DataTypes::DataVectorAlt< T >::resize().

## DataTagged() [7/9]

escript::DataTagged::DataTagged | ( | const FunctionSpace & | what,
|  | const DataTypes::ShapeType & | shape,
|  | const DataTypes::RealVectorType & | defaultvalue,
|  | const DataTagged * | tagsource = `0`
| ) |  |

explicit

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_r, escript::DataTypes::noValues(), escript::DataTypes::DataVectorAlt< T >::resize(), and escript::DataTypes::DataVectorAlt< T >::size().

## DataTagged() [8/9]

escript::DataTagged::DataTagged | ( | const FunctionSpace & | what,
|  | const DataTypes::ShapeType & | shape,
|  | const DataTypes::CplxVectorType & | defaultvalue,
|  | const DataTagged * | tagsource = `0`
| ) |  |

explicit

References addTag(), escript::FunctionSpace::canTag(), getTagLookup(), m_data_c, m_data_r, escript::DataAbstract::m_iscompl, escript::DataTypes::noValues(), escript::DataTypes::DataVectorAlt< T >::resize(), and escript::DataTypes::DataVectorAlt< T >::size().

## ~DataTagged()

virtual escript::DataTagged::~DataTagged | ( |  | ) |

inline virtual

Destructor.

## DataTagged() [9/9]

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

Slice Constructor for DataTagged.

Description: Creates a DataTagged object which is the specified slice from the given DataTagged object.

Parameters

  other | - Input - DataTagged object to slice from.
  region | - Input - Region to slice. T

References escript::DataTypes::copySlice(), getDefaultOffset(), escript::DataAbstract::getNoValues(), escript::DataTypes::getResultSliceShape(), escript::DataAbstract::getShape(), escript::DataTypes::getSliceRegionLoopRange(), getTypedVectorRO(), getTypedVectorRW(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, escript::DataAbstract::m_iscompl, m_offsetLookup, escript::DataTypes::noValues(), and escript::DataTypes::DataVectorAlt< T >::resize().

## Member Function Documentation

## addTag()

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(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, m_defaultValueOffset, m_offsetLookup, escript::DataTypes::DataVectorAlt< T >::resize(), and escript::DataTypes::DataVectorAlt< T >::size().

Referenced by addTaggedValues(), antihermitian(), antisymmetric(), escript::binaryOpDataReadyHelperTCT(), escript::binaryOpDataReadyHelperTTC(), escript::binaryOpDataReadyHelperTTT(), DataTagged(), eigenvalues(), eigenvalues_and_eigenvectors(), hermitian(), matrixInverse(), setSlice(), swapaxes(), symmetric(), trace(), and transpose().

## addTaggedValue() [1/2]

void escript::DataTagged::addTaggedValue | ( | int | tagKey,
|  | const DataTypes::ShapeType & | pointshape,
|  | const DataTypes::CplxVectorType & | value,
|  | int | dataOffset = `0`
| ) |  |

References CHECK_FOR_EX_WRITE, escript::DataTypes::checkShape(), escript::DataTypes::createShapeErrorMessage(), escript::DataAbstract::getNoValues(), escript::DataAbstract::getShape(), escript::DataAbstract::isComplex(), m_data_c, m_offsetLookup, escript::DataTypes::DataVectorAlt< T >::resize(), setTaggedValue(), and escript::DataTypes::DataVectorAlt< T >::size().

## addTaggedValue() [2/2]

void escript::DataTagged::addTaggedValue | ( | int | tagKey,
|  | const DataTypes::ShapeType & | pointshape,
|  | const DataTypes::RealVectorType & | 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(), escript::DataAbstract::isComplex(), m_data_r, m_offsetLookup, escript::DataTypes::DataVectorAlt< T >::resize(), setTaggedValue(), and escript::DataTypes::DataVectorAlt< T >::size().

Referenced by addTaggedValues(), and setTaggedValue().

## addTaggedValues() [1/2]

void escript::DataTagged::addTaggedValues | ( | const TagListType & | tagKeys,
|  | const DataTypes::RealVectorType & | 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::DataTypes::DataVectorAlt< T >::size().

## addTaggedValues() [2/2]

void escript::DataTagged::addTaggedValues | ( | const TagListType & | tagKeys,
|  | const FloatBatchType & | 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

## antihermitian()

void escript::DataTagged::antihermitian | ( | DataAbstract * | ev | ) |

virtual

Computes an antihermitian matrix (A - A*) / 2.

Parameters

  ev | - Output - anti-hermitian matrix

Reimplemented from escript::DataAbstract.

References addTag(), escript::antihermitian(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getTypedVectorRW(), escript::DataAbstract::isComplex(), and m_data_c.

## antisymmetric()

void escript::DataTagged::antisymmetric | ( | DataAbstract * | ev | ) |

virtual

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

Parameters

  ev | - Output - antisymmetric matrix

Reimplemented from escript::DataAbstract.

References addTag(), escript::antisymmetric(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getTypedVectorRW(), escript::DataAbstract::isComplex(), m_data_c, and m_data_r.

## complicate()

void escript::DataTagged::complicate | ( |  | ) |

virtual

Reimplemented from escript::DataAbstract.

References escript::DataTypes::fillComplexFromReal(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, escript::DataAbstract::m_iscompl, and escript::DataTypes::DataVectorAlt< T >::resize().

Referenced by replaceInf(), and replaceNaN().

## deepCopy()

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

virtual

Return a deep copy of the current object.

Implements escript::DataAbstract.

References DataTagged().

## dump()

void escript::DataTagged::dump | ( | const std::string | fileName | ) | const

virtual

dumps the object into a netCDF file

Reimplemented from escript::DataAbstract.

References escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getRank(), escript::DataAbstract::getShape(), getTagLookup(), escript::FunctionSpace::getTypeCode(), m_data_r, escript::DataTypes::maxRank, MPI_COMM_WORLD, and MPI_INT.

## eigenvalues()

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::eigenvalues(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), getVectorRWC(), escript::DataAbstract::isComplex(), m_data_c, and m_data_r.

## eigenvalues_and_eigenvectors()

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::eigenvalues_and_eigenvectors(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), m_data_r, and V.

## getDataByTagRO() [1/2]

DataTypes::CplxVectorType::const_reference escript::DataTagged::getDataByTagRO | ( | int | tag,
|  | DataTypes::CplxVectorType::size_type | i,
|  | DataTypes::cplx_t | dummy
| ) |  | const

## getDataByTagRO() [2/2]

DataTypes::RealVectorType::const_reference escript::DataTagged::getDataByTagRO | ( | int | tag,
|  | DataTypes::RealVectorType::size_type | i,
|  | DataTypes::real_t | dummy = `0`
| ) |  | const

References m_data_r, m_defaultValueOffset, and m_offsetLookup.

## getDataByTagRW() [1/2]

DataTypes::CplxVectorType::reference escript::DataTagged::getDataByTagRW | ( | int | tag,
|  | DataTypes::CplxVectorType::size_type | i,
|  | DataTypes::cplx_t | dummy
| ) |  |

## getDataByTagRW() [2/2]

DataTypes::RealVectorType::reference escript::DataTagged::getDataByTagRW | ( | int | tag,
|  | DataTypes::RealVectorType::size_type | i,
|  | DataTypes::real_t | dummy = `0`
| ) |  |

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_r, m_defaultValueOffset, and m_offsetLookup.

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

## getDefaultOffset()

DataTypes::RealVectorType::size_type escript::DataTagged::getDefaultOffset | ( |  | ) | const

inline

Returns the offset in the structure which stores the default value.

References m_defaultValueOffset.

Referenced by antihermitian(), antisymmetric(), DataTagged(), escript::Data::dp_algorithm(), eigenvalues(), eigenvalues_and_eigenvectors(), hermitian(), matrixInverse(), escript::Data::reduction(), setSlice(), swapaxes(), symmetric(), toString(), trace(), and transpose().

## getDefaultValueRO() [1/2]

DataTypes::CplxVectorType::const_reference escript::DataTagged::getDefaultValueRO | ( | DataTypes::CplxVectorType::size_type | i,
|  | DataTypes::cplx_t | dummy
| ) |  | const

inline

References getVectorROC().

## getDefaultValueRO() [2/2]

DataTypes::RealVectorType::const_reference escript::DataTagged::getDefaultValueRO | ( | DataTypes::RealVectorType::size_type | i,
|  | DataTypes::real_t | dummy = `0`
| ) |  | const

inline

References getVectorRO().

## getDefaultValueRW() [1/2]

DataTypes::CplxVectorType::reference escript::DataTagged::getDefaultValueRW | ( | DataTypes::CplxVectorType::size_type | i,
|  | DataTypes::cplx_t | dummy
| ) |  |

## getDefaultValueRW() [2/2]

DataTypes::RealVectorType::reference escript::DataTagged::getDefaultValueRW | ( | DataTypes::RealVectorType::size_type | i,
|  | DataTypes::real_t | dummy = `0`
| ) |  |

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

References getVectorRW().

## getLength()

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

inline virtual

getLength

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

Implements escript::DataAbstract.

References m_data_c, m_data_r, and escript::DataTypes::DataVectorAlt< T >::size().

## getOffsetForTag()

DataTypes::RealVectorType::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 antihermitian(), antisymmetric(), escript::binaryOpDataReadyHelperTCT(), escript::binaryOpDataReadyHelperTTC(), escript::binaryOpDataReadyHelperTTT(), escript::Data::dp_algorithm(), eigenvalues(), eigenvalues_and_eigenvectors(), hermitian(), matrixInverse(), setSlice(), swapaxes(), symmetric(), trace(), and transpose().

## getPointOffset()

DataTypes::RealVectorType::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::binaryOpVectorTagged(), and escript::DataExpanded::DataExpanded().

## getSampleDataByTag() [1/2]

DataTypes::cplx_t * escript::DataTagged::getSampleDataByTag | ( | int | tag,
|  | DataTypes::cplx_t | dummy
| ) |  |

virtual

Return the complex sample data for the given tag key. NB: If the data isn't tagged an exception will be thrown.

Reimplemented from escript::DataAbstract.

References CHECK_FOR_EX_WRITE, m_data_c, and m_offsetLookup.

## getSampleDataByTag() [2/2]

DataTypes::real_t * escript::DataTagged::getSampleDataByTag | ( | int | tag,
|  | DataTypes::real_t | dummy = `0`
| ) |  |

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_r, and m_offsetLookup.

## getSlice()

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

## getTagCount()

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.

Referenced by escript::binaryOpDataReadyHelperTCT(), escript::binaryOpDataReadyHelperTTC(), and escript::binaryOpDataReadyHelperTTT().

## getTagLookup()

const DataTagged::DataMapType & escript::DataTagged::getTagLookup | ( |  | ) | const

inline

getTagLookup

Description: Return a reference to the tag offset lookup table. T

References m_offsetLookup.

Referenced by antihermitian(), antisymmetric(), escript::binaryOpDataReadyHelperTCT(), escript::binaryOpDataReadyHelperTTC(), escript::binaryOpDataReadyHelperTTT(), DataTagged(), escript::Data::dp_algorithm(), dump(), eigenvalues(), eigenvalues_and_eigenvectors(), hermitian(), matrixInverse(), escript::Data::reduction(), swapaxes(), symmetric(), trace(), and transpose().

## getTagNumber()

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

## getTypedVectorRO() [1/2]

const DataTypes::CplxVectorType & escript::DataTagged::getTypedVectorRO | ( | DataTypes::cplx_t | dummy | ) | const

virtual

Implements escript::DataReady.

References m_data_c.

## getTypedVectorRO() [2/2]

const DataTypes::RealVectorType & escript::DataTagged::getTypedVectorRO | ( | DataTypes::real_t | dummy | ) | const

virtual

Implements escript::DataReady.

References m_data_r.

Referenced by escript::binaryOpDataReadyHelperEET(), escript::binaryOpDataReadyHelperETE(), escript::binaryOpDataReadyHelperTCT(), escript::binaryOpDataReadyHelperTTC(), escript::binaryOpDataReadyHelperTTT(), escript::DataExpanded::DataExpanded(), DataTagged(), escript::Data::dp_algorithm(), escript::Data::reduction(), and setSlice().

## getTypedVectorRW() [1/2]

DataTypes::CplxVectorType & escript::DataTagged::getTypedVectorRW | ( | DataTypes::cplx_t | dummy | ) |

virtual

Implements escript::DataReady.

References CHECK_FOR_EX_WRITE, and m_data_c.

## getTypedVectorRW() [2/2]

DataTypes::RealVectorType & escript::DataTagged::getTypedVectorRW | ( | DataTypes::real_t | dummy | ) |

virtual

These versions use the type system rather than method name to determine return type.

Implements escript::DataReady.

References CHECK_FOR_EX_WRITE, and m_data_r.

Referenced by antihermitian(), antisymmetric(), escript::binaryOpDataReadyHelperTCT(), escript::binaryOpDataReadyHelperTTC(), escript::binaryOpDataReadyHelperTTT(), DataTagged(), escript::Data::dp_algorithm(), hermitian(), and symmetric().

## getVectorRO()

const DataTypes::RealVectorType & escript::DataTagged::getVectorRO | ( |  | ) | const

virtual

Implements escript::DataReady.

References m_data_r.

Referenced by getDefaultValueRO().

## getVectorROC()

const DataTypes::CplxVectorType & escript::DataTagged::getVectorROC | ( |  | ) | const

virtual

Implements escript::DataReady.

References m_data_c.

Referenced by getDefaultValueRO().

## getVectorRW()

DataTypes::RealVectorType & escript::DataTagged::getVectorRW | ( |  | ) |

virtual

Return a reference to the underlying DataVector.

Implements escript::DataReady.

References CHECK_FOR_EX_WRITE, and m_data_r.

Referenced by eigenvalues(), eigenvalues_and_eigenvectors(), getDefaultValueRW(), matrixInverse(), swapaxes(), trace(), and transpose().

## getVectorRWC()

DataTypes::CplxVectorType & escript::DataTagged::getVectorRWC | ( |  | ) |

virtual

Implements escript::DataReady.

References CHECK_FOR_EX_WRITE, and m_data_c.

Referenced by eigenvalues(), swapaxes(), trace(), and transpose().

## hasInf()

bool escript::DataTagged::hasInf | ( |  | ) | const

virtual

Return true if data contains Inf or -Inf.

Implements escript::DataReady.

References escript::DataAbstract::isComplex(), m_data_c, m_data_r, and escript::DataTypes::DataVectorAlt< T >::size().

## hasNaN()

bool escript::DataTagged::hasNaN | ( |  | ) | const

virtual

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

Implements escript::DataReady.

References escript::DataAbstract::isComplex(), m_data_c, m_data_r, and escript::DataTypes::DataVectorAlt< T >::size().

## hermitian()

void escript::DataTagged::hermitian | ( | DataAbstract * | ev | ) |

virtual

Computes an hermitian matrix (A + A*) / 2.

Parameters

  ev | - Output - hermitian matrix

Reimplemented from escript::DataAbstract.

References addTag(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getShape(), getTagLookup(), getTypedVectorRW(), escript::hermitian(), escript::DataAbstract::isComplex(), and m_data_c.

## isCurrentTag()

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

References m_offsetLookup.

Referenced by setSlice().

## isTagged()

bool escript::DataTagged::isTagged | ( |  | ) | const

inline virtual

Reimplemented from escript::DataAbstract.

## matrixInverse()

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_r, and escript::matrix_inverse().

## replaceInf() [1/2]

void escript::DataTagged::replaceInf | ( | DataTypes::cplx_t | value | ) |

virtual

replaces all (+/-)Inf values with value

Implements escript::DataReady.

References CHECK_FOR_EX_WRITE, complicate(), escript::DataAbstract::isComplex(), m_data_c, replaceInf(), and escript::DataTypes::DataVectorAlt< T >::size().

## replaceInf() [2/2]

void escript::DataTagged::replaceInf | ( | DataTypes::real_t | value | ) |

virtual

replaces all (+/-)Inf values with value

Implements escript::DataReady.

References CHECK_FOR_EX_WRITE, escript::DataAbstract::isComplex(), m_data_c, m_data_r, and escript::DataTypes::DataVectorAlt< T >::size().

Referenced by replaceInf().

## replaceNaN() [1/2]

void escript::DataTagged::replaceNaN | ( | DataTypes::cplx_t | value | ) |

virtual

replaces all NaN values with value

Implements escript::DataReady.

References CHECK_FOR_EX_WRITE, complicate(), escript::DataAbstract::isComplex(), m_data_c, replaceNaN(), and escript::DataTypes::DataVectorAlt< T >::size().

## replaceNaN() [2/2]

void escript::DataTagged::replaceNaN | ( | DataTypes::real_t | value | ) |

virtual

replaces all NaN values with value

Implements escript::DataReady.

References CHECK_FOR_EX_WRITE, escript::DataAbstract::isComplex(), m_data_c, m_data_r, and escript::DataTypes::DataVectorAlt< T >::size().

Referenced by replaceNaN().

## setSlice()

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(), getTypedVectorRO(), escript::DataAbstract::isComplex(), isCurrentTag(), m_data_c, m_data_r, and m_offsetLookup.

## setTaggedValue() [1/2]

void escript::DataTagged::setTaggedValue | ( | int | tagKey,
|  | const DataTypes::ShapeType & | pointshape,
|  | const DataTypes::CplxVectorType & | value,
|  | int | dataOffset = `0`
| ) |  |

virtual

Reimplemented from escript::DataAbstract.

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

## setTaggedValue() [2/2]

void escript::DataTagged::setTaggedValue | ( | int | tagKey,
|  | const DataTypes::ShapeType & | pointshape,
|  | const DataTypes::RealVectorType & | 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(), escript::DataAbstract::isComplex(), m_data_r, and m_offsetLookup.

Referenced by addTaggedValue().

## setToZero()

void escript::DataTagged::setToZero | ( |  | ) |

virtual

sets all values to zero

Reimplemented from escript::DataAbstract.

References CHECK_FOR_EX_WRITE, escript::DataAbstract::isComplex(), m_data_c, m_data_r, and escript::DataTypes::DataVectorAlt< T >::size().

## swapaxes()

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(), getVectorRWC(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, and escript::swapaxes().

## symmetric()

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(), getTypedVectorRW(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, and escript::symmetric().

## toString()

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 escript::FunctionSpace::borrowListOfTagsInUse(), getDefaultOffset(), escript::DataAbstract::getFunctionSpace(), escript::FunctionSpace::getNumberOfTagsInUse(), escript::DataAbstract::getShape(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, m_offsetLookup, and escript::DataTypes::pointToString().

## trace()

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(), getVectorRWC(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, and escript::trace().

## transpose()

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(), getVectorRWC(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, and escript::transpose().

## zeroedCopy()

DataAbstract * escript::DataTagged::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 DataTagged(), escript::DataAbstract::getFunctionSpace(), escript::DataAbstract::getShape(), and escript::DataAbstract::isComplex().

## Member Data Documentation

## m_data_c

DataTypes::CplxVectorType escript::DataTagged::m_data_c

private

Referenced by addTag(), addTaggedValue(), antihermitian(), antisymmetric(), complicate(), DataTagged(), eigenvalues(), getLength(), getSampleDataByTag(), getTypedVectorRO(), getTypedVectorRW(), getVectorROC(), getVectorRWC(), hasInf(), hasNaN(), hermitian(), replaceInf(), replaceNaN(), setSlice(), setTaggedValue(), setToZero(), swapaxes(), symmetric(), toString(), trace(), and transpose().

## m_data_r

DataTypes::RealVectorType escript::DataTagged::m_data_r

private

Referenced by addTag(), addTaggedValue(), antisymmetric(), complicate(), DataTagged(), dump(), eigenvalues(), eigenvalues_and_eigenvectors(), getDataByTagRO(), getDataByTagRW(), getLength(), getSampleDataByTag(), getTypedVectorRO(), getTypedVectorRW(), getVectorRO(), getVectorRW(), hasInf(), hasNaN(), matrixInverse(), replaceInf(), replaceNaN(), setSlice(), setTaggedValue(), setToZero(), swapaxes(), symmetric(), toString(), trace(), and transpose().

## m_defaultValueOffset

const int escript::DataTagged::m_defaultValueOffset = 0

static private

Referenced by addTag(), getDataByTagRO(), getDataByTagRW(), getDefaultOffset(), getOffsetForTag(), and getPointOffset().

## m_offsetLookup

DataMapType escript::DataTagged::m_offsetLookup

private

Referenced by addTag(), addTaggedValue(), DataTagged(), getDataByTagRO(), getDataByTagRW(), getOffsetForTag(), getPointOffset(), getSampleDataByTag(), getTagCount(), getTagLookup(), isCurrentTag(), setSlice(), setTaggedValue(), and toString().

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

- DataTagged.h
- DataTagged.cpp