Closed blegat closed 3 years ago
This would be great!
We could have a @parameter
macro that simply calls the @variable
macro with the extra argument.
Would this allow to create multiple parameters at once?
Yes, with the container syntax, it creates a container of parameters
I tried for a long to create a @parameter
macro that correctly calls the @variable
marco with appropriate arguments. Do you think that is feasible?
In #47 I managed to get @variable m x[2:3, 1:5] == 1 ParameterJuMP.Param()
working.
Still have to figure out how to get this: @variable m x[2:3, 1:5] == 1 Param()
working...
Param
is being exported, but there might be some scope/escape problem
It would also be nice to have anonimous:
@variable m Param()
and of course it would be even nicer to have:
@parameter
But figuring out what to esc
might be not trivial...
I asked a bit on discourse, but their solutions won´t work: https://discourse.julialang.org/t/args-in-macros/22256
It would also be nice to have anonimous:
@variable m Param()
This won't you need to do @variable(m, variable_type=Param())
there might be some scope/escape problem
That would be surprising, it works with PolyJuMP, SumOfSquares and SetProg
At some point, this got fixed.
What would you think of a constructor to create the variables ? The easiest way is to implement
and
The user will then be able to create parameters using the
@variable
macro, e.g.