Currently the stopping condition is M-m <= \epsilon, where
M = max proj_gard(alpha) and m = min proj_grad(alpha).
This condition works well in practice, but we must ensure that the
following situation does not occur.
M, m >> 0 or M,m << 0
but
M - m <= \epsilon.
From the optimality condition, |M| and |m| must be close to zero.
For example, because
grad_i f(0) = -1, for all i.
M=m= -1 and they satisfy M-m <= \epsilon. Thus we add |M| <=\epsilon
and |m| <= \epsilon$ into the stopping condition. In fact we can use
only these two inequalities as the stopping condition, but for
historical reasons we keep M-m <= \epsilon as the main condition to
check.
if(iter % 10 == 0)
info(".");
- if(PGmax_new - PGmin_new <= eps)
+ if(PGmax_new - PGmin_new <= eps &&
+ fabs(PGmax_new) <= eps && fabs(PGmin_new) <= eps)
{
if(active_size == l)
break;