Skip to content

Commit 886bd53

Browse files
authored
Add show(::IO, ::_VectorNonlinearOracle) (#501)
1 parent a60fb12 commit 886bd53

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ext/IpoptMathOptInterfaceExt/MOI_wrapper.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@ MOI.dimension(s::_VectorNonlinearOracle) = s.input_dimension
164164

165165
MOI.copy(s::_VectorNonlinearOracle) = s
166166

167+
function Base.show(io::IO, s::_VectorNonlinearOracle)
168+
println(io, "Ipopt._VectorNonlinearOracle(;")
169+
println(io, " dimension = ", s.input_dimension, ",")
170+
println(io, " l = ", s.l, ",")
171+
println(io, " u = ", s.u, ",")
172+
println(io, " ...,")
173+
print(io, ")")
174+
return
175+
end
176+
167177
"""
168178
Optimizer()
169179

test/MOI_wrapper.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ function test_vector_nonlinear_oracle()
886886
return
887887
end,
888888
)
889+
@test occursin("Ipopt._VectorNonlinearOracle(;", sprint(show, set))
889890
@test MOI.dimension(set) == 5
890891
@test MOI.copy(set) === set
891892
model = Ipopt.Optimizer()

0 commit comments

Comments
 (0)