stop is no proxy can be added

fix infinite loop in case no proxy could be added
and error threshold is not yet reached
This commit is contained in:
Sébastien Loriot 2022-01-07 15:42:50 +01:00
parent 798cd4a00b
commit 6911f0c6a3
1 changed files with 3 additions and 1 deletions

View File

@ -1152,7 +1152,9 @@ private:
target_px = max_nb_proxies;
else
target_px *= 2;
add_proxies_error_diffusion(target_px - m_proxies.size());
// if no proxies could be added, stop
if( add_proxies_error_diffusion(target_px - m_proxies.size()) == 0)
break;
const FT err = run(nb_relaxations);
error_drop = err / initial_err;
}