@@ -30,18 +30,18 @@ function _getset(constrs::Vector, ci::CI, i::Int)
30
30
_gets (constrs[i]. .. )
31
31
end
32
32
33
- _modifyconstr {F, S} (ci:: CI{F, S} , f:: F , s:: S , change:: F ) = (ci, change, s)
34
- _modifyconstr {F, S} (ci:: CI{F, S} , f:: F , s:: S , change:: S ) = (ci, f, change)
35
- _modifyconstr {F, S} (ci:: CI{F, S} , f:: F , s:: S , change:: MOI.AbstractFunctionModification ) = (ci, modifyfunction (f, change), s)
36
- function _modifyconstraint! {F, S} (constrs:: Vector{C{F, S}} , ci:: CI{F} , i:: Int , change)
33
+ _modifyconstr (ci:: CI{F, S} , f:: F , s:: S , change:: F ) where {F, S} = (ci, change, s)
34
+ _modifyconstr (ci:: CI{F, S} , f:: F , s:: S , change:: S ) where {F, S} = (ci, f, change)
35
+ _modifyconstr (ci:: CI{F, S} , f:: F , s:: S , change:: MOI.AbstractFunctionModification ) where {F, S} = (ci, modifyfunction (f, change), s)
36
+ function _modifyconstraint! (constrs:: Vector{C{F, S}} , ci:: CI{F} , i:: Int , change) where {F, S}
37
37
constrs[i] = _modifyconstr (constrs[i]. .. , change)
38
38
end
39
39
40
- _getnoc {F, S} (constrs:: Vector{C{F, S}} , noc:: MOI.NumberOfConstraints{F, S} ) = length (constrs)
40
+ _getnoc (constrs:: Vector{C{F, S}} , noc:: MOI.NumberOfConstraints{F, S} ) where {F, S} = length (constrs)
41
41
# Might be called when calling NumberOfConstraint with different coefficient type than the one supported
42
42
_getnoc (constrs:: Vector , noc:: MOI.NumberOfConstraints ) = 0
43
43
44
- function _getloc {F, S} (constrs:: Vector{C{F, S}} ):: Vector{Tuple{DataType, DataType}}
44
+ function _getloc (constrs:: Vector{C{F, S}} ):: Vector{Tuple{DataType, DataType}} where {F, S }
45
45
isempty (constrs) ? [] : [(F, S)]
46
46
end
47
47
@@ -534,7 +534,7 @@ macro model(modelname, ss, sst, vs, vst, sf, sft, vf, vft)
534
534
field = _field (s)
535
535
code = quote
536
536
$ code
537
- $ funct {F} (model:: $c , ci:: $T{F, <:$set} , args... ) = $ funct (model.$ field, ci, args... )
537
+ $ funct (model:: $c , ci:: $T{F, <:$set} , args... ) where F = $ funct (model.$ field, ci, args... )
538
538
end
539
539
end
540
540
end
0 commit comments