On Apr 9, 2013, at 10:23 AM, Quan <[email protected]> wrote: > Hi, > > I wonder how can I compute the total number of function evaluations (N) in > the algorithm so that I will know when the algorithm stop ( opt.maxeval < N) ? > > For example, in the following optimization problem > > minimize f(x1,x2,...,xp) > subject to { Xmin <= X <= Xmax } > > I use an algorithm , e.g. NLOPT_LD_LBFGS. The input for each iteration is [ > f(X) , df(X) ] . I use the "Central difference approximation" method to > compute the gradient vector df(X). > > So I count the number of function evaluations like this: > - In each iteration of the algorithm: n = 1 + 2*p (1 evaluation for f(X), > and 2*p evaluations for df(X)) > - The total number of function evaluations with M iterations: N = M * (1+2*p) > > and the process will stop when { opt.maxeval < M * (1+2*p) }
No, it will stop when maxeval < M. maxeval is related to a count of the number of times NLopt calls your objective function to obtain f and df. NLopt has no way of knowing that, internally, you are using 2*p additional function evaluations to compute df.
_______________________________________________ NLopt-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
