Skip to content

Commit 1e201ee

Browse files
committed
Don't cache ConstraintFunction
1 parent 3fe3c19 commit 1e201ee

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

src/bridge.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ If the expanded expression cannot be converted to `F`, an error is thrown.
1717
"""
1818
struct FunctionGeneratorBridge{T,F,S} <: MOI.Bridges.Constraint.AbstractBridge
1919
constraints::Vector{MOI.ConstraintIndex{F,S}}
20-
func::FunctionGenerator{F}
2120
end
2221

2322
function MOI.Bridges.Constraint.bridge_constraint(
@@ -42,7 +41,7 @@ function MOI.Bridges.Constraint.bridge_constraint(
4241
)
4342
push!(constraints, ci)
4443
end
45-
return FunctionGeneratorBridge{T,F,S}(constraints, func)
44+
return FunctionGeneratorBridge{T,F,S}(constraints)
4645
end
4746

4847
function MOI.supports_constraint(
@@ -88,14 +87,6 @@ function MOI.get(
8887
return copy(bridge.constraints)
8988
end
9089

91-
function MOI.get(
92-
::MOI.ModelLike,
93-
::MOI.ConstraintFunction,
94-
bridge::FunctionGeneratorBridge,
95-
)
96-
return copy(bridge.func)
97-
end
98-
9990
function MOI.get(
10091
::MOI.ModelLike,
10192
::MOI.ConstraintSet,

test/bridge.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ function test_runtests_simple()
8080
)
8181
end
8282
end,
83+
cannot_unbridge = true,
8384
)
8485
end
8586

@@ -122,6 +123,7 @@ function test_runtests_equality()
122123
)
123124
end
124125
end,
126+
cannot_unbridge = true,
125127
)
126128
end
127129

@@ -187,6 +189,7 @@ function test_runtests_consecutive()
187189
MOI.GreaterThan(2.0),
188190
)
189191
end,
192+
cannot_unbridge = true,
190193
)
191194
end
192195

0 commit comments

Comments
 (0)