can I also enjoy the similar convenience on dual variables
No. JuMP does not have an explicit representation of dual variables.
c1[1]should be deemed a dual variable
No. c1 is a reference to the constraint. A constraint has both a primal value (the value of f(x) from f(x) in set) and a dual value.
The hope is that Can we do this before
optimize!? Something likeJuMP.@dual_expression(model, cv, [-c1; c2])
This is not possible. And I don’t particularly want to add this.
Among the many reasons, JuMP’s primal variables are scalars, and we use Julia collections to construct Vector, Matrix of them, etc. Constraints (and their primal/dual values) have a shape. So constructing expression of them is non-trivial.