[Ipopt] Problem in setting "max_iter" in C++ interface
Seth Watts
seth.e.watts at gmail.com
Tue Oct 9 09:33:07 EDT 2012
Hi Nuno -
While I can't shed any light on why setting the maximum number of
iterations this way throws an exception, as a work around, have you tried
setting the maximum number of iterations via an options file? I set this
value using a file called ipopt.opt in the calling directory which has
(among other options) the line
max_iter 500
This works for my build of Ipopt without any errors, and additionally
allows you to change max_iter without having to re-compile your program, as
ipopt.opt is read at run time.
- Seth
On Tue, Oct 9, 2012 at 8:17 AM, Nuno Silva <pg17455 at alunos.uminho.pt> wrote:
> Greetings
>
> I'm using the C++ interface and I'm trying to set the "max_iter" option,
> but I get an exception:
> "...Microsoft C++ exception: std::bad_alloc at memory location..."
>
> Here is the surrounding code, the exception is thrown at the second line:
>
> SmartPtr<IpoptApplication> app = IpoptApplicationFactory();
> app->Options()->SetIntegerValue("max_iter", 500);
> ApplicationReturnStatus status = app->Initialize();
>
>
> Thanks
> Nuno
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20121009/e0626773/attachment.html>
More information about the Ipopt
mailing list