jump-dev/Dualization.jl

DualNames mapping rather than prefix

matbesancon opened this issue · 0 comments

This could be an alternative structure to DualNames rather than a replacement:
a DualNameMapping that takes pairs "pattern1" => "pattern2" and maps the first to the second for names.
Example:

m = Model()
# ...
@constraint(m, affine_cons[j=1:3],
    λ - c[j] >= dot(Cs[j], As[1])
)
Dualization.dualize(m,
dual_mapping=DualNameMapping("affine_cons" => "α")
)

resulting in a dual model with a constraint

λ : α[1]_1 + α[2]_1 + α[3]_1 = 1.0
# instead of
λ : dualaffine_cons[1]_1 + dualaffine_cons[2]_1 + dualaffine_cons[3]_1 = 1.0