The optim function does not report neither niter nor nevalf.
Reported by Michael BAUDIN
Originally assigned to Paul BIGNIER
-- Bug description --
The optim function does not report neither niter nor nevalf.
Here:
* niter is the number of iterations
* nevalf is the number of function evaluations
This is a typical feature of an optimizer. It helps to understand the performance of the algorithm and to perform benchmarks.
These informations are printed in the console: this is useless if the informations are not reported (by programming) to the user as output arguments.
The calling sequence could be changed to
[f ,xopt ,gradopt ,work, niter, nevalf]=optim(...)
but this forces to retrieve the output matrix work, which can be large if the number of parameters is large. A better calling sequence would be:
[f ,xopt ,gradopt, niter, nevalf ,work]=optim(...)
This breaks backwards compatibility: this is a symptom of the bad initial design of the function.
-- Scilab error message --
-- How to reproduce the bug --