Commit f98e8f75 authored by remi cresson's avatar remi cresson

FIX: deals with the (percentMemory>1) case

parent 8adb0e7c
......@@ -331,7 +331,7 @@ void Controller<TSegmenter>::GetAutomaticConfiguration()
// In the following steps, we will optimize tiling layout, starting from a number
// of tiles equal to "minimumNumberOfTiles", up to a number of tiles equal to
// twice the number of tiles (that is memory usage about 50%)
// 4 times the number of tiles (that is double rows/cols)
unsigned int maximumNumberOfTiles = minimumNumberOfTiles * 4;
// Search for layout which minimizes the criterion
......@@ -364,7 +364,7 @@ void Controller<TSegmenter>::GetAutomaticConfiguration()
tileHeight += 2*maxMargin;
// Memory use efficiency
float percentMemory = tileWidth * tileHeight / (float) maximumNumberOfNodesInMemory; // ]0, 1]
float percentMemory = tileWidth * tileHeight / (float) maximumNumberOfNodesInMemory; // is > 0. Could be greater than 1 in some cases!
// Compactness
float perimeter = tileWidth + tileHeight;
......@@ -384,7 +384,7 @@ void Controller<TSegmenter>::GetAutomaticConfiguration()
<< " Size (with margin): " << tileWidth << "x" << tileHeight
<< " (margin=" << maxMargin << "/nb. iter=" << maxIter << ")" );
if (criterion < lowestCriterionValue)
if (criterion < lowestCriterionValue && percentMemory <= 1.0)
{
lowestCriterionValue = criterion;
m_NbTilesX = layoutNCol;
......
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