18 #if !defined escript_BinaryOp_20040315_H
19 #define escript_BinaryOp_20040315_H
44 template <
class BinaryFunction>
46 BinaryFunction operation)
52 DataTagged::DataMapType::const_iterator i;
53 DataTagged::DataMapType::const_iterator lookupEnd=lookup.end();
60 for (i=lookup.begin();i!=lookupEnd;i++) {
64 for (i=lookup.begin();i!=lookupEnd;i++) {
82 template <
class BinaryFunction>
85 BinaryFunction operation)
90 DataTagged::DataMapType::const_iterator i;
91 DataTagged::DataMapType::const_iterator lookupEnd=lookup.end();
95 for (i=lookup.begin();i!=lookupEnd;i++) {
99 for (i=lookup.begin();i!=lookupEnd;i++) {
115 template <
class BinaryFunction>
117 BinaryFunction operation)
119 using namespace DataMaths;
121 int right_rank=right.
getRank();
125 DataTagged::DataMapType::const_iterator i;
126 DataTagged::DataMapType::const_iterator rightLookupEnd=rightLookup.end();
127 for (i=rightLookup.begin();i!=rightLookupEnd;i++) {
141 DataTagged::DataMapType::const_iterator leftLookupEnd=leftLookup.end();
142 for (i=leftLookup.begin();i!=leftLookupEnd;i++) {
159 template <
class BinaryFunction>
161 BinaryFunction operation)
174 template <
class BinaryFunction>
176 BinaryFunction operation)
187 #pragma omp parallel for private(i,j) schedule(static)
188 for (i=0;i<numSamples;i++) {
189 for (j=0;j<numDPPSample;j++) {
194 #pragma omp parallel for private(i,j) schedule(static)
195 for (i=0;i<numSamples;i++) {
196 for (j=0;j<numDPPSample;j++) {
DataVector implements an arbitrarily long vector of data values. DataVector is the underlying data co...
Definition: DataVector.h:44
void addTag(int tagKey)
addTag - does not modify the default value for this object. ** Not unit tested ** ...
Definition: DataTagged.cpp:429
bool isCurrentTag(int tag) const
isCurrentTag
Definition: DataTagged.h:631
virtual DataTypes::ValueType::size_type getPointOffset(int sampleNo, int dataPointNo) const
Return the offset for the given given data point. This returns the offset in bytes for the given poin...
Definition: DataExpanded.cpp:339
DataTypes::ValueType::size_type getDefaultOffset() const
Returns the offset in the structure which stores the default value.
Definition: DataTagged.h:639
Definition: DataReady.h:35
void binaryOp(DataTypes::ValueType &left, const DataTypes::ShapeType &leftShape, DataTypes::ValueType::size_type leftOffset, const DataTypes::ValueType &right, const DataTypes::ShapeType &rightShape, DataTypes::ValueType::size_type rightOffset, BinaryFunction operation)
Perform the binary operation on the data points specified by the given offsets in the "left" and "rig...
Definition: DataMaths.h:842
DataConstant stores a single data point which represents the entire function space.
Definition: DataConstant.h:37
Give a short description of what DataExpanded does.
Definition: DataExpanded.h:44
const DataMapType & getTagLookup() const
getTagLookup
Definition: DataTagged.h:660
DataTypes::ValueType::const_reference getDataByTagRO(int tag, DataTypes::ValueType::size_type i) const
Definition: DataTagged.cpp:542
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:38
Simulates a full dataset accessible via sampleNo and dataPointNo.
Definition: DataTagged.h:43
DataTypes::ValueType & getVectorRW()
Return a reference to the underlying DataVector.
Definition: DataTagged.cpp:869
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:589
std::map< int, int > DataMapType
Definition: DataTagged.h:56
const DataTypes::ValueType & getVectorRO() const
Definition: DataConstant.cpp:375
DataTypes::ValueType & getVectorRW()
Return a reference to the underlying DataVector.
Definition: DataConstant.cpp:368
virtual const DataTypes::ValueType & getVectorRO() const =0
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:600
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:619
DataTypes::ValueType & getVectorRW()
Return a a reference to the underlying DataVector.
Definition: DataExpanded.cpp:822
int getRank(const DataTypes::ShapeType &shape)
Return the rank (number of dimensions) of the given shape.
Definition: DataTypes.h:167
const DataTypes::ValueType & getVectorRO() const
Definition: DataTagged.cpp:876
long size_type
Definition: DataVector.h:60
virtual ValueType::size_type getPointOffset(int sampleNo, int dataPointNo) const =0
Return the offset for the given sample. This returns the offset for the given point into the containe...
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:630
Describes binary operations performed on DataVector.
void binaryOp(DataTagged &left, const DataConstant &right, BinaryFunction operation)
Perform the given binary operation.
Definition: BinaryOp.h:45
DataTypes::ValueType::size_type getOffsetForTag(int tag) const
getOffsetForTag
Definition: DataTagged.cpp:531