nlpsol constructor call with char, char, struct, struct struct

87 views
Skip to first unread message

Raoul Herzog

unread,
Sep 17, 2016, 11:12:48 AM9/17/16
to CasADi, Joris Gillis
dear Joris,

the following code snippet does not work

nlp = struct('x', V, 'f', f, 'g', g);

ipopts_opts.ipopt.print_level = 0;

ipopts_opts.ipopt.print_timing_statistics = 'NO';

solver = nlpsol('solver', 'ipopt', nlp, struct('jit', true), ipopts_opts);

The error message is :

Error using casadiMEX
No matching function for overload function 'nlpsol'.  Possible prototypes are:
    NLPSOL(char,char,Importer,struct)
    NLPSOL(char,char,struct:SX,struct)
    NLPSOL(char,char,struct:MX,struct)
    NLPSOL(char,char,char,struct)
  You have: char, char, struct, struct, struct


Error in casadi.nlpsol (line 857)
  [varargout{1:nargout}] = casadiMEX(860, varargin{:});

=====

It works if I leave away struct('jit', true).

It also works if I leave away the ipopts_opts.

How can I get work the combination ?


Many thanks in advance,


--raoul


Joris Gillis

unread,
Sep 17, 2016, 11:26:35 AM9/17/16
to CasADi, joris.g...@gmail.com
Simply merge the two option dictionaries/structures:

opts = struct;
opts
.ipopt.print_level = 0;

opts.ipopt.print_timing_statistics = 'NO';

opts.jit = true;

solver   = nlpsol('solver', 'ipopt', nlp, opts);



   Joris
Reply all
Reply to author
Forward
0 new messages