Possible bug in propagate_bounds_from_equalities.m

42 views
Skip to first unread message

Roberto

unread,
Jun 10, 2014, 8:31:57 AM6/10/14
to yal...@googlegroups.com
I don't know if this is the right place to report bugs... anyway I'm getting a Subscript indices must either be real positive integers or logicals error recently... I think it would take a lot of time to strip down my code to something which is reproducible as well as understandable by someone other than me, so I decided to inspect some yalmip code by myself.
I found one line which is very obscure to me, it's line 34 in propagate_bounds_from_equalities.m
usedVars = col(2:end)-1;

The first two elements of col are ones in my case, i.e. col=[1; 1; ....], so the first element of usedVars is 1-1=0. Unfortunately in the next line usedVars is used to index a vector that apparently contains lower bounds. Then i get the aforementioned error, because p.lb(usedVars) doesn't make sense (at runtime, of course).

Johan Löfberg

unread,
Jun 10, 2014, 12:11:14 PM6/10/14
to yal...@googlegroups.com
I would really like to have some code to reproduce this, A massive chunk of code and data is better than no code at all so no problems if that is what you have, as long as you tell me how to run it (preferably a simple call "runthis" or something like that)

Roberto

unread,
Jun 10, 2014, 12:16:53 PM6/10/14
to yal...@googlegroups.com
I don't know... I don't feel comfortable with publishing my work on the internet, if it may be included in a paper one day.
I'll try to modify my code in a way that no one can understand the meaning of the variables at least.

Johan Löfberg

unread,
Jun 10, 2014, 12:20:05 PM6/10/14
to yal...@googlegroups.com
You are welcome to send the code privately to me if you want.

Johan Löfberg

unread,
Jun 11, 2014, 2:04:09 AM6/11/14
to yal...@googlegroups.com
Change line 25 to

 for j = interestingRows(:)'


Roberto

unread,
Jun 11, 2014, 3:23:14 AM6/11/14
to yal...@googlegroups.com
It works very good now. Thanks!

Johan Löfberg

unread,
Jun 13, 2014, 2:36:43 AM6/13/14
to yal...@googlegroups.com
...and line 23 should be

    interestingRows = find(p_F_struc(1:p.K.f,1));



Reply all
Reply to author
Forward
0 new messages