@@ -112,3 +112,80 @@ function concrete_bridge_type(
112112) where {F<: MOI.VectorAffineFunction ,S<: MOI.AbstractScalarSet }
113113 return IndicatorActiveOnFalseBridge{Float64,F,S}
114114end
115+
116+ MOI. get (:: IndicatorActiveOnFalseBridge , :: MOI.NumberOfVariables ):: Int64 = 1
117+
118+ function MOI. get (b:: IndicatorActiveOnFalseBridge , :: MOI.ListOfVariableIndices )
119+ return [b. variable]
120+ end
121+
122+ function MOI. get (
123+ :: IndicatorActiveOnFalseBridge{T} ,
124+ :: MOI.NumberOfConstraints{MOI.ScalarAffineFunction{T},MOI.EqualTo{T}} ,
125+ ):: Int64 where {T}
126+ return 1
127+ end
128+
129+ function MOI. get (
130+ b:: IndicatorActiveOnFalseBridge{T} ,
131+ :: MOI.ListOfConstraintIndices{MOI.ScalarAffineFunction{T},MOI.EqualTo{T}} ,
132+ ) where {T}
133+ return [b. disjunction_cons]
134+ end
135+
136+ function MOI. get (
137+ :: IndicatorActiveOnFalseBridge{T,F,S} ,
138+ :: MOI.NumberOfConstraints{F,MOI.Indicator{MOI.ACTIVATE_ON_ONE,S}} ,
139+ ):: Int64 where {T,F,S}
140+ return 1
141+ end
142+
143+ function MOI. get (
144+ b:: IndicatorActiveOnFalseBridge{T,F,S} ,
145+ :: MOI.ListOfConstraintIndices{F,MOI.Indicator{MOI.ACTIVATE_ON_ONE,S}} ,
146+ ) where {T,F,S}
147+ return [b. indicator_cons_index]
148+ end
149+
150+ function MOI. get (
151+ :: IndicatorActiveOnFalseBridge{T} ,
152+ :: MOI.NumberOfConstraints{MOI.VariableIndex,MOI.ZeroOne} ,
153+ ):: Int64 where {T}
154+ return 1
155+ end
156+
157+ function MOI. get (
158+ b:: IndicatorActiveOnFalseBridge{T} ,
159+ :: MOI.ListOfConstraintIndices{MOI.VariableIndex,MOI.ZeroOne} ,
160+ ) where {T}
161+ return [b. zero_one_cons]
162+ end
163+
164+ function MOI. get (
165+ model:: MOI.ModelLike ,
166+ attr:: MOI.ConstraintSet ,
167+ b:: IndicatorActiveOnFalseBridge ,
168+ )
169+ set = MOI. get (model, attr, b. indicator_cons_index)
170+ return MOI. Indicator {MOI.ACTIVATE_ON_ZERO} (set. set)
171+ end
172+
173+ function MOI. get (
174+ model:: MOI.ModelLike ,
175+ attr:: MOI.ConstraintFunction ,
176+ b:: IndicatorActiveOnFalseBridge{T} ,
177+ ) where {T}
178+ f = MOI. get (model, attr, b. indicator_cons_index)
179+ y, fz = MOI. Utilities. eachscalar (f)
180+ z_plus_y = MOI. get (model, MOI. ConstraintFunction (), b. disjunction_cons)
181+ z = MOI. Utilities. operate (- , T, z_plus_y, y)
182+ MOI. Utilities. canonicalize! (z)
183+ return MOI. Utilities. operate (vcat, T, z, fz)
184+ end
185+
186+ function MOI. delete (model:: MOI.ModelLike , bridge:: IndicatorActiveOnFalseBridge )
187+ MOI. delete (model, bridge. disjunction_cons)
188+ MOI. delete (model, bridge. indicator_cons_index)
189+ MOI. delete (model, bridge. variable)
190+ return
191+ end
0 commit comments