Commit 426a85df authored by Quentin Khan's avatar Quentin Khan

testFmmAlgorithmBalancedUtils: corrected near field cost calculation

parent b0229ff6
......@@ -123,11 +123,46 @@ void printZonesCosts(OctreeClass& tree, FCostZones<OctreeClass, CellClass>& cost
for(auto z : zones) {
for(auto cell : z) {
std::get<0>(zonecosts.at(zoneIdx)) += cell.second->getCost();
std::get<1>(zonecosts.at(zoneIdx)) += cell.second->getNearCost();
}
zoneIdx++;
}
auto nearZones = costzones.getLeafZoneBounds();
zoneIdx = 0;
int colourIdx = 0;
for(auto z : nearZones) {
colourIdx = 0;
for(auto c : z) {
it.gotoBottomLeft();
const MortonIndex start = c.first;
int count = c.second;
while( start != it.getCurrentGlobalIndex() ) {
it.moveRight();
}
while(count > 0) {
if( FCoordColour::coord2colour(
it.getCurrentCell()->getCoordinate())
== colourIdx) {
std::get<1>(zonecosts.at(zoneIdx)) +=
it.getCurrentCell()->getNearCost();
count--;
}
it.moveRight();
}
colourIdx++;
}
zoneIdx++;
}
zoneIdx = 0;
for(auto z : zonecosts) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment