Skip to content

Commit 2491880

Browse files
authored
Compatibility with MOI v1.23 (#102)
1 parent c7a3cd7 commit 2491880

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockDecomposition"
22
uuid = "6cde8614-403a-11e9-12f1-c10d0f0caca0"
33
authors = ["Guillaume Marques", "Vitor Nesello", "François Vanderbeck"]
4-
version = "1.14.0"
4+
version = "1.14.1"
55

66
[deps]
77
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"

src/customdata.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ end
109109

110110
function MOI.set(
111111
dest::MOIU.UniversalFallback, attribute::CustomVarValue, vi::MOI.VariableIndex, value::CD
112-
) where CD <: AbstractCustomData
112+
) where {CD<:AbstractCustomData}
113113
if CD MOI.get(dest, CustomVars())
114114
throw(UnregisteredCustomDataFamily(string(CD)))
115115
end
116116
if !haskey(dest.varattr, attribute)
117-
dest.varattr[attribute] = Dict{MOI.VariableIndex, Any}()
117+
dest.varattr[attribute] = Dict{MOI.VariableIndex,Any}()
118118
end
119119
dest.varattr[attribute][vi] = value
120120
return
@@ -128,12 +128,12 @@ end
128128

129129
function MOI.set(
130130
dest::MOIU.UniversalFallback, attribute::CustomConstrValue, ci::MOI.ConstraintIndex, value::CD
131-
) where CD <: AbstractCustomData
131+
) where {CD<:AbstractCustomData}
132132
if CD MOI.get(dest, CustomConstrs())
133133
throw(UnregisteredCustomDataFamily(string(CD)))
134134
end
135135
if !haskey(dest.conattr, attribute)
136-
dest.conattr[attribute] = Dict{MOI.ConstraintIndex, Any}()
136+
dest.conattr[attribute] = Dict{MOI.ConstraintIndex,Any}()
137137
end
138138
dest.conattr[attribute][ci] = value
139139
return
@@ -150,4 +150,8 @@ MathOptInterface.Utilities.map_indices(
150150
) = x
151151
MathOptInterface.Utilities.map_indices(
152152
variable_map::MathOptInterface.Utilities.IndexMap, x::Vector{AbstractCustomData}
153-
) = x
153+
) = x
154+
155+
# added for compatibility with MathOptInterface v1.23
156+
MathOptInterface.Utilities.map_indices(f::Function, x::AbstractCustomData) = x
157+
MathOptInterface.Utilities.map_indices(f::Function, x::Vector{AbstractCustomData}) = x

0 commit comments

Comments
 (0)