192 |
BinaryFunction operation, |
BinaryFunction operation, |
193 |
double initial_value) |
double initial_value) |
194 |
{ |
{ |
|
const DataTagged::DataMapType& lookup=data.getTagLookup(); |
|
|
DataTagged::DataMapType::const_iterator i; |
|
|
DataTagged::DataMapType::const_iterator lookupEnd=lookup.end(); |
|
|
DataArrayView& dataView=data.getPointDataView(); |
|
195 |
double current_value=initial_value; |
double current_value=initial_value; |
196 |
// perform the operation on each tagged value |
// perform the operation on each tagged value |
197 |
for (i=lookup.begin();i!=lookupEnd;i++) { |
DataArrayView& dataView=data.getPointDataView(); |
198 |
|
const DataTagged::DataMapType& lookup=data.getTagLookup(); |
199 |
|
for (DataTagged::DataMapType::const_iterator i=lookup.begin(); i!=lookup.end(); i++) { |
200 |
current_value=operation(current_value,dataView.reductionOp(i->second,operation,initial_value)); |
current_value=operation(current_value,dataView.reductionOp(i->second,operation,initial_value)); |
201 |
} |
} |
202 |
// perform the operation on the default value |
// perform the operation on the default value |
257 |
BinaryFunction operation, |
BinaryFunction operation, |
258 |
double initial_value) |
double initial_value) |
259 |
{ |
{ |
260 |
const DataTagged::DataMapType& lookup=data.getTagLookup(); |
// perform the operation on each tagged value in data |
|
DataTagged::DataMapType::const_iterator i; |
|
|
DataTagged::DataMapType::const_iterator lookupEnd=lookup.end(); |
|
|
DataArrayView dataView=data.getPointDataView(); |
|
|
DataArrayView resultView=result.getPointDataView(); |
|
|
// perform the operation on each tagged data value |
|
261 |
// and assign this to the corresponding element in result |
// and assign this to the corresponding element in result |
262 |
for (i=lookup.begin();i!=lookupEnd;i++) { |
const DataTagged::DataMapType& lookup=data.getTagLookup(); |
263 |
resultView.getData(i->second) = |
for (DataTagged::DataMapType::const_iterator i=lookup.begin(); i!=lookup.end(); i++) { |
264 |
dataView.reductionOp(i->second,operation,initial_value); |
result.getDataPointByTag(i->first).getData(0) = |
265 |
|
data.getDataPointByTag(i->first).reductionOp(operation,initial_value); |
266 |
} |
} |
267 |
// perform the operation on the default data value |
// perform the operation on the default data value |
268 |
// and assign this to the default element in result |
// and assign this to the default element in result |
269 |
resultView.getData(0) = |
result.getDefaultValue().getData(0) = |
270 |
data.getDefaultValue().reductionOp(operation,initial_value); |
data.getDefaultValue().reductionOp(operation,initial_value); |
271 |
} |
} |
272 |
|
|