@@ -210,9 +210,12 @@ Set the function to be used for forward mode differentiation of a constraint.
210210"""
211211function set_forward_constraint_function (
212212 model:: JuMP.Model ,
213- con_ref:: JuMP.ConstraintRef ,
213+ con_ref:: JuMP.ConstraintRef {
214+ M,
215+ <: MOI.ConstraintIndex{<:MOI.AbstractScalarFunction} ,
216+ },
214217 func:: JuMP.AbstractJuMPScalar ,
215- )
218+ ) where {M}
216219 JuMP. check_belongs_to_model (con_ref, model)
217220 JuMP. check_belongs_to_model (func, model)
218221 return MOI. set (
225228
226229function set_forward_constraint_function (
227230 model:: JuMP.Model ,
228- con_ref:: JuMP.ConstraintRef ,
231+ con_ref:: JuMP.ConstraintRef {
232+ M,
233+ <: MOI.ConstraintIndex{<:MOI.AbstractScalarFunction} ,
234+ },
229235 value:: Number ,
230- )
236+ ) where {M}
231237 JuMP. check_belongs_to_model (con_ref, model)
232238 return MOI. set (
233239 JuMP. backend (model),
239245
240246function set_forward_constraint_function (
241247 model:: JuMP.Model ,
242- con_ref:: JuMP.ConstraintRef ,
248+ con_ref:: JuMP.ConstraintRef {
249+ M,
250+ <: MOI.ConstraintIndex{<:MOI.AbstractVectorFunction} ,
251+ },
243252 value:: AbstractArray{<:JuMP.AbstractJuMPScalar} ,
244- )
253+ ) where {M}
245254 JuMP. check_belongs_to_model (con_ref, model)
246255 JuMP. check_belongs_to_model .(value, model)
247256 return MOI. set (
254263
255264function set_forward_constraint_function (
256265 model:: JuMP.Model ,
257- con_ref:: JuMP.ConstraintRef ,
266+ con_ref:: JuMP.ConstraintRef {
267+ M,
268+ <: MOI.ConstraintIndex{<:MOI.AbstractVectorFunction} ,
269+ },
258270 value:: AbstractArray{<:Number} ,
259- )
271+ ) where {M}
260272 JuMP. check_belongs_to_model (con_ref, model)
261273 return MOI. set (
262274 JuMP. backend (model),
268280
269281function set_forward_constraint_function (
270282 model:: JuMP.Model ,
271- con_ref:: JuMP.ConstraintRef{<:JuMP.AbstractModel,<:MOI.ConstraintIndex,S} ,
283+ con_ref:: JuMP.ConstraintRef {
284+ <: JuMP.AbstractModel ,
285+ <: MOI.ConstraintIndex{<:MOI.AbstractVectorFunction} ,
286+ S,
287+ },
272288 value:: AbstractMatrix{<:Number} ,
273289) where {S<: Union{JuMP.SquareMatrixShape,JuMP.SymmetricMatrixShape} }
274290 if ! LinearAlgebra. issymmetric (value)
0 commit comments