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

Bad error message #217

Closed
IainNZ opened this issue Jul 5, 2014 · 6 comments
Closed

Bad error message #217

IainNZ opened this issue Jul 5, 2014 · 6 comments

Comments

@IainNZ
Copy link
Collaborator

IainNZ commented Jul 5, 2014

using JuMP
function test(N)
  m = Model()
  @defVar(m, x[-5N:5N])
end
test(1)
ERROR: Currently only ranges with integer compile-time starting values are allowed as index sets. -5N is not an integer in range -5N:5N.
@IainNZ
Copy link
Collaborator Author

IainNZ commented Jul 5, 2014

Also,

function test(N)
  m = Model()
  @defVar(m, x[[-5*N:5*N]])
end

works fine

@joehuchette
Copy link
Contributor

Maybe we can implicitly turn @defVar(m, x[-5N:5N]) into @defVar(m, x[[-5N:5N]])?

@IainNZ
Copy link
Collaborator Author

IainNZ commented Jul 5, 2014

Something is wrong, because 1:5N is ok but -5N:5N isn't

@joehuchette
Copy link
Contributor

The error is alluding as to that though, -5N isn't an integer value known at compile-time. It could be a bit clearer, and hopefully we can remove that restriction entirely.

@mlubin
Copy link
Member

mlubin commented Jul 5, 2014

This is fixed by #192

@IainNZ
Copy link
Collaborator Author

IainNZ commented Jul 5, 2014

Oh good

@IainNZ IainNZ closed this as completed Jul 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants