bucolicwind
12-13-2009, 10:06 AM
see the lines in red.
if (maxval(abs(fvec(:))) < TOLF) then
check=.false.
RETURN
end if
if (check) then
if (restrt .or. maxval(abs(g(:))*max(abs(x(:)), &
1.0_Dp)/max(f,0.5_Dp*n)) < TOLMIN) RETURN
restrt=.true.
else
restrt=.false.
if (maxval((abs(x(:)-xold(:)))/max(abs(x(:)), &
1.0_Dp)) < TOLX) RETURN
end if
end do
########################
To my knowledge, the codes in red are at least theoretically improper, although they do not seem to have any influence on the computing results. I think the gradient vector should be recalculated at the new point obtained by line search strategy when it is used as an convergence criterion.
if (maxval(abs(fvec(:))) < TOLF) then
check=.false.
RETURN
end if
if (check) then
if (restrt .or. maxval(abs(g(:))*max(abs(x(:)), &
1.0_Dp)/max(f,0.5_Dp*n)) < TOLMIN) RETURN
restrt=.true.
else
restrt=.false.
if (maxval((abs(x(:)-xold(:)))/max(abs(x(:)), &
1.0_Dp)) < TOLX) RETURN
end if
end do
########################
To my knowledge, the codes in red are at least theoretically improper, although they do not seem to have any influence on the computing results. I think the gradient vector should be recalculated at the new point obtained by line search strategy when it is used as an convergence criterion.