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

Creating arrays of variables with UInt bounds #857

Closed
allbits opened this issue Oct 2, 2016 · 2 comments
Closed

Creating arrays of variables with UInt bounds #857

allbits opened this issue Oct 2, 2016 · 2 comments

Comments

@allbits
Copy link

allbits commented Oct 2, 2016

The following does not work.

function build()
m = Model()
n::UInt = 4
@variable(m,x[1:n])
end

Changing UInt to Int works.

@joehuchette
Copy link
Contributor

This is a surprisingly subtle issue, caused by the fact that length(1:UInt(4)) returns a UInt(4) (rather than an integer, as is usually the case). I believe there's an open issue in the julia repo for this.

@joehuchette
Copy link
Contributor

Closed by #862, thanks for reporting

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

No branches or pull requests

2 participants