31 EV <<
"|DD|> StrategyRegions::StrategyRegions (Using Send Strategy 'Regions') <||" << endl;
55 std::stringstream tempStr;
70 branchRegionDataMap::const_iterator regionDataMapIterator =
regionData.begin();
72 while(regionDataMapIterator !=
regionData.end()) {
73 branchRegionMap = regionDataMapIterator->second;
75 regionCountMap::iterator bRMapIterator = branchRegionMap.begin();
77 while(bRMapIterator != branchRegionMap.end()) {
78 if(combinedRegionMap.find(bRMapIterator->first) == combinedRegionMap.end()) {
79 combinedRegionMap.insert(
regionCountPair(bRMapIterator->first, bRMapIterator->second));
81 combinedRegionMap.find(bRMapIterator->first)->second += bRMapIterator->second;
86 regionDataMapIterator++;
89 return combinedRegionMap;
104 std::stringstream tempStr;
107 regionCountMap::iterator rcmIterator = tmpRCMap.begin();
109 while (rcmIterator != tmpRCMap.end()) {
110 tempStr << rcmIterator->first <<
':' << rcmIterator->second <<
", ";
114 tempStr <<
" CRM:" << tmpRCMap.size() <<
" BC:" <<
regionData.size();
116 return tempStr.str();
138 regionCountMap::iterator rcmIterator = tmpRCMap.begin();
140 std::vector<std::vector<double> > globalViewData;
142 while(rcmIterator != tmpRCMap.end()) {
143 for(
int i = 0; i < rcmIterator->second; i++) {
149 return globalViewData;
154 std::vector<double> tmpDimVector = ncsInfo.
getCoords();
177 if(dimValue > (maxSpread * -1.0)) {
180 return (maxSpread * -1.0);
184 if(dimValue < maxSpread) {
196 int rangeShift =
static_cast<int> (sizePerDim / 2);
200 int currentDimension = 0;
202 for(Coords::iterator coordIt = coordVector.begin();
203 coordIt < coordVector.end(); coordIt++) {
206 static_cast<double>(maxSpread)) *
207 static_cast<double>(rangeShift));
210 if (coordNormalized > 0) coordNormalized += .5;
211 else coordNormalized -= .5;
214 int coordNormAndShifted =
static_cast<int>(coordNormalized) +
220 if (coordNormAndShifted == pow(sizePerDim , currentDimension))
221 coordNormAndShifted -= 1;
224 region += coordNormAndShifted * pow(sizePerDim , currentDimension);
243 int rangeShift =
static_cast<int> (sizePerDim / 2);
245 std::vector<double> rCoordVector;
246 std::vector<double> CoordVector;
250 int subRegionSize = 0;
253 for (
int curDim = dimCount; curDim >= 1; curDim--) {
254 subRegionSize = pow(sizePerDim, (curDim - 1));
255 dimShifted =
static_cast<int>(region / subRegionSize);
256 normDim = dimShifted - rangeShift;
257 region -= subRegionSize * dimShifted;
258 tmpDimension = (
static_cast<double>(normDim) /
259 static_cast<double>(rangeShift)) *
260 static_cast<double>(maxSpread);
261 rCoordVector.push_back(tmpDimension);
265 std::vector<double>::iterator vectorIterator;
266 for(vectorIterator = rCoordVector.end();
267 vectorIterator > rCoordVector.begin(); vectorIterator--) {
268 CoordVector.push_back((*(vectorIterator-1)));
292 branchRegionDataMap::const_iterator regionDataMapIterator =
295 if (regionDataMapIterator ==
regionData.end())
return;
298 if (currentTreeChildNodes.find(regionDataMapIterator->first) ==
299 currentTreeChildNodes.end() &&
300 regionDataMapIterator->first !=
thisNode) {
301 regionDataMapIterator =
regionData.erase(regionDataMapIterator);
303 }
else ++regionDataMapIterator;
304 }
while (regionDataMapIterator !=
regionData.end());