A bug on function "strmatch_octavesafe"?

68 views
Skip to first unread message

c.c

unread,
Jun 12, 2020, 2:41:51 PM6/12/20
to YALMIP
Hello, Mr. Johan Löfberg

I'm a fresh man on this tool YAMIP. When I set the optimal gap in the sdpsettings(). I find I can only set the parameters "gurobi.MIPGapAbs", but no "gurobi.MIPGap". In fact, both parameters "gurobi.MIPGapAbs" and "gurobi.MIPGap" can be found in sdpsetting function if I choose the solver to be gurobi.

This is a small demo that illustrates the error.

clear;

sdpvar x y
;
Constraints =[(-1<=x<=4):'Boundary'];
Constraints =[Constraints,...
   
(y==x):'Objecitve function'];

options
= sdpsettings('solver', 'gurobi', ...
   
'gurobi.MIPGap',0.05); % No problem !

options
= sdpsettings('solver', 'gurobi', ...
   
'verbose',0,...
   
'gurobi.MIPGap',0.05);% Error using strmatch_octavesafe : Too many input arguments.

optimize
(Constraints,y,options);
solution
= value(x);

I check the syntax where it reports bug. Actually, the function strmatch_octavesafe() only accepts 2 input variables.
function idx = strmatch_octavesafe(S, A)
     idx
= find(strncmp(S, A, numel(S)));
%     idx = find(strcmpi(S, A));
end

But in sdpsettings(), it calls the function with the following two ways,

j = strmatch_octavesafe(lowArg,names);
or, 
k = strmatch_octavesafe(lowArg,names,'exact');


Do you have some better ways to fix this problem? 
 YALMIP-master\YALMIP-master\extras\strmatch_octavesafe.m

Best regards,
CC

c.c

unread,
Jun 12, 2020, 2:45:19 PM6/12/20
to YALMIP
When I check it in the GitHub website, I find the bug has been fixed, but not included in the latest release version.

... ...
https://github.com/yalmip/YALMIP/blob/develop/extras/strmatch_octavesafe.m

Johan Löfberg

unread,
Jun 12, 2020, 3:25:15 PM6/12/20
to YALMIP
fixed in develop branch (which also supports all gurobi options)
Reply all
Reply to author
Forward
0 new messages