Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slightly misleading in readme #11

Open
Azureuse opened this issue Feb 24, 2021 · 1 comment
Open

Slightly misleading in readme #11

Azureuse opened this issue Feb 24, 2021 · 1 comment

Comments

@Azureuse
Copy link

Firstly thank you for making such a useful extension to OSQP.

I think the readme is slightly misleading on the final line where it says

minimize        0.5 x' P x + q' x

subject to      l <= A x <= u
                x[i] in Z for i in i_idx
                i_l[i] <= x[i] <= i_u[i] for i in i_idx

In this expression i could take values from 0 to n-1 where n is the total number of variables - these are the possible values of the entries in i_idx. However i_l and i_u will only have len(i_idx) <= n elements.

I believe it should more accurately say something like (in python pseudocode at least)

i_l[j] <= x[i] <= i_u[j] for j, i in enumerate(i_idx)

I hope that makes sense :)

@yasirroni
Copy link

yasirroni commented Sep 14, 2021

You are correct. Here is what I'm understood (after I use the code):

x: is all the variable
i_idx: contains index where x is strictly integer
x[i] in Z for i in i_idx: strictly integer variable
i_l[i] <= x[i] <= i_u[i] for i in i_idx: is lower and upper bounds of the strictly integer variable

Thus:

len(i_l) == len(i_u) == len(i_idx)

Making i_l[j] <= x[i] <= i_u[j] for j, i in enumerate(i_idx) is more correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants