Dear Steven, that was also my first thought, but I removed all constraints and the error still occurs. I tested the following Code:
------------------------------- double minf; nlopt::result result; nlopt::opt opt_first(nlopt::LN_BOBYQA, N); opt_first.set_min_objective(opt_func, reinterpret_cast<void*>(¶meter)); opt_first.set_xtol_rel(1e-4); result = opt_first.optimize(Xmin, minf); nlopt::opt opt_second(nlopt::LN_BOBYQA, N); opt_second.set_min_objective(opt_func, reinterpret_cast<void*>(¶meter)); opt_second.set_xtol_rel(1e-4); result = opt_second.optimize(Xmin, minf); ------------------------------- The first run works as expected, the second one fails without even calling opt_func once. If I reset Xmin in between the two runs, the second run works as expected. The code works for example with NEWUOA. I also tried to reproduce the error with the Rosenbrock function as opt_func, but everything works fine there. Thanks, Klaus 2013/4/12 Steven G. Johnson <[email protected]> > > On Apr 12, 2013, at 7:54 AM, "[email protected]" < > [email protected]> wrote: > > > Dear all, > > > > I'm using NLopt to solve a non-linear optimization problem without > constraints. I was testing the algorithm BOBYQA, which is causing some > trouble. Depending on the initial guess, I get an the following error: > > > > terminate called after throwing an instance of 'std::invalid_argument' > > what(): nlopt invalid argument > > The initial guess must satisfy your bound constraints. Are you violating > those? > > > _______________________________________________ > NLopt-discuss mailing list > [email protected] > http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss >
_______________________________________________ NLopt-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
