diff --git a/include/lsgrmController.txx b/include/lsgrmController.txx index 033f077c08038f8c99e269ad5a522ccfe8809160..f44c324a2838bf178efa4cdad3ca546d2e081bdf 100644 --- a/include/lsgrmController.txx +++ b/include/lsgrmController.txx @@ -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;