escript
Revision_
|
Simulates a full dataset accessible via sampleNo and dataPointNo. More...
#include <DataTagged.h>
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 |
![]() | |
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) | |
Alternative Constructor for DataTagged. More... | |
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 DataAbstract * | deepCopy () const |
Return a deep copy of the current object. 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 ®ion) const |
getSlice More... | |
DataTagged (const DataTagged &other, const DataTypes::RegionType ®ion) | |
Slice Constructor for DataTagged. More... | |
virtual void | setSlice (const DataAbstract *other, const DataTypes::RegionType ®ion) |
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 () |
![]() | |
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... | |
![]() | |
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 | |
![]() | |
int | m_noSamples |
int | m_noDataPointsPerSample |
bool | m_iscompl |
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.
typedef std::vector<DataTypes::CplxVectorType::ElementType> escript::DataTagged::CplxBatchType |
typedef std::map<int, int> escript::DataTagged::DataMapType |
typedef std::vector<DataTypes::RealVectorType::ElementType> escript::DataTagged::FloatBatchType |
|
private |
typedef std::vector<int> escript::DataTagged::TagListType |
|
explicit |
Alternative Constructor for DataTagged.
Description: Alternative Constructor for DataTagged.
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(), and getSlice().
|
explicit |
|
explicit |
Alternative Constructor for DataTagged.
Description: Alternative Constructor for DataTagged.
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_r, m_offsetLookup, escript::DataTypes::noValues(), and escript::DataTypes::DataVectorAlt< T >::size().
|
explicit |
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.
|
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().
|
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.
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().
|
explicit |
|
inlinevirtual |
Destructor.
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.
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().
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.
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::Data::bessel(), escript::binaryOpDataReadyHelperTCT(), escript::binaryOpDataReadyHelperTTC(), escript::binaryOpDataReadyHelperTTT(), escript::C_GeneralTensorProduct(), escript::C_TensorUnaryOperation(), escript::Data::copyWithMask(), DataTagged(), eigenvalues(), eigenvalues_and_eigenvectors(), escript::Data::get_MPIComm(), hermitian(), matrixInverse(), setSlice(), swapaxes(), symmetric(), trace(), and transpose().
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.
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(), escript::condEval(), and setTaggedValue().
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().
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.
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 DataTypes::RealVectorType & | values, | ||
const ShapeType & | vShape | ||
) |
Description: Add the given tags and values to this DataTagged object.
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().
|
virtual |
Computes an antihermitian matrix (A - A*) / 2.
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.
|
virtual |
Computes a antisymmetric matrix (A - AT) / 2.
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.
|
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 replaceNaN().
|
virtual |
Return a deep copy of the current object.
Implements escript::DataAbstract.
References DataTagged().
|
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.
|
virtual |
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
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.
|
virtual |
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev and eigenvectors V
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.
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.
Referenced by escript::Data::bessel(), escript::C_GeneralTensorProduct(), escript::C_TensorUnaryOperation(), escript::condEval(), escript::Data::get_MPIComm(), and getDataByTagRW().
DataTypes::CplxVectorType::const_reference escript::DataTagged::getDataByTagRO | ( | int | tag, |
DataTypes::CplxVectorType::size_type | i, | ||
DataTypes::cplx_t | dummy | ||
) | const |
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.
tag | - Input - Integer key. |
i | - position in the underlying datastructure |
References CHECK_FOR_EX_WRITE, getDataByTagRO(), m_data_c, m_data_r, m_defaultValueOffset, and m_offsetLookup.
Referenced by escript::Data::bessel(), escript::C_GeneralTensorProduct(), escript::C_TensorUnaryOperation(), escript::Data::dp_algorithm(), and escript::Data::get_MPIComm().
DataTypes::CplxVectorType::reference escript::DataTagged::getDataByTagRW | ( | int | tag, |
DataTypes::CplxVectorType::size_type | i, | ||
DataTypes::cplx_t | dummy | ||
) |
|
inline |
Returns the offset in the structure which stores the default value.
Referenced by antihermitian(), antisymmetric(), escript::Data::copyWithMask(), DataTagged(), escript::Data::dp_algorithm(), eigenvalues(), eigenvalues_and_eigenvectors(), hermitian(), matrixInverse(), escript::Data::reduction(), setSlice(), swapaxes(), symmetric(), toString(), trace(), and transpose().
|
inline |
References getDefaultValueRW().
Referenced by escript::Data::bessel(), escript::C_GeneralTensorProduct(), escript::C_TensorUnaryOperation(), escript::condEval(), and escript::Data::get_MPIComm().
|
inline |
|
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.
i | - position in the underlying datastructure |
Referenced by escript::Data::bessel(), escript::C_GeneralTensorProduct(), escript::C_TensorUnaryOperation(), escript::condEval(), escript::Data::get_MPIComm(), and getDefaultValueRO().
DataTypes::CplxVectorType::reference escript::DataTagged::getDefaultValueRW | ( | DataTypes::CplxVectorType::size_type | i, |
DataTypes::cplx_t | dummy | ||
) |
|
inlinevirtual |
getLength
Description: Return the total number of doubles stored for this DataTagged object. T
Implements escript::DataAbstract.
DataTypes::RealVectorType::size_type escript::DataTagged::getOffsetForTag | ( | int | tag | ) | const |
getOffsetForTag
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::condEval(), escript::Data::copyWithMask(), escript::Data::dp_algorithm(), eigenvalues(), eigenvalues_and_eigenvectors(), hermitian(), matrixInverse(), setSlice(), swapaxes(), symmetric(), trace(), and transpose().
|
virtual |
getPointOffset
Description: Return the offset to the given data-point value in the underlying data vector.
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(), escript::C_GeneralTensorProduct(), and escript::DataExpanded::DataExpanded().
|
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.
|
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.
|
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().
|
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().
|
inline |
getTagLookup
Description: Return a reference to the tag offset lookup table. T
Referenced by antihermitian(), antisymmetric(), escript::Data::bessel(), escript::binaryOpDataReadyHelperTCT(), escript::binaryOpDataReadyHelperTTC(), escript::binaryOpDataReadyHelperTTT(), escript::C_GeneralTensorProduct(), escript::C_TensorUnaryOperation(), escript::condEval(), escript::Data::copyWithMask(), DataTagged(), escript::Data::dp_algorithm(), dump(), eigenvalues(), eigenvalues_and_eigenvectors(), escript::Data::get_MPIComm(), hermitian(), matrixInverse(), escript::Data::reduction(), swapaxes(), symmetric(), trace(), and transpose().
|
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().
|
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().
|
virtual |
Implements escript::DataReady.
References m_data_c.
|
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().
|
virtual |
Implements escript::DataReady.
References CHECK_FOR_EX_WRITE, and m_data_c.
|
virtual |
|
virtual |
Implements escript::DataReady.
References m_data_c.
|
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(), matrixInverse(), swapaxes(), trace(), and transpose().
|
virtual |
Implements escript::DataReady.
References CHECK_FOR_EX_WRITE, and m_data_c.
Referenced by eigenvalues(), swapaxes(), trace(), and transpose().
|
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().
|
virtual |
Computes an hermitian matrix (A + A*) / 2.
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.
|
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 setSlice().
|
inlinevirtual |
|
virtual |
invert square matricies
out | - Where to store the results |
Reimplemented from escript::DataAbstract.
References addTag(), getDefaultOffset(), getOffsetForTag(), escript::DataAbstract::getRank(), escript::DataAbstract::getShape(), getTagLookup(), getVectorRW(), m_data_r, and escript::matrix_inverse().
|
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().
|
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().
|
virtual |
setSlice
Description: Copy the given Data object into the specified region in this object.
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.
|
virtual |
setTaggedValue
Description: Assign the given value to the given tag.
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().
|
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.
|
virtual |
sets all values to zero
Reimplemented from escript::DataAbstract.
References CHECK_FOR_EX_WRITE, m_data_r, and escript::DataTypes::DataVectorAlt< T >::size().
|
virtual |
swaps components axis0 and axis1
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().
|
virtual |
Computes a symmetric matrix (A + AT) / 2.
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().
|
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(), escript::DataAbstract::isComplex(), m_data_c, m_data_r, m_offsetLookup, and escript::DataTypes::pointToString().
|
virtual |
Computes the trace of a matrix.
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().
|
virtual |
Transpose each data point of this Data object around the given axis.
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().
|
private |
Referenced by addTag(), addTaggedValue(), antihermitian(), antisymmetric(), complicate(), DataTagged(), eigenvalues(), getDataByTagRW(), getSampleDataByTag(), getTypedVectorRO(), getTypedVectorRW(), getVectorROC(), getVectorRWC(), hasNaN(), hermitian(), replaceNaN(), setSlice(), setTaggedValue(), swapaxes(), symmetric(), toString(), trace(), and transpose().
|
private |
Referenced by addTag(), addTaggedValue(), antisymmetric(), complicate(), DataTagged(), dump(), eigenvalues(), eigenvalues_and_eigenvectors(), getDataByTagRO(), getDataByTagRW(), getSampleDataByTag(), getTypedVectorRO(), getTypedVectorRW(), getVectorRO(), getVectorRW(), hasNaN(), matrixInverse(), replaceNaN(), setSlice(), setTaggedValue(), setToZero(), swapaxes(), symmetric(), toString(), trace(), and transpose().
|
staticprivate |
Referenced by addTag(), getDataByTagRO(), getDataByTagRW(), getOffsetForTag(), and getPointOffset().
|
private |