@@ -11,45 +11,6 @@ struct ObjectiveFunctionAttribute{A,F} <: MOI.AbstractModelAttribute
11
11
attr:: A
12
12
end
13
13
14
- """
15
- struct ObjectiveDualStart <: MOI.AbstractModelAttribute end
16
-
17
- If the objective function had a dual, it would be `-1` for the Lagrangian
18
- function to be the same.
19
- When the `MOI.Bridges.Objective.SlackBridge` is used, it creates a constraint.
20
- The dual of this constraint is therefore `-1` as well.
21
- When setting this attribute, it allows to set the constraint dual of this
22
- constraint.
23
- """
24
- struct ObjectiveDualStart <: MOI.AbstractModelAttribute end
25
- # Defining it for `MOI.set` leads to ambiguity
26
- function MOI. throw_set_error_fallback (
27
- :: MOI.ModelLike ,
28
- :: ObjectiveDualStart ,
29
- value,
30
- )
31
- return nothing
32
- end
33
-
34
- """
35
- struct ObjectiveSlackGapPrimalStart <: MOI.AbstractModelAttribute end
36
-
37
- If the objective function had a dual, it would be `-1` for the Lagrangian
38
- function to be the same.
39
- When the `MOI.Bridges.Objective.SlackBridge` is used, it creates a constraint.
40
- The dual of this constraint is therefore `-1` as well.
41
- When setting this attribute, it allows to set the constraint dual of this
42
- constraint.
43
- """
44
- struct ObjectiveSlackGapPrimalStart <: MOI.AbstractModelAttribute end
45
- function MOI. throw_set_error_fallback (
46
- :: MOI.ModelLike ,
47
- :: ObjectiveSlackGapPrimalStart ,
48
- value,
49
- )
50
- return nothing
51
- end
52
-
53
14
function MOI. get (
54
15
b:: MOI.Bridges.AbstractBridgeOptimizer ,
55
16
attr:: ObjectiveFunctionAttribute{A,F} ,
100
61
101
62
function MOI. set (
102
63
b:: MOI.Bridges.AbstractBridgeOptimizer ,
103
- attr:: Union {
104
- ObjectiveDualStart,
105
- ObjectiveSlackGapPrimalStart,
106
- ForwardObjectiveFunction,
107
- },
64
+ attr:: ForwardObjectiveFunction ,
108
65
value,
109
66
)
110
67
if MOI. Bridges. is_objective_bridged (b)
@@ -121,34 +78,6 @@ function MOI.set(
121
78
end
122
79
end
123
80
124
- function MOI. set (
125
- model:: MOI.ModelLike ,
126
- :: ObjectiveFunctionAttribute{ObjectiveDualStart} ,
127
- b:: MOI.Bridges.Objective.SlackBridge ,
128
- value,
129
- )
130
- return MOI. set (model, MOI. ConstraintDualStart (), b. constraint, value)
131
- end
132
-
133
- function MOI. set (
134
- model:: MOI.ModelLike ,
135
- :: ObjectiveFunctionAttribute{ObjectiveSlackGapPrimalStart} ,
136
- b:: MOI.Bridges.Objective.SlackBridge{T} ,
137
- value,
138
- ) where {T}
139
- # `f(x) - slack = value` so `slack = f(x) - value`
140
- fun = MOI. get (model, MOI. ConstraintFunction (), b. constraint)
141
- set = MOI. get (model, MOI. ConstraintSet (), b. constraint)
142
- MOI. Utilities. operate! (- , T, fun, MOI. constant (set))
143
- # `fun = f - slack` so we remove the term `-slack` to get `f`
144
- f = MOI. Utilities. remove_variable (fun, b. slack)
145
- f_val = MOI. Utilities. eval_variables (f) do v
146
- return MOI. get (model, MOI. VariablePrimalStart (), v)
147
- end
148
- MOI. set (model, MOI. VariablePrimalStart (), b. slack, f_val - value)
149
- return MOI. set (model, MOI. ConstraintPrimalStart (), b. constraint, value)
150
- end
151
-
152
81
function _copy_dual (dest:: MOI.ModelLike , src:: MOI.ModelLike , index_map)
153
82
vis_src = MOI. get (src, MOI. ListOfVariableIndices ())
154
83
MOI. set (
@@ -173,8 +102,10 @@ function _copy_dual(dest::MOI.ModelLike, src::MOI.ModelLike, index_map)
173
102
MOI. ConstraintDual (),
174
103
)
175
104
end
176
- MOI. set (dest, ObjectiveDualStart (), - 1.0 )
177
- return MOI. set (dest, ObjectiveSlackGapPrimalStart (), 0.0 )
105
+ # Same as in `JuMP.set_start_values`
106
+ # Needed for models which bridge `min f(x)` into `min t such that t >= f(x)`.
107
+ MOI. set (dest, MOI. Bridges. Objective. SlackBridgePrimalDualStart (), nothing )
108
+ return
178
109
end
179
110
180
111
function _copy_constraint_start (
0 commit comments