escript  Revision_
DataTagged.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
18 
19 #ifndef __ESCRIPT_DATATAGGED_H__
20 #define __ESCRIPT_DATATAGGED_H__
21 
22 #include "system_dep.h"
23 
24 #include "DataReady.h"
25 #include "DataTypes.h"
26 
27 #include <map>
28 #include <vector>
29 
30 namespace escript {
31 
32 class DataConstant;
33 
46 {
47  typedef DataReady parent;
48  public:
49 
50  //
51  // Types for the lists of tags and values.
52  typedef std::vector<int> TagListType;
53  typedef std::vector<DataTypes::RealVectorType::ElementType> FloatBatchType;
54  typedef std::vector<DataTypes::CplxVectorType::ElementType> CplxBatchType;
55 
56  //
57  // Map from a tag to an offset into the data array.
58  typedef std::map<int, int> DataMapType;
59 
72  explicit DataTagged(const FunctionSpace& what,
73  const DataTypes::ShapeType &shape,
74  const int tags[],
75  const DataTypes::RealVectorType& data);
76 
77 
78  explicit DataTagged(const FunctionSpace& what,
79  const DataTypes::ShapeType &shape,
80  const int tags[],
81  const DataTypes::CplxVectorType& data);
82 
83 
96  explicit DataTagged(const FunctionSpace& what,
97  const DataTypes::ShapeType &shape,
98  const TagListType& tags,
99  const DataTypes::RealVectorType& data);
100 
101  explicit DataTagged(const FunctionSpace& what,
102  const DataTypes::ShapeType &shape,
103  const TagListType& tags,
104  const DataTypes::CplxVectorType& data);
105 
106 
113  DataTagged(const DataTagged& other);
114 
122  explicit DataTagged(const DataConstant& other);
123 
134  explicit DataTagged(const FunctionSpace& what,
135  const DataTypes::ShapeType& shape,
136  const DataTypes::RealVectorType& defaultvalue,
137  const DataTagged* tagsource=0);
138 
139  explicit DataTagged(const FunctionSpace& what,
140  const DataTypes::ShapeType& shape,
141  const DataTypes::CplxVectorType& defaultvalue,
142  const DataTagged* tagsource=0);
143 
144 
149  inline virtual
151 
152  bool
153  isTagged() const
154  {
155  return true;
156  };
157 
161  bool
162  hasNaN() const;
163 
167  void
168  replaceNaN(DataTypes::real_t value);
169 
173  void
174  replaceNaN(DataTypes::cplx_t value);
175 
179  // ESCRIPT_DLL_API class already exported
180  virtual bool
181  hasInf() const;
182 
186  // ESCRIPT_DLL_API class already exported
187  virtual void
188  replaceInf(DataTypes::real_t value);
189 
193  // ESCRIPT_DLL_API class already exported
194  virtual void
195  replaceInf(DataTypes::cplx_t value);
196 
197 
201  virtual
202  DataAbstract*
203  deepCopy() const;
204 
205 
210  // ESCRIPT_DLL_API class already exported
211  virtual
212  DataAbstract*
213  zeroedCopy() const;
214 
215 
228  virtual
230  getSampleDataByTag(int tag, DataTypes::real_t dummy=0);
231 
232  virtual
234  getSampleDataByTag(int tag, DataTypes::cplx_t dummy);
235 
236 
244  virtual
245  std::string
246  toString() const;
251  virtual
252  void
253  dump(const std::string fileName) const;
254 
260  virtual int
261  matrixInverse(DataAbstract* out) const;
262 
267  virtual
268  void
269  setToZero();
270 
277  virtual
278  int
279  getTagNumber(int dpno);
280 
293  virtual
295  getPointOffset(int sampleNo,
296  int dataPointNo) const;
297 
315  void
316  addTaggedValues(const TagListType& tagKeys,
317  const FloatBatchType& values,
318  const ShapeType& vShape);
319 
320 
337  void
338  addTaggedValues(const TagListType& tagKeys,
339  const DataTypes::RealVectorType& values,
340  const ShapeType& vShape);
341 
342 
343 
344 
357  void
358  addTaggedValue(int tagKey,
359  const DataTypes::ShapeType& pointshape,
360  const DataTypes::RealVectorType& value,
361  int dataOffset=0);
362 
363  void
364  addTaggedValue(int tagKey,
365  const DataTypes::ShapeType& pointshape,
366  const DataTypes::CplxVectorType& value,
367  int dataOffset=0);
368 
369 
380  void
381  addTag(int tagKey);
382 
395  void
396  setTaggedValue(int tagKey,
397  const DataTypes::ShapeType& pointshape,
398  const DataTypes::RealVectorType& value,
399  int dataOffset=0);
400 
401  void
402  setTaggedValue(int tagKey,
403  const DataTypes::ShapeType& pointshape,
404  const DataTypes::CplxVectorType& value,
405  int dataOffset=0);
406 
407 
419  getDataByTagRW(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0);
420 
422  getDataByTagRO(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const;
423 
424 
427 
430 
441  getOffsetForTag(int tag) const;
442 
443 
450  getVectorRW();
451 
453  getVectorRO() const;
454 
455 
457  getVectorRWC();
458 
460  getVectorROC() const;
461 
462 
464  getTypedVectorRW(DataTypes::real_t dummy);
465 
466  virtual const DataTypes::RealVectorType&
467  getTypedVectorRO(DataTypes::real_t dummy) const;
468 
470  getTypedVectorRW(DataTypes::cplx_t dummy);
471 
472  virtual const DataTypes::CplxVectorType&
473  getTypedVectorRO(DataTypes::cplx_t dummy) const;
474 
475 
476 
477 
478 
487  const DataMapType&
488  getTagLookup() const;
489 
501  bool
502  isCurrentTag(int tag) const;
503 
514  getDefaultValueRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0);
515 
517  getDefaultValueRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const;
518 
521 
523  getDefaultValueRO(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy) const;
524 
525 
526 
527 
536  virtual
538  getLength() const;
539 
550  virtual
551  DataAbstract*
552  getSlice(const DataTypes::RegionType& region) const;
553 
565  DataTagged(const DataTagged& other,
566  const DataTypes::RegionType& region);
567 
578  virtual
579  void
580  setSlice(const DataAbstract* other,
581  const DataTypes::RegionType& region);
582 
583 
591  virtual void
592  symmetric(DataAbstract* ev);
593 
601  virtual void
603 
611  virtual void
612  hermitian(DataAbstract* ev);
613 
621  virtual void
623 
631  virtual void
632  trace(DataAbstract* ev, int axis_offset);
633 
642  virtual void
643  swapaxes(DataAbstract* ev, int axis0, int axis1);
644 
652  virtual void
653  transpose(DataAbstract* ev, int axis_offset);
654 
662  virtual void
664 
676  virtual void
677  eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol=1.e-13);
678 
679 
684  getDefaultOffset() const;
685 
689  size_t
690  getTagCount() const;
691 
692  void
693  complicate();
694 
695  protected:
696 
697  private:
698 
699  //
700  // The offset lookup table
702 
703  //
704  // the offset to the default value
705  static const int m_defaultValueOffset = 0;
706 
707  // the actual data
710 
711 
712 };
713 
714 inline
715 bool
717 {
718  DataMapType::const_iterator pos(m_offsetLookup.find(tag));
719  return (pos!=m_offsetLookup.end());
720 }
721 
722 inline
725 {
726  return m_defaultValueOffset;
727 }
728 
729 inline
732 {
733  return getVectorRW()[i]; // getVectorRW has exclusive write checks
734 }
735 
736 inline
739 {
740  return getVectorRO()[i];
741 }
742 
743 inline
746 {
747  return getVectorRWC()[i]; // getVectorRW has exclusive write checks
748 }
749 
750 inline
753 {
754  return getVectorROC()[i];
755 }
756 
757 
758 
759 
760 inline
763 {
764  return m_offsetLookup;
765 }
766 
767 inline
770 {
771  return std::max(m_data_c.size(), m_data_r.size());
772 }
773 
774 } // end of namespace
775 
776 #endif // __ESCRIPT_DATATAGGED_H__
777 
escript::DataTypes::maxRank
static const int maxRank
The maximum number of dimensions a datapoint can have.
Definition: DataTypes.h:47
escript::DataTagged::getLength
virtual DataTypes::RealVectorType::size_type getLength() const
getLength
Definition: DataTagged.h:769
CHECK_FOR_EX_WRITE
#define CHECK_FOR_EX_WRITE
Definition: DataTagged.cpp:40
MPI_Status
int MPI_Status
Definition: EsysMPI.h:47
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
escript::FunctionSpace::getTagFromSampleNo
int getTagFromSampleNo(DataTypes::dim_t sampleNo) const
Returns the tag associated with the given sample number.
Definition: FunctionSpace.cpp:144
escript::DataTypes::real_t
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:52
escript::DataTagged::getTagLookup
const DataMapType & getTagLookup() const
getTagLookup
Definition: DataTagged.h:762
escript::DataTagged::swapaxes
virtual void swapaxes(DataAbstract *ev, int axis0, int axis1)
swaps components axis0 and axis1
Definition: DataTagged.cpp:1248
escript::DataTypes::DataVectorAlt::const_reference
const ElementType & const_reference
Definition: DataVectorAlt.h:52
escript::DataTagged::addTag
void addTag(int tagKey)
addTag - does not modify the default value for this object. ** Not unit tested **
Definition: DataTagged.cpp:685
escript::DataTagged::setToZero
virtual void setToZero()
sets all values to zero
Definition: DataTagged.cpp:1391
escript::DataTypes::copySlice
void copySlice(VEC &left, const ShapeType &leftShape, typename VEC::size_type leftOffset, const VEC &other, const ShapeType &otherShape, typename VEC::size_type otherOffset, const RegionLoopRangeType &region)
Copy a data slice specified by the given region and offset from the "other" vector into the "left" ve...
Definition: DataVector.h:174
escript::DataTagged::complicate
void complicate()
Definition: DataTagged.cpp:1701
escript::DataTagged::eigenvalues
virtual void eigenvalues(DataAbstract *ev)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
Definition: DataTagged.cpp:1283
escript::DataConstant::getTypedVectorRO
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataConstant.cpp:872
escript::DataTagged::getDataByTagRW
DataTypes::RealVectorType::reference getDataByTagRW(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDataByTag
Definition: DataTagged.cpp:1017
escript::DataTagged::getVectorRW
DataTypes::RealVectorType & getVectorRW()
Return a reference to the underlying DataVector.
Definition: DataTagged.cpp:1643
escript::antihermitian
void antihermitian(const DataTypes::CplxVectorType &in, const DataTypes::ShapeType &inShape, typename DataTypes::CplxVectorType::size_type inOffset, DataTypes::CplxVectorType &ev, const DataTypes::ShapeType &evShape, typename DataTypes::CplxVectorType::size_type evOffset)
computes a antihermitian matrix from your square matrix A: (A - adjoint(A)) / 2
Definition: DataVectorOps.cpp:963
escript::DataTagged::trace
virtual void trace(DataAbstract *ev, int axis_offset)
Computes the trace of a matrix.
Definition: DataTagged.cpp:1178
escript::DataTagged::getDefaultOffset
DataTypes::RealVectorType::size_type getDefaultOffset() const
Returns the offset in the structure which stores the default value.
Definition: DataTagged.h:724
escript::DataTagged::getDataByTagRW
DataTypes::CplxVectorType::reference getDataByTagRW(int tag, DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
escript::DataTypes::checkShape
bool checkShape(const ShapeType &s1, const ShapeType &s2)
Test if two shapes are equal.
Definition: DataTypes.h:311
escript::DataConstant
DataConstant stores a single data point which represents the entire function space.
Definition: DataConstant.h:38
escript::eigenvalues
void eigenvalues(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, typename DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &ev, const DataTypes::ShapeType &evShape, typename DataTypes::RealVectorType::size_type evOffset)
solves a local eigenvalue problem
Definition: DataVectorOps.h:639
escript::DataTagged::getDefaultValueRW
DataTypes::RealVectorType::reference getDefaultValueRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDefaultValue
Definition: DataTagged.h:731
escript::DataTypes::DataVectorAlt::resize
void resize(const size_type newSize, const value_type newVal=0.0, const size_type newBlockSize=1)
Resize the DataVectorAlt to the given length "newSize". All current data is lost. All elements in the...
Definition: DataVectorAlt.h:291
escript::DataTypes::DataVectorAlt< cplx_t >::size_type
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:50
escript::symmetric
void symmetric(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset)
computes a symmetric matrix from your square matrix A: (A + transpose(A)) / 2
Definition: DataVectorOps.h:103
escript::DataTypes::DataVectorAlt< real_t >
escript::DataTagged::m_defaultValueOffset
static const int m_defaultValueOffset
Definition: DataTagged.h:705
escript::transpose
void transpose(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataVectorOps.h:343
escript::DataTagged::getDataByTagRO
DataTypes::RealVectorType::const_reference getDataByTagRO(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.cpp:1006
escript::DataAbstract::getRank
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:653
escript::DataTagged::m_data_c
DataTypes::CplxVectorType m_data_c
Definition: DataTagged.h:709
escript::FunctionSpace
Definition: FunctionSpace.h:36
escript::DataTypes::getSliceRegionLoopRange
DataTypes::RegionLoopRangeType getSliceRegionLoopRange(const DataTypes::RegionType &region)
Modify region to copy from in order to deal with the case where one range in the region contains iden...
Definition: DataTypes.cpp:188
escript::DataReady
Definition: DataReady.h:37
escript::FunctionSpace::canTag
bool canTag() const
Returns true if this function space support tags.
Definition: FunctionSpace.cpp:353
escript::DataTagged::getVectorRO
const DataTypes::RealVectorType & getVectorRO() const
Definition: DataTagged.cpp:1650
escript::DataTagged::parent
DataReady parent
Definition: DataTagged.h:47
escript::DataTagged::CplxBatchType
std::vector< DataTypes::CplxVectorType::ElementType > CplxBatchType
Definition: DataTagged.h:54
escript::DataTagged::DataMapType
std::map< int, int > DataMapType
Definition: DataTagged.h:58
MPI_INT
#define MPI_INT
Definition: EsysMPI.h:48
escript::DataTagged::hasInf
virtual bool hasInf() const
Return true if data contains Inf or -Inf.
Definition: DataTagged.cpp:843
escript::LapackInverseHelper
Definition: LapackInverseHelper.h:28
escript::DataTagged
Simulates a full dataset accessible via sampleNo and dataPointNo.
Definition: DataTagged.h:46
escript::DataAbstract::getNumDPPSample
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:612
MPI_COMM_WORLD
#define MPI_COMM_WORLD
Definition: EsysMPI.h:50
escript::DataException
Definition: DataException.h:28
escript::DataTagged::getDefaultValueRW
DataTypes::CplxVectorType::reference getDefaultValueRW(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
escript::hermitian
void hermitian(const DataTypes::CplxVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::CplxVectorType::size_type inOffset, DataTypes::CplxVectorType &ev, const DataTypes::ShapeType &evShape, DataTypes::CplxVectorType::size_type evOffset)
computes an hermitian matrix from your square matrix A: (A + adjoint(A)) / 2
Definition: DataVectorOps.cpp:916
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:44
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74
escript::DataTagged::getDataByTagRO
DataTypes::CplxVectorType::const_reference getDataByTagRO(int tag, DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy) const
escript::DataTypes
Contains the types to represent Shapes, Regions, RegionLoop ranges and vectors of data as well as the...
Definition: DataTypes.cpp:88
escript::DataTypes::fillComplexFromReal
void fillComplexFromReal(const RealVectorType &r, CplxVectorType &c)
copy data from a real vector to a complex vector The complex vector will be resized as needed and any...
escript::DataTypes::copySliceFrom
void copySliceFrom(VEC &left, const ShapeType &leftShape, typename VEC::size_type leftOffset, const VEC &other, const ShapeType &otherShape, typename VEC::size_type otherOffset, const RegionLoopRangeType &region)
Copy data into a slice specified by the given region and offset in the left vector from the other vec...
Definition: DataVector.h:281
escript::DataTagged::setSlice
virtual void setSlice(const DataAbstract *other, const DataTypes::RegionType &region)
setSlice
Definition: DataTagged.cpp:393
escript::DataTagged::transpose
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataTagged.cpp:1213
escript::DataTagged::isTagged
bool isTagged() const
Definition: DataTagged.h:153
escript::DataTypes::RegionType
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:45
escript::DataTypes::noValues
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:91
escript::DataAbstract::getShape
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:642
escript::DataTypes::getResultSliceShape
DataTypes::ShapeType getResultSliceShape(const RegionType &region)
Determine the shape of the specified slice region.
Definition: DataTypes.cpp:173
escript::DataTagged::getVectorRWC
DataTypes::CplxVectorType & getVectorRWC()
Definition: DataTagged.cpp:1656
escript::DataAbstract::getNumSamples
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:623
escript::DataTagged::setTaggedValue
void setTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
setTaggedValue
Definition: DataTagged.cpp:497
escript::DataTagged::getTypedVectorRW
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataTagged.cpp:1669
escript::DataTagged::m_data_r
DataTypes::RealVectorType m_data_r
Definition: DataTagged.h:708
escript::DataTagged::getTypedVectorRO
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataTagged.cpp:1676
escript::DataTagged::deepCopy
virtual DataAbstract * deepCopy() const
Return a deep copy of the current object.
Definition: DataTagged.cpp:306
escript::DataTagged::addTaggedValues
void addTaggedValues(const TagListType &tagKeys, const FloatBatchType &values, const ShapeType &vShape)
addTaggedValues
Definition: DataTagged.cpp:554
escript::matrix_inverse
int matrix_inverse(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &out, const DataTypes::ShapeType &outShape, DataTypes::RealVectorType::size_type outOffset, int count, LapackInverseHelper &helper)
computes the inverses of square (up to 3x3) matricies
Definition: DataVectorOps.cpp:207
escript::DataTagged::getTagCount
size_t getTagCount() const
Return the number of tags which have been given values (+the default)
Definition: DataTagged.cpp:1695
escript::DataTagged::getPointOffset
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
getPointOffset
Definition: DataTagged.cpp:982
DataConstant.h
escript::DataTagged::zeroedCopy
virtual DataAbstract * zeroedCopy() const
Return an object with the same type, domain (and tags if appropriate) as this, but all values are zer...
Definition: DataTagged.cpp:313
escript::DataAbstract::m_iscompl
bool m_iscompl
Definition: DataAbstract.h:564
escript::DataTagged::matrixInverse
virtual int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataTagged.cpp:1357
escript::DataTagged::antihermitian
virtual void antihermitian(DataAbstract *ev)
Computes an antihermitian matrix (A - A*) / 2.
Definition: DataTagged.cpp:1152
escript::swapaxes
void swapaxes(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis0, int axis1)
swaps the components axis0 and axis1.
Definition: DataVectorOps.h:488
escript::DataTagged::antisymmetric
virtual void antisymmetric(DataAbstract *ev)
Computes a antisymmetric matrix (A - AT) / 2.
Definition: DataTagged.cpp:1089
escript::DataTypes::RegionLoopRangeType
std::vector< std::pair< int, int > > RegionLoopRangeType
Definition: DataTypes.h:46
V
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:121
escript::DataTagged::getSlice
virtual DataAbstract * getSlice(const DataTypes::RegionType &region) const
getSlice
Definition: DataTagged.cpp:334
escript::DataTagged::getDefaultValueRO
DataTypes::RealVectorType::const_reference getDefaultValueRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.h:738
escript::FunctionSpace::borrowListOfTagsInUse
const int * borrowListOfTagsInUse() const
Definition: FunctionSpace.cpp:330
escript::DataTagged::getVectorROC
const DataTypes::CplxVectorType & getVectorROC() const
Definition: DataTagged.cpp:1663
escript::DataTagged::replaceInf
virtual void replaceInf(DataTypes::real_t value)
replaces all (+/-)Inf values with value
Definition: DataTagged.cpp:878
escript::DataTagged::~DataTagged
virtual ~DataTagged()
Destructor.
Definition: DataTagged.h:150
escript
Definition: AbstractContinuousDomain.cpp:23
escript::DataTypes::DataVectorAlt::size
size_type size() const
Return the number of elements in this DataVectorAlt.
Definition: DataVectorAlt.h:215
escript::DataTypes::pointToString
std::string pointToString(const RealVectorType &data, const ShapeType &shape, int offset, const std::string &prefix)
Display a single value (with the specified shape) from the data.
DataTypes.h
escript::DataAbstract
Definition: DataAbstract.h:63
escript::DataTagged::symmetric
virtual void symmetric(DataAbstract *ev)
Computes a symmetric matrix (A + AT) / 2.
Definition: DataTagged.cpp:1052
escript::DataTagged::getOffsetForTag
DataTypes::RealVectorType::size_type getOffsetForTag(int tag) const
getOffsetForTag
Definition: DataTagged.cpp:995
escript::DataTagged::isCurrentTag
bool isCurrentTag(int tag) const
isCurrentTag
Definition: DataTagged.h:716
DataVectorOps.h
Describes binary operations performed on DataVector.
escript::DataTypes::createShapeErrorMessage
std::string createShapeErrorMessage(const std::string &messagePrefix, const DataTypes::ShapeType &other, const DataTypes::ShapeType &thisShape)
Produce a string containing two shapes.
Definition: DataTypes.cpp:206
escript::FunctionSpace::getTypeCode
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:95
escript::DataTagged::m_offsetLookup
DataMapType m_offsetLookup
Definition: DataTagged.h:701
DataTagged.h
escript::DataTagged::eigenvalues_and_eigenvectors
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
Definition: DataTagged.cpp:1319
escript::DataAbstract::isComplex
bool isComplex() const
true if the components of datapoints are complex
Definition: DataAbstract.cpp:70
escript::DataTagged::addTaggedValue
void addTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
addTaggedValue
Definition: DataTagged.cpp:608
escript::DataAbstract::getNoValues
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:664
escript::DataTypes::DataVectorAlt::reference
ElementType & reference
Definition: DataVectorAlt.h:51
Data.h
DataReady.h
escript::DataTagged::FloatBatchType
std::vector< DataTypes::RealVectorType::ElementType > FloatBatchType
Definition: DataTagged.h:53
escript::antisymmetric
void antisymmetric(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset)
computes a antisymmetric matrix from your square matrix A: (A - transpose(A)) / 2
Definition: DataVectorOps.h:152
escript::DataAbstract::getFunctionSpace
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:635
system_dep.h
escript::DataTypes::cplx_t
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:55
escript::DataTagged::getTagNumber
virtual int getTagNumber(int dpno)
Return the tag number associated with the given data-point number according to the associated functio...
Definition: DataTagged.cpp:467
escript::DataTagged::getSampleDataByTag
virtual DataTypes::real_t * getSampleDataByTag(int tag, DataTypes::real_t dummy=0)
getSampleDataByTag
Definition: DataTagged.cpp:731
escript::DataAbstract::ShapeType
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:67
escript::DataTagged::toString
virtual std::string toString() const
Write the data as a string. Writes out each tag, including the default, and the data-point which is a...
Definition: DataTagged.cpp:928
escript::DataTagged::dump
virtual void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataTagged.cpp:1547
escript::trace
void trace(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis_offset)
computes the trace of a matrix
Definition: DataVectorOps.h:242
escript::DataTagged::DataTagged
DataTagged(const FunctionSpace &what, const DataTypes::ShapeType &shape, const int tags[], const DataTypes::RealVectorType &data)
Alternative Constructor for DataTagged.
Definition: DataTagged.cpp:51
DataException.h
escript::DataTagged::hermitian
virtual void hermitian(DataAbstract *ev)
Computes an hermitian matrix (A + A*) / 2.
Definition: DataTagged.cpp:1124
escript::FunctionSpace::getNumberOfTagsInUse
int getNumberOfTagsInUse() const
Returns the number of tags in use.
Definition: FunctionSpace.cpp:325
escript::DataTagged::TagListType
std::vector< int > TagListType
Definition: DataTagged.h:52
escript::DataTagged::hasNaN
bool hasNaN() const
Return true if any one of the datapoints contains a NaN.
Definition: DataTagged.cpp:760
escript::DataTagged::replaceNaN
void replaceNaN(DataTypes::real_t value)
replaces all NaN values with value
Definition: DataTagged.cpp:795
escript::eigenvalues_and_eigenvectors
void eigenvalues_and_eigenvectors(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &ev, const DataTypes::ShapeType &evShape, DataTypes::RealVectorType::size_type evOffset, DataTypes::RealVectorType &V, const DataTypes::ShapeType &VShape, DataTypes::RealVectorType::size_type VOffset, const double tol=1.e-13)
solves a local eigenvalue problem
Definition: DataVectorOps.h:750