Moved serial mode to target mcelecron_serial.
Implemented parallelization with mpi.
This commit is contained in:
@@ -54,21 +54,21 @@ template <class T_Map>
|
||||
template <typename T>
|
||||
void Average_Container<T_Map>::rec_calcMap(const T &subMap, std::deque<double> Points) {
|
||||
double curVal, nextVal, avgVal;
|
||||
typename T::const_iterator curItr, nextItr;
|
||||
for (nextItr = ++(subMap.cbegin()); nextItr!= subMap.cend(); nextItr++) {
|
||||
curItr = nextItr;
|
||||
--curItr;
|
||||
curVal = curItr->first;
|
||||
nextVal = nextItr->first;
|
||||
typename T::const_iterator curitr, nextitr;
|
||||
for (nextitr = ++(subMap.cbegin()); nextitr!= subMap.cend(); nextitr++) {
|
||||
curitr = nextitr;
|
||||
--curitr;
|
||||
curVal = curitr->first;
|
||||
nextVal = nextitr->first;
|
||||
avgVal = curVal + (nextVal-curVal)/2;
|
||||
Points.push_back(avgVal);
|
||||
rec_calcMap(curItr->second, Points);
|
||||
rec_calcMap(curitr->second, Points);
|
||||
Points.pop_back();
|
||||
}
|
||||
// insert last point as overflow value
|
||||
curItr = (--subMap.cend());
|
||||
Points.push_back(curItr->first);
|
||||
rec_calcMap(curItr->second, Points);
|
||||
curitr = (--subMap.cend());
|
||||
Points.push_back(curitr->first);
|
||||
rec_calcMap(curitr->second, Points);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user