lanl-ansi / Alpine.jl

A Julia/JuMP-based Global Optimization Solver for Non-convex Programs
https://lanl-ansi.github.io/Alpine.jl/latest/
Other
244 stars 39 forks source link

bounds error #118

Closed stumarcus314 closed 4 years ago

stumarcus314 commented 5 years ago

I get the following error. Might this have something to do with Julia v0.6.4 vs v0.7?

ERROR: LoadError: BoundsError: attempt to access 3×5 Array{Variable,2} at index [1, 1, 5] Stacktrace: [1] macro expansion at ./array.jl:732 [inlined] [2] MVB_MINLP_Alpine(::Array{Float64,2}, ::Bool, ::AlpineSolver, ::Bool, ::Bool, ::Array{Int64,1}, ::Array{Int64,1}, ::Float64, ::Float64) at /Users/a598124/juliaCode/pre19/MVB_MINLP_Alpine.jl:84 [3] top-level scope at /Users/a598124/juliaCode/pre19/hydrox_Alpine.jl:328 [4] include at ./boot.jl:317 [inlined] [5] include_relative(::Module, ::String) at ./loading.jl:1038 [6] include(::Module, ::String) at ./sysimg.jl:29 [7] exec_options(::Base.JLOptions) at ./client.jl:239 [8] _start() at ./client.jl:432 in expression starting at /Users/a598124/juliaCode/pre19/hydrox_Alpine.jl:205

harshangrjn commented 5 years ago

Does this run fine in v0.6.4 but not in v0.7? It looks like an error in accessing your variables. Post a simple version of the code which reproduces this error.

stumarcus314 commented 5 years ago

The code works okay in v0.6.4, but using P.W.L. of the nonlinear objective and solving the model as a MILP, since I can't install Alpine in v0.6.4. I get the same bounds error in v0.7 when using P.W.L. of the nonlinear objective and solving the model as a MILP.

stumarcus314 commented 5 years ago

The error says: attempt to access 3×5 Array{Variable,2} at index [1, 1, 5]. Does Variable refer exclusively to a continuous variable rather than a binary variable? In this instance of my model, n=5. In my model, there is a 3x5 matrix X of continuous variables defined as follows: @variable(m,0 <= X[d=1:3,i=1:n] <= upper_x[d]-min_p[i]) # coordinates of left-back-bottom corner of each carton If the error corresponds to X, why would JuMP attempt to access index [1, 1, 5]?

kaarthiksundar commented 5 years ago

Try updating Julia to v1.0, updating alpine to v1.9. If this error persists then please post an example so that we can replicate it on our side.

harshangrjn commented 4 years ago

@stumarcus576 If you see this error again, feel free to re-open this issue.