You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered that the printing of a MCPModel did not provide the complementarity constraints. Here is a first test to fix that:
functionprintMCP(m)
mcp_data = Complementarity.get_MCP_data(m)
res ="$(m)Complementarity constraints\n"# replace all subexpression
dict_s =Dict{Int,String}(
i =>nl_expr_string(m, REPLMode , expr)
for (i,expr) inenumerate(m.nlp_data.nlexpr)
)
sub_reg =r"subexpression\[(?<id>[0-9]+)\]"for (i,expr) in dict_s
m =match(sub_reg, expr)
try
dict_s[i] =replace(expr, m.match => dict_s[parse(Int, m[:id])])
catchendendfor c in mcp_data
expr_id =parse(Int,split("$(c.F)", "#")[end][1:end-1])
res = res *"$(c.lb) ≦ $(c.var)\n ⟂ $(dict_s[expr_id]) ≧ 0.0\n"endreturn res
end
For the example on the start page, this is the outcome of println(printMCP(m)):
Feasibility
Subject to
x >= 0.0
Complementarity constraints
0.0 ≦ x
⟂ x + 2.0 ≧ 0.0
The text was updated successfully, but these errors were encountered:
Hi all,
I discovered that the printing of a MCPModel did not provide the complementarity constraints. Here is a first test to fix that:
For the example on the start page, this is the outcome of
println(printMCP(m))
:The text was updated successfully, but these errors were encountered: