Closed LebedevRI closed 2 months ago
Replace c1, [k=1:N]
by c1[k=1:N]
Replace
c1, [k=1:N]
byc1[k=1:N]
D'oh! Thank you.
MWE:
julia> using JuMP
julia> model = Model();
julia> @variable(model, x)
x
julia> @constraint(model, c, [k in 1:2], x <= k)
ERROR: LoadError: At REPL[9]:1: `@constraint(model, c, [k in 1:2], x <= k)`: Unsupported constraint expression: we don't know how to parse constraints containing expressions of type :vect.
If you are writing a JuMP extension, implement `parse_constraint_head(::Function, ::Val{:vect}, args...)
Stacktrace:
[1] error(::String, ::String)
@ Base ./error.jl:44
[2] (::JuMP.Containers.var"#error_fn#98"{String})(str::String)
@ JuMP.Containers ~/.julia/dev/JuMP/src/Containers/macro.jl:331
[3] parse_constraint_head(error_fn::JuMP.Containers.var"#error_fn#98"{String}, ::Val{:vect}, args::Expr)
@ JuMP ~/.julia/dev/JuMP/src/macros/@constraint.jl:412
[4] parse_constraint(error_fn::Function, expr::Expr)
@ JuMP ~/.julia/dev/JuMP/src/macros/@constraint.jl:307
[5] var"@constraint"(__source__::LineNumberNode, __module__::Module, input_args::Vararg{Any})
@ JuMP ~/.julia/dev/JuMP/src/macros/@constraint.jl:140
in expression starting at REPL[9]:1
We can improve this particular error message.
@LebedevRI since you've now opened quite a few issues, I might ask that you try to make minimal reproducible examples: strip out all the unnecessary stuff, like HiGHS, the Symmetric, comments, etc, so that only the code necessary to reproduce the bug remains.
Thank you for taking a look!
@LebedevRI since you've now opened quite a few issues, I might ask that you try to make minimal reproducible examples: strip out all the unnecessary stuff, like HiGHS, the Symmetric, comments, etc, so that only the code necessary to reproduce the bug remains.
FWIW, i'm already doing that, but i guess insufficiently.