File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
ext/IpoptMathOptInterfaceExt Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -988,7 +988,7 @@ function MOI.get(
988988 MOI. ScalarQuadraticFunction{Float64},
989989 },
990990}
991- return MOI. get (model. qp_data, attr)
991+ return convert (F, MOI. get (model. qp_data, attr) )
992992end
993993
994994function MOI. set (
Original file line number Diff line number Diff line change @@ -1240,6 +1240,15 @@ function test__VectorNonlinearOracle()
12401240 return
12411241end
12421242
1243+ function test_default_objective_function ()
1244+ model = Ipopt. Optimizer ()
1245+ F = MOI. get (model, MOI. ObjectiveFunctionType ())
1246+ @test F == MOI. ScalarAffineFunction{Float64}
1247+ f = MOI. get (model, MOI. ObjectiveFunction {F} ())
1248+ @test f ≈ zero (F)
1249+ return
1250+ end
1251+
12431252end # module TestMOIWrapper
12441253
12451254TestMOIWrapper. runtests ()
You can’t perform that action at this time.
0 commit comments