@@ -49,6 +49,25 @@ MOI.Utilities.@model(
4949 (),
5050)
5151
52+ MOI. Utilities. @model (
53+ AffineObjectiveModel,
54+ (),
55+ (MOI. LessThan, MOI. GreaterThan, MOI. EqualTo, MOI. Interval),
56+ (),
57+ (),
58+ (),
59+ (MOI. ScalarAffineFunction, MOI. ScalarQuadraticFunction),
60+ (),
61+ (),
62+ )
63+
64+ function MOI. supports (
65+ :: AffineObjectiveModel{T} ,
66+ :: MOI.ObjectiveFunction{F} ,
67+ ) where {T,F<: MOI.AbstractFunction }
68+ return F == MOI. ScalarAffineFunction{T}
69+ end
70+
5271function MOI. supports (
5372 :: Model ,
5473 :: MOI.ObjectiveFunction{MOI.ScalarNonlinearFunction} ,
@@ -336,6 +355,21 @@ function test_start(x, y, T)
336355 @test sort (MOI. get (inner, MOI. VariablePrimalStart (), vis)) == T[2 , 3 , 4 , 9 ]
337356end
338357
358+ function test_inner_bridge (x, y, T)
359+ # The quadratic objective should be bridged after the QCQP layer
360+ inner = AffineObjectiveModel {T} ()
361+ model = PolyJuMP. QCQP. Optimizer {T} (inner)
362+ a = MOI. add_variable (model)
363+ b = MOI. add_variable (model)
364+ p = PolyJuMP. ScalarPolynomialFunction (one (T) * x^ 3 - x * y^ 2 , [a, b])
365+ MOI. set (model, MOI. ObjectiveSense (), MOI. MIN_SENSE)
366+ MOI. set (model, MOI. ObjectiveFunction {typeof(p)} (), p)
367+ MOI. Utilities. final_touch (model, nothing )
368+ F = MOI. ScalarAffineFunction{T}
369+ @test MOI. ObjectiveFunction {F} () in
370+ MOI. get (inner, MOI. ListOfModelAttributesSet ())
371+ end
372+
339373function runtests (x, y)
340374 for name in names (@__MODULE__ ; all = true )
341375 if startswith (" $name " , " test_" )
0 commit comments