File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -690,9 +690,8 @@ function Base.write(io::IO, model::Model)
690690 println (io, " " , _str (g. upper))
691691 elseif g. opcode == 2
692692 println (io, " " , _str (g. lower))
693- # Free constraints aren't supported for nonlinear.
694- # elseif g.opcode == 3
695- # println(io)
693+ elseif g. opcode == 3
694+ println (io)
696695 else
697696 @assert g. opcode == 4
698697 println (io, " " , _str (g. lower))
Original file line number Diff line number Diff line change @@ -1090,6 +1090,17 @@ function test_empty_constraint()
10901090 @test haskey (mapping, ci)
10911091end
10921092
1093+ function test_writing_free_constraint ()
1094+ model = MOI. Utilities. UniversalFallback (MOI. Utilities. Model {Float64} ())
1095+ x = MOI. add_variable (model)
1096+ f = MOI. ScalarNonlinearFunction (:log , Any[x])
1097+ MOI. add_constraint (model, f, MOI. Interval (- Inf , Inf ))
1098+ n = NL. Model ()
1099+ _ = MOI. copy_to (n, model)
1100+ @test occursin (" r\n 3\n b" , sprint (write, n))
1101+ return
1102+ end
1103+
10931104function test_malformed_constraint_error ()
10941105 model = MOI. Utilities. UniversalFallback (MOI. Utilities. Model {Float64} ())
10951106 x = MOI. add_variable (model)
You can’t perform that action at this time.
0 commit comments